RESOLVED FIXED 105253
2 clampTo unit tests are failing
https://bugs.webkit.org/show_bug.cgi?id=105253
Summary 2 clampTo unit tests are failing
Julien Chaffraix
Reported 2012-12-17 22:00:47 PST
clampToUnsigned is failing on 2 bots and clampToFloat is failing only on Apple Win: http://build.webkit.org/builders/Chromium%20Mac%20Release%20%28Tests%29/builds/30528/steps/run-api-tests/logs/stdio http://build.webkit.org/builders/Apple%20Win%207%20Release%20%28Tests%29/builds/31009/steps/run-api-tests/logs/stdio Here are the failures: Note: Google Test filter = WTF.clampToIntegerFloat [==========] Running 1 test from 1 test case. [----------] Global test environment set-up. [----------] 1 test from WTF [ RUN ] WTF.clampToIntegerFloat ..\Tests\WTF\MathExtras.cpp(103): error: Value of: maxInt Actual: 2147483648 Expected: clampToInteger(maxInt) Which is: 2147483647 ..\Tests\WTF\MathExtras.cpp(106): error: Value of: maxInt Actual: 2147483648 Expected: clampToInteger(overflowInt) Which is: 2147483647 [ FAILED ] WTF.clampToIntegerFloat (0 ms) [----------] 1 test from WTF (0 ms total) [----------] Global test environment tear-down [==========] 1 test from 1 test case ran. (0 ms total) [ PASSED ] 0 tests. [ FAILED ] 1 test, listed below: [ FAILED ] WTF.clampToIntegerFloat 1 FAILED TEST Note: Google Test filter = WTF.clampToUnsigned [==========] Running 1 test from 1 test case. [----------] Global test environment set-up. [----------] 1 test from WTF [ RUN ] WTF.clampToUnsigned ..\Tests\WTF\MathExtras.cpp(153): error: Value of: maxUnsigned Actual: 4294967295 Expected: clampTo<unsigned>(overflowUnsigned) Which is: 0 [ FAILED ] WTF.clampToUnsigned (0 ms) [----------] 1 test from WTF (0 ms total)
Attachments
Proposed fix. (2.61 KB, patch)
2012-12-18 18:03 PST, Julien Chaffraix
no flags
Julien Chaffraix
Comment 1 2012-12-17 22:12:11 PST
Emil A Eklund
Comment 2 2012-12-18 11:03:17 PST
The windows unsigned failure is due to sizeof(unsigned long) == sizeof(unsigned) on windows 64bit (as it used the LLP64 memory model). Adding a sizeof check as you have for clampToIntLong should do the trick. The chromium mac failure seems to be due to float imprecision, EXPECT_NEAR with a tolerance of 1 should do the trick.
Julien Chaffraix
Comment 3 2012-12-18 17:11:24 PST
(In reply to comment #2) > The windows unsigned failure is due to sizeof(unsigned long) == sizeof(unsigned) on windows 64bit (as it used the LLP64 memory model). > > Adding a sizeof check as you have for clampToIntLong should do the trick. True, but clampToUnsigned is testing the same case as clampToUnsignedLong as we can't test overflowing without a type that is wider than unsigned. This makes me lean towards just removing this test (FWIW we don't have a clampToInt for this very reason). > The chromium mac failure seems to be due to float imprecision, EXPECT_NEAR with a tolerance of 1 should do the trick. Good catch, that should fix the issue.
Julien Chaffraix
Comment 4 2012-12-18 18:03:22 PST
Created attachment 180069 [details] Proposed fix.
Julien Chaffraix
Comment 5 2012-12-19 09:43:30 PST
Comment on attachment 180069 [details] Proposed fix. Thanks, Emil!
WebKit Review Bot
Comment 6 2012-12-19 09:46:52 PST
Comment on attachment 180069 [details] Proposed fix. Clearing flags on attachment: 180069 Committed r138176: <http://trac.webkit.org/changeset/138176>
WebKit Review Bot
Comment 7 2012-12-19 09:46:56 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.