aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-11 12:33:23 +0000
committerGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-11 12:33:23 +0000
commitdb60de7cbe3ea9643a0471e1225a6abeac021de3 (patch)
treeef7b27f312e9d544ad3aa695a3a805535f3edde5 /tests
parent391ca66276b27464f255c371e7e95f56f9042042 (diff)
shape ops test fixes
- fix rand for Android - build unit test on linux - use atomic inc in test count - add casting for Android git-svn-id: http://skia.googlecode.com/svn/trunk@8610 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests')
-rw-r--r--tests/PathOpsCubicIntersectionTest.cpp2
-rw-r--r--tests/PathOpsQuadLineIntersectionThreadedTest.cpp3
-rw-r--r--tests/Test.h3
3 files changed, 5 insertions, 3 deletions
diff --git a/tests/PathOpsCubicIntersectionTest.cpp b/tests/PathOpsCubicIntersectionTest.cpp
index 5a6a336a3f..be9781dde6 100644
--- a/tests/PathOpsCubicIntersectionTest.cpp
+++ b/tests/PathOpsCubicIntersectionTest.cpp
@@ -305,7 +305,7 @@ static void oneOffTests(skiatest::Reporter* reporter) {
static void CubicIntersection_RandTest(skiatest::Reporter* reporter) {
srand(0);
const int tests = 10000000;
-#ifndef SK_BUILD_FOR_WIN
+#if !defined(SK_BUILD_FOR_WIN) && !defined(SK_BUILD_FOR_ANDROID)
unsigned seed = 0;
#endif
for (int test = 0; test < tests; ++test) {
diff --git a/tests/PathOpsQuadLineIntersectionThreadedTest.cpp b/tests/PathOpsQuadLineIntersectionThreadedTest.cpp
index c74e9619d4..a931221345 100644
--- a/tests/PathOpsQuadLineIntersectionThreadedTest.cpp
+++ b/tests/PathOpsQuadLineIntersectionThreadedTest.cpp
@@ -81,7 +81,8 @@ static void testQuadLineIntersectMain(PathOpsThreadState* data)
int by = state.fB >> 2;
int cx = state.fC & 0x03;
int cy = state.fC >> 2;
- SkDQuad quad = {{{ax, ay}, {bx, by}, {cx, cy}}};
+ SkDQuad quad = {{{(double) ax, (double) ay}, {(double) bx, (double) by},
+ {(double) cx, (double) cy}}};
SkReduceOrder reducer;
int order = reducer.reduce(quad, SkReduceOrder::kFill_Style);
if (order < 3) {
diff --git a/tests/Test.h b/tests/Test.h
index f90edab1c1..bfb4d60761 100644
--- a/tests/Test.h
+++ b/tests/Test.h
@@ -11,6 +11,7 @@
#include "SkRefCnt.h"
#include "SkString.h"
#include "SkTRegistry.h"
+#include "SkThread.h"
class GrContextFactory;
@@ -31,7 +32,7 @@ namespace skiatest {
};
void resetReporting();
- void bumpTestCount() { ++fTestCount; }
+ void bumpTestCount() { sk_atomic_inc(&fTestCount); }
int countTests() const { return fTestCount; }
int countResults(Result r) {
SkASSERT((unsigned)r <= kLastResult);