BOOST_BITWISE_EQUAL( left, right )

This tool is used to perform bitwise comparison of two values. This check shows all positions where left and right value's bits mismatch.

If comparisons are successful, the tool produces a confirmation messages (note: to manage what messages appear in the test output stream set the proper log level), in other case in every mismatch position it produces an error message in a form "error in <test case name>: test <left> =.= <right> in a position <mismatch position> failed.

The tool's first parameter is the left compared value. Second parameter is the right compared value. Parameters are not required to be of the same type, but warning is issues if their size does not coincide.

Example: test.cpp

int test_main( int, char* [] ) {
    BOOST_BITWISE_EQUAL( (char)0x26, (char)0x04 );

    return 0;
}

Output:

test.cpp(3) : error in test_main: test (char)0x26 =.= (char)0x04 in the position 1 failed
test.cpp(3) : error in test_main: test (char)0x26 =.= (char)0x04 in the position 5 failed

See Also

BOOST_CHECK_EQUAL