WillAyd commented on code in PR #47282:
URL: https://github.com/apache/arrow/pull/47282#discussion_r2301885523


##########
cpp/src/arrow/testing/gtest_util_test.cc:
##########
@@ -287,9 +287,11 @@ TEST(TestWithinUlp, Float) {
 TEST(AssertTestWithinUlp, Basics) {
   AssertWithinUlp(123.4567, 123.45670000000015, 11);
   AssertWithinUlp(123.456f, 123.456085f, 11);
+#if !defined(_MSC_VER)

Review Comment:
   So upon investigating this some more, this actually _does_ fail with the 
CMake build. However, there seems to be something interesting going on where 
many of the CMake tests are not actually being run on Windows.
   
   For instance, with a fresh project setup, if I do:
   
   ```sh
   $ cmake -S . -B build  -DARROW_COMPUTE=ON -DARROW_BUILD_TESTS=ON 
   $ cd build
   $ ctest -R arrow-gtest-util-test --verbose
   ```
   
   Everything comes back passing, but no tests are actually being run.
   
   If I add a custom main function to `gtest_util_test.cc`:
   
   ```cpp
   int main(int argc, char **argv) {
     ::testing::InitGoogleTest(&argc, argv);
     return RUN_ALL_TESTS();
   }
   ```
   
   recompile, and then re-run the ctest command, I get the same failure shown 
here:
   
   ```sh
   PS C:\Users\Alison\clones\arrow\cpp\build> ctest -R gtest-util-test --verbose
   UpdateCTestConfiguration  from 
:C:/Users/Alison/clones/arrow/cpp/build/DartConfiguration.tcl
   UpdateCTestConfiguration  from 
:C:/Users/Alison/clones/arrow/cpp/build/DartConfiguration.tcl
   Test project C:/Users/Alison/clones/arrow/cpp/build
   Constructing a list of tests
   Done constructing a list of tests
   Updating test list for fixtures
   Added 0 tests to meet fixture requirements
   Checking test dependency graph...
   Checking test dependency graph end
   test 13
       Start 13: arrow-gtest-util-test
   
   13: Test command: 
C:\Users\Alison\clones\arrow\cpp\build\debug\arrow-gtest-util-test.exe
   13: Working Directory: 
C:/Users/Alison/clones/arrow/cpp/build/src/arrow/testing
   13: Test timeout computed to be: 10000000
   13: [==========] Running 10 tests from 4 test suites.
   13: [----------] Global test environment set-up.
   13: [----------] 5 tests from TestAssertContainsNaN
   13: [ RUN      ] TestAssertContainsNaN.BatchesEqual
   13: [       OK ] TestAssertContainsNaN.BatchesEqual (1 ms)
   13: [ RUN      ] TestAssertContainsNaN.TableEqual
   13: [       OK ] TestAssertContainsNaN.TableEqual (0 ms)
   13: [ RUN      ] TestAssertContainsNaN.ArrayEqual
   13: [       OK ] TestAssertContainsNaN.ArrayEqual (0 ms)
   13: [ RUN      ] TestAssertContainsNaN.ChunkedEqual
   13: [       OK ] TestAssertContainsNaN.ChunkedEqual (0 ms)
   13: [ RUN      ] TestAssertContainsNaN.DatumEqual
   13: [       OK ] TestAssertContainsNaN.DatumEqual (0 ms)
   13: [----------] 5 tests from TestAssertContainsNaN (2 ms total)
   13:
   13: [----------] 2 tests from TestTensorFromJSON
   13: [ RUN      ] TestTensorFromJSON.FromJSONAndArray
   13: [       OK ] TestTensorFromJSON.FromJSONAndArray (0 ms)
   13: [ RUN      ] TestTensorFromJSON.FromJSON
   13: [       OK ] TestTensorFromJSON.FromJSON (0 ms)
   13: [----------] 2 tests from TestTensorFromJSON (0 ms total)
   13:
   13: [----------] 2 tests from TestWithinUlp
   13: [ RUN      ] TestWithinUlp.Double
   13: [       OK ] TestWithinUlp.Double (3 ms)
   13: [ RUN      ] TestWithinUlp.Float
   13: [       OK ] TestWithinUlp.Float (3 ms)
   13: [----------] 2 tests from TestWithinUlp (7 ms total)
   13:
   13: [----------] 1 test from AssertTestWithinUlp
   13: [ RUN      ] AssertTestWithinUlp.Basics
   13: C:\Users\Alison\clones\arrow\cpp\src\arrow\testing\math.cc(72): error: 
Failed
   13: 123.4567 and 123.45670000000015 are not within 10 ulps
   13:
   13: 
C:\Users\Alison\clones\arrow\cpp\build\_deps\googletest-src\googletest\src/gtest.cc(1046):
 error: Expected: 1 fatal failure
   13:   Actual: 0 failures
   13:
   13: C:\Users\Alison\clones\arrow\cpp\src\arrow\testing\math.cc(72): error: 
Failed
   13: 123.45600128173828 and 123.45608520507812 are not within 10 ulps
   13:
   13: 
C:\Users\Alison\clones\arrow\cpp\build\_deps\googletest-src\googletest\src/gtest.cc(1046):
 error: Expected: 1 fatal failure
   13:   Actual: 0 failures
   13:
   13: [  FAILED  ] AssertTestWithinUlp.Basics (0 ms)
   13: [----------] 1 test from AssertTestWithinUlp (0 ms total)
   13:
   13: [----------] Global test environment tear-down
   13: [==========] 10 tests from 4 test suites ran. (11 ms total)
   13: [  PASSED  ] 9 tests.
   13: [  FAILED  ] 1 test, listed below:
   13: [  FAILED  ] AssertTestWithinUlp.Basics
   13:
   13:  1 FAILED TEST
   1/1 Test #13: arrow-gtest-util-test ............***Failed    0.15 sec
   
   0% tests passed, 1 tests failed out of 1
   
   Label Time Summary:
   arrow-tests    =   0.15 sec*proc (1 test)
   unittest       =   0.15 sec*proc (1 test)
   
   Total Test time (real) =   0.17 sec
   
   The following tests FAILED:
            13 - arrow-gtest-util-test (Failed)                    arrow-tests 
unittest
   ```
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to