Boost logo

Boost Users :

Subject: [Boost-users] Using BOOST_*_EQUAL on bit-fields?
From: Chris Cleeland (chris.cleeland_at_[hidden])
Date: 2013-03-07 16:39:46


I'm using the Boost Unit Test Framework and have a struct with bitfields
declared in it.

When I compile a unit test with code like this

  StructWithBitfields mystruct;
  StructWithBitfields otherstruct;

  BOOST_CHECK_EQUAL(mystruct.bitfield, otherstruct.bitfield);

I get a compiler errors

error: non-const reference cannot bind to bit-field 'bitfield'

referring to both arguments to the macro.

Is there a preferred way for comparing bitfield values via unit test macros?

-- 
Chris Cleeland


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net