aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/MathTest.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-08-15 13:43:23 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-08-15 13:43:23 +0000
commit0e6e8cc627242cc7e301401cfe112ba98a008101 (patch)
treef2bbce7d1b582f87d671d1b0f7adeef0e11ea5e8 /tests/MathTest.cpp
parented41d86a956a84e1438e334c15641393d68cf606 (diff)
Revert r10705 (ARM Skia NEON patches - 04 - Clean SkFixed / SkLONGLONG) due to 1000+ linux_layout failures (http://build.chromium.org/p/tryserver.chromium/builders/linux_layout_rel/builds/18997/steps/webkit_tests/logs/stdio)
git-svn-id: http://skia.googlecode.com/svn/trunk@10729 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests/MathTest.cpp')
-rw-r--r--tests/MathTest.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/MathTest.cpp b/tests/MathTest.cpp
index f9849194cb..fe54594100 100644
--- a/tests/MathTest.cpp
+++ b/tests/MathTest.cpp
@@ -186,6 +186,7 @@ static void test_blend(skiatest::Reporter* reporter) {
}
}
+#if defined(SkLONGLONG)
static int symmetric_fixmul(int a, int b) {
int sa = SkExtractSign(a);
int sb = SkExtractSign(b);
@@ -194,17 +195,18 @@ static int symmetric_fixmul(int a, int b) {
b = SkApplySign(b, sb);
#if 1
- int c = (int)(((int64_t)a * b) >> 16);
+ int c = (int)(((SkLONGLONG)a * b) >> 16);
return SkApplySign(c, sa ^ sb);
#else
- int64_t ab = (int64_t)a * b;
+ SkLONGLONG ab = (SkLONGLONG)a * b;
if (sa ^ sb) {
ab = -ab;
}
return ab >> 16;
#endif
}
+#endif
static void check_length(skiatest::Reporter* reporter,
const SkPoint& p, SkScalar targetLen) {
@@ -520,11 +522,12 @@ static void TestMath(skiatest::Reporter* reporter) {
unittest_fastfloat(reporter);
unittest_isfinite(reporter);
+#ifdef SkLONGLONG
for (i = 0; i < 10000; i++) {
SkFixed numer = rand.nextS();
SkFixed denom = rand.nextS();
SkFixed result = SkFixedDiv(numer, denom);
- int64_t check = ((int64_t)numer << 16) / denom;
+ SkLONGLONG check = ((SkLONGLONG)numer << 16) / denom;
(void)SkCLZ(numer);
(void)SkCLZ(denom);
@@ -538,7 +541,7 @@ static void TestMath(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, result == (int32_t)check);
result = SkFractDiv(numer, denom);
- check = ((int64_t)numer << 30) / denom;
+ check = ((SkLONGLONG)numer << 30) / denom;
REPORTER_ASSERT(reporter, result != (SkFixed)SK_NaN32);
if (check > SK_MaxS32) {
@@ -580,6 +583,7 @@ static void TestMath(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, (diff >> 7) == 0);
}
}
+#endif
for (i = 0; i < 10000; i++) {
SkFract x = rand.nextU() >> 1;