aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PathOpsQuadLineIntersectionThreadedTest.cpp
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2016-10-06 11:46:25 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-10-06 11:46:25 -0700
commit8f1864386734cfa7650a5576ba453745a407ade2 (patch)
tree413e5df77a872a26e02dc4b64ef191e6df4948f1 /tests/PathOpsQuadLineIntersectionThreadedTest.cpp
parent33cbfd75afdd383770bb6253c06ba819a2481a35 (diff)
remove sprintf
Most uses of sprintf are in pathops testing. Replace them with SkString::appendf and replace the remaining with snprintf R=scroggo@google.com BUG=skia:2716 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2391133005 Review-Url: https://codereview.chromium.org/2391133005
Diffstat (limited to 'tests/PathOpsQuadLineIntersectionThreadedTest.cpp')
-rw-r--r--tests/PathOpsQuadLineIntersectionThreadedTest.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/PathOpsQuadLineIntersectionThreadedTest.cpp b/tests/PathOpsQuadLineIntersectionThreadedTest.cpp
index 9ecc1f052f..7766cfe028 100644
--- a/tests/PathOpsQuadLineIntersectionThreadedTest.cpp
+++ b/tests/PathOpsQuadLineIntersectionThreadedTest.cpp
@@ -10,6 +10,7 @@
#include "SkPathOpsLine.h"
#include "SkPathOpsQuad.h"
#include "SkReduceOrder.h"
+#include "SkString.h"
static int doIntersect(SkIntersections& intersections, const SkDQuad& quad, const SkDLine& line,
bool& flipped) {
@@ -40,14 +41,12 @@ static int doIntersect(SkIntersections& intersections, const SkDQuad& quad, cons
static void testLineIntersect(skiatest::Reporter* reporter, const SkDQuad& quad,
const SkDLine& line, const double x, const double y) {
- char pathStr[1024];
- sk_bzero(pathStr, sizeof(pathStr));
- char* str = pathStr;
- str += sprintf(str, " path.moveTo(%1.9g, %1.9g);\n", quad[0].fX, quad[0].fY);
- str += sprintf(str, " path.quadTo(%1.9g, %1.9g, %1.9g, %1.9g);\n", quad[1].fX,
+ SkString pathStr;
+ pathStr.appendf(" path.moveTo(%1.9g, %1.9g);\n", quad[0].fX, quad[0].fY);
+ pathStr.appendf(" path.quadTo(%1.9g, %1.9g, %1.9g, %1.9g);\n", quad[1].fX,
quad[1].fY, quad[2].fX, quad[2].fY);
- str += sprintf(str, " path.moveTo(%1.9g, %1.9g);\n", line[0].fX, line[0].fY);
- str += sprintf(str, " path.lineTo(%1.9g, %1.9g);\n", line[1].fX, line[1].fY);
+ pathStr.appendf(" path.moveTo(%1.9g, %1.9g);\n", line[0].fX, line[0].fY);
+ pathStr.appendf(" path.lineTo(%1.9g, %1.9g);\n", line[1].fX, line[1].fY);
SkIntersections intersections;
bool flipped = false;