diff options
| author | bors <bors@rust-lang.org> | 2015-08-14 02:38:29 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-08-14 02:38:29 +0000 |
| commit | 033e127066c0d57b36eb7e202840387a98b017f8 (patch) | |
| tree | 0f0be04cc3b3ea7991c5babde1a5f9efd6172671 | |
| parent | e2bebf32fa4bc4dfe8b7cacb713091b8ccbf62bf (diff) | |
| parent | 60ac0d85b92bd20c7f135b7343f3af80715d6ffd (diff) | |
| download | rust-033e127066c0d57b36eb7e202840387a98b017f8.tar.gz rust-033e127066c0d57b36eb7e202840387a98b017f8.zip | |
Auto merge of #27786 - alexcrichton:start-testing-msvc, r=brson
* An apparent bug in VS 2013's implementation of the `exp2` function is worked around in one of flt2dec's tests. Turns out this was the only fix necessary!
| -rw-r--r-- | src/libcoretest/num/flt2dec/strategy/dragon.rs | 17 | ||||
| -rw-r--r-- | src/libcoretest/num/flt2dec/strategy/grisu.rs | 6 |
2 files changed, 21 insertions, 2 deletions
diff --git a/src/libcoretest/num/flt2dec/strategy/dragon.rs b/src/libcoretest/num/flt2dec/strategy/dragon.rs index 26bb5b9d9c5..f3ddc370d1e 100644 --- a/src/libcoretest/num/flt2dec/strategy/dragon.rs +++ b/src/libcoretest/num/flt2dec/strategy/dragon.rs @@ -35,7 +35,22 @@ fn shortest_sanity_test() { #[test] fn exact_sanity_test() { - f64_exact_sanity_test(format_exact); + // This test ends up running what I can only assume is some corner-ish case + // of the `exp2` library function, defined in whatever C runtime we're + // using. In VS 2013 this function apparently had a bug as this test fails + // when linked, but with VS 2015 the bug appears fixed as the test runs just + // fine. + // + // The bug seems to be a difference in return value of `exp2(-1057)`, where + // in VS 2013 it returns a double with the bit pattern 0x2 and in VS 2015 it + // returns 0x20000. + // + // For now just ignore this test entirely on MSVC as it's tested elsewhere + // anyway and we're not super interested in testing each platform's exp2 + // implementation. + if !cfg!(target_env = "msvc") { + f64_exact_sanity_test(format_exact); + } f32_exact_sanity_test(format_exact); } diff --git a/src/libcoretest/num/flt2dec/strategy/grisu.rs b/src/libcoretest/num/flt2dec/strategy/grisu.rs index e5b8a9dcc38..2d4afceda19 100644 --- a/src/libcoretest/num/flt2dec/strategy/grisu.rs +++ b/src/libcoretest/num/flt2dec/strategy/grisu.rs @@ -77,7 +77,11 @@ fn shortest_f64_hard_random_equivalence_test() { #[test] fn exact_sanity_test() { - f64_exact_sanity_test(format_exact); + // See comments in dragon.rs's exact_sanity_test for why this test is + // ignored on MSVC + if !cfg!(target_env = "msvc") { + f64_exact_sanity_test(format_exact); + } f32_exact_sanity_test(format_exact); } |
