This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 884036 - testConversionsFromString c++ unit test failing
testConversionsFromString c++ unit test failing
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp (Show other bugs)
Unspecified Unspecified
medium Severity medium
: 2.3
: ---
Assigned To: mick
Petr Matousek
: Regression
Depends On:
Blocks: 905661
  Show dependency treegraph
Reported: 2012-12-05 11:39 EST by Petr Matousek
Modified: 2013-03-06 13:53 EST (History)
3 users (show)

See Also:
Fixed In Version: qpid-cpp-0.18-14
Doc Type: Bug Fix
Doc Text:
Cause: Bug in older GCC libraries Consequence: Attempt to cast negative-zero to an unsigned type would fail Fix: Rearrange the casting logic to handle the "minus" sign separately. Result: negative-zero now works properly on older and newer GCC libs. Other values are unaffected.
Story Points: ---
Clone Of:
: 905661 (view as bug list)
Last Closed: 2013-03-06 13:53:07 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Petr Matousek 2012-12-05 11:39:56 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):

How reproducible:

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"
/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)
Comment 1 Justin Ross 2012-12-06 10:17:32 EST
Petr, is it fair to label this one a regression?
Comment 2 Petr Matousek 2012-12-06 11:58:51 EST
Yes, I think so. Keyword updated.
Comment 4 mick 2012-12-11 15:08:05 EST
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.
Comment 6 Petr Matousek 2012-12-14 05:14:36 EST
This issue has been fixed.

Verified on rhel5.9 and rhel6.3 (x86_64, i386)

packages used for testing:

Comment 7 mick 2013-01-11 15:37:46 EST
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 ?
Comment 8 Leonid Zhaldybin 2013-01-14 04:15:10 EST
As per request from the development, changing this back to ASSIGNED.
Comment 9 Justin Ross 2013-01-21 10:13:30 EST
Mick, any update?
Comment 10 mick 2013-01-22 15:01:38 EST
pushed as branch   0.18-mrg-mick-884036
Comment 13 Petr Matousek 2013-01-28 04:41:55 EST
This issue has been fixed.

Verified on rhel5.9 and rhel6.4 (x86_64, i386)

packages used for testing:

Comment 15 errata-xmlrpc 2013-03-06 13:53:07 EST
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.

Note You need to log in before you can comment on or make changes to this bug.