Fix unit test error on OSX 10.9 using Apple LLVM v5.0. #3420

pull Kangmo wants to merge 1 commits into bitcoin:master from Kangmo:kangmo-unit-test-fix changing 1 files +6 −1
  1. Kangmo commented at 2:28 PM on December 15, 2013: none

    ( Next time, I will re-push to the same branch instead of closing and opening pull requests. )

    Before the fix, there were 6 errors such as : serialize_tests.cpp:77: error in "noncanonical": incorrect exception std::ios_base::failure is caught

    It turns out that ex.what() returns following string instead of "non-canonical ReadCompactSize()" "non-canonical ReadCompactSize(): unspecified iostream_category error"

    After the fix, unit test passed.

    The test ran using Apple LLVM v5.0 on OSX 10.9 and the unit test error happened because of different error messages by different compilers.

    g++ --version on my development environment.

    Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
    Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
    Target: x86_64-apple-darwin13.0.0
    Thread model: posix
    
  2. Fix unit test error on OSX 10.9 using Apple LLVM v5.0.
    Before the fix, there were 6 errors such as :
    serialize_tests.cpp:77: error in "noncanonical": incorrect exception std::ios_base::failure is caught
    
    It turns out that ex.what() returns following string instead of "non-canonical ReadCompactSize()"
    "non-canonical ReadCompactSize(): unspecified iostream_category error"
    
    After the fix, unit test passed.
    
    The test ran using Apple LLVM v5.0 on OSX 10.9 and the unit test error happened because of different error messages by different compilers.
    
    g++ --version on my development environment.
    
    ```
    Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
    Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
    Target: x86_64-apple-darwin13.0.0
    Thread model: posix
    ```
    bccd5324ab
  3. BitcoinPullTester commented at 3:20 PM on December 15, 2013: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/bccd5324ab5b76c21b01bfe9c8ec7ab2061c93e4 for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.

  4. sipa commented at 3:53 PM on December 15, 2013: member

    ACK, though I expect that maybe we'll need to update this further in future, based on runtime environments.

    A more long-term solution is perhaps introducing an own exception class for this, and checking it specifically.

  5. laanwj referenced this in commit a5a65bbc90 on Dec 15, 2013
  6. laanwj merged this on Dec 15, 2013
  7. laanwj closed this on Dec 15, 2013

  8. Kangmo commented at 5:31 PM on December 15, 2013: none

    Agreed with sipa, currently the test case was the only case expecting a specific type of exception thrown. Thanks sipa for the comment!

  9. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-29 03:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me