Red Hat Bugzilla – Bug 884036
testConversionsFromString c++ unit test failing
Last modified: 2013-03-06 13:53:07 EST
Description of problem: testConversionsFromString unit test starts to fail on latest packages: unknown location(0): fatal error in "testConversionsFromString": std::exception: invalid conversion: Cannot convert -0 (qpid/types/Variant.cpp:126) This issue is only valid for rhel5 (tested on rhel5.8 and rhel5.9 - x86_64/i386), rhel6.x do not suffer from that. Version-Release number of selected component (if applicable): qpid-cpp-*-0.18-12.el5 How reproducible: 100% Steps to Reproduce: 1. execute c++ unit test testConversionsFromString Actual results: testConversionsFromString fails Expected results: testConversionsFromString pass Additional info: # SPATH=$(pwd) # g++ -Wall -DBOOST_TEST_DYN_LINK -I${SPATH}/tests -I${SPATH} -I/usr/include/qpid-boost ${SPATH}/tests/Variant.cpp ${SPATH}/tests/unit_test.cpp -lboost_unit_test_framework -lqpidclient -lqpidmessaging -lqmfconsole -lqpidbroker -o unit_test_custom # BOOST_TEST_LOG_LEVEL=all ./unit_test_custom Running 10 test cases... Entering test suite "Master Test Suite" Entering test suite "VariantSuite" Entering test case "testConversionsFromString" <snip/> /mnt/tests/distribution/MRG/Messaging/qpid_common/qpid-tree/cpp/src/tests/Variant.cpp(135): info: check 0 == value.asInt16() passed unknown location(0): fatal error in "testConversionsFromString": std::exception: invalid conversion: Cannot convert -0 (qpid/types/Variant.cpp:126)
Petr, is it fair to label this one a regression?
Yes, I think so. Keyword updated.
fixed in branch 0.18-mrg-mick-884036 negative-0 would not happily cast to an unsigned type, so I tested for that case and cast a positive 0.
This issue has been fixed. Verified on rhel5.9 and rhel6.3 (x86_64, i386) packages used for testing: qpid-cpp-*-0.18-13 -> VERIFIED
I know we verified this already, but yesterday I did something like the same fix in trunk and Andrew pointed out that it was 1. evil, and 2. wrong. Then he wrote a much nicer fix that was 1. good, and 2. correct. I checked *that* fix into trunk. Could we reopen this BZ somehow, so I could use his fix in place of my evil hack ?
As per request from the development, changing this back to ASSIGNED.
Mick, any update?
pushed as branch 0.18-mrg-mick-884036
This issue has been fixed. Verified on rhel5.9 and rhel6.4 (x86_64, i386) packages used for testing: qpid-cpp-*-0.18-14 -> VERIFIED
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2013-0561.html