Fix unit test error. #3418

pull Kangmo wants to merge 1 commits into bitcoin:master from Kangmo:master changing 1 files +1 −1
  1. Kangmo commented at 12:55 PM on December 15, 2013: none

    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.

    In case the unit test error happened because of different error messages by different compilers, you may want to merge the code as shown below.

    static bool isCanonicalException(const std::ios_base::failure& ex)
    {
        return std::string("non-canonical ReadCompactSize()") == ex.what() ||
                 std::string("non-canonical ReadCompactSize(): unspecified iostream_category error") == ex.what();
    }
    

    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.
    Before the fix, there were 6 errors such as :
    error => non-canonical ReadCompactSize(): unspecified iostream_category error
    serialize_tests.cpp:77: error in "noncanonical": incorrect exception std::ios_base::failure is caught
    
    After the fix, unit test passed.
    1064e58c1d
  3. BitcoinPullTester commented at 1:43 PM on December 15, 2013: none

    Automatic sanity-testing: FAILED BUILD/TEST, see http://jenkins.bluematt.me/pull-tester/1064e58c1d4eac88dddfa465093eccaa21ed18bf for binaries and test log.

    This could happen for one of several reasons:

    1. It chanages paths in makefile.linux-mingw or otherwise changes build scripts in a way that made them incompatible with the automated testing scripts (please tweak those patches in qa/pull-tester)
    2. It adds/modifies tests which test network rules (thanks for doing that), which conflicts with a patch applied at test time
    3. It does not build on either Linux i386 or Win32 (via MinGW cross compile)
    4. The test suite fails on either Linux i386 or Win32
    5. The block test-cases failed (lookup the first bNN identifier which failed in https://github.com/TheBlueMatt/test-scripts/blob/master/FullBlockTestGenerator.java)

    If you believe this to be in error, please ping BlueMatt on freenode or TheBlueMatt here.

    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. Kangmo closed this on Dec 15, 2013

  5. Kangmo commented at 1:46 PM on December 15, 2013: none

    Will do another pull request to pass the unit test.

  6. laanwj commented at 1:48 PM on December 15, 2013: member

    You can just re-push to the same branch, no need to open new pulls.

  7. Kangmo commented at 2:00 PM on December 15, 2013: none

    Thanks Iaanwj.

    Unfortunately I removed my forked repository. Next time I will simply re push to the same branch.

  8. 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