aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar jvanverth@google.com <jvanverth@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-02-14 13:20:35 +0000
committerGravatar jvanverth@google.com <jvanverth@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-02-14 13:20:35 +0000
commit024e523a5ff78ec4d86d0b373bfb9adf8978ef4d (patch)
treeb4193af86c699d2fcf4f2d6b88bea0abaee378e4 /tests
parent3d18d063f0c6b97b25b88707cfbc1c8cb584caa0 (diff)
Fix for Gorilla test
My implementation of the Gorilla random number test had a bug in the code used to track the random strings -- it was masking 6 bits instead of 5, which was throwing off the counts. No idea how this worked on every platform except Android. git-svn-id: http://skia.googlecode.com/svn/trunk@7731 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests')
-rw-r--r--tests/RandomTest.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/tests/RandomTest.cpp b/tests/RandomTest.cpp
index 224d45556e..51408e9605 100644
--- a/tests/RandomTest.cpp
+++ b/tests/RandomTest.cpp
@@ -126,7 +126,7 @@ static double test_single_gorilla(skiatest::Reporter* reporter, int shift) {
int index = value & (kNumEntries-1);
SkASSERT(index < kNumEntries);
- int entry_shift = (value >> (kWordWidth-5)) & 0x3f;
+ int entry_shift = (value >> (kWordWidth-5)) & 0x1f;
entries[index] |= (0x1 << entry_shift);
}
@@ -146,10 +146,7 @@ static double test_single_gorilla(skiatest::Reporter* reporter, int shift) {
// compute probability from normal distibution CDF
double p = normal_cdf(z);
- // this test is currently failing on android, but commenting it
- // out causes more problems than it fixes due to -Werror, hence
- // the true || weirdness.
- REPORTER_ASSERT(reporter, true || (0.01 < p && p < 0.99));
+ REPORTER_ASSERT(reporter, 0.01 < p && p < 0.99);
return p;
}
@@ -160,10 +157,7 @@ static void test_gorilla(skiatest::Reporter* reporter) {
p[bit_position] = test_single_gorilla(reporter, bit_position);
}
- // this test is currently unused, but commenting it out
- // causes more problems than it fixes due to -Werror, hence
- // the true || weirdness.
- REPORTER_ASSERT(reporter, true || anderson_darling_test(p));
+ REPORTER_ASSERT(reporter, anderson_darling_test(p));
}
static void test_range(skiatest::Reporter* reporter) {