Skip to content

Commit

Permalink
Update test_attribute_packed
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed May 14, 2024
1 parent 2848e33 commit b2df302
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions test/test_attribute_packed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ int main() {}

using namespace boost::uuids;

struct __attribute__((packed)) X
struct __attribute__((packed)) X1
{
unsigned char a;
uuid b;
unsigned char c;
};

struct __attribute__((packed)) X2
{
uuid a;
unsigned char b;
Expand All @@ -26,8 +33,11 @@ struct __attribute__((packed)) X

int main()
{
BOOST_TEST_EQ( offsetof(X, c), 17 );
BOOST_TEST_EQ( sizeof(X), 22 );
BOOST_TEST_EQ( offsetof(X1, b), 1 );
BOOST_TEST_EQ( sizeof(X1), 18 );

BOOST_TEST_EQ( offsetof(X2, c), 17 );
BOOST_TEST_EQ( sizeof(X2), 22 );

return boost::report_errors();
}
Expand Down

0 comments on commit b2df302

Please sign in to comment.