diff options
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/corelib/global/qtendian/tst_qtendian.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/auto/corelib/global/qtendian/tst_qtendian.cpp b/tests/auto/corelib/global/qtendian/tst_qtendian.cpp index 7f13559067..e688768b74 100644 --- a/tests/auto/corelib/global/qtendian/tst_qtendian.cpp +++ b/tests/auto/corelib/global/qtendian/tst_qtendian.cpp @@ -377,8 +377,9 @@ void testBitfieldUnion() using upper = Member<21, 11, uint>; using lower = Member<10, 11, uint>; using bottom = Member<0, 10, int>; + using all = Member<0, 32, uint>; - using UnionType = Union<upper, lower, bottom>; + using UnionType = Union<upper, lower, bottom, all>; UnionType u; u.template set<upper>(200); @@ -402,6 +403,15 @@ void testBitfieldUnion() UnionType u2(QSpecialIntegerBitfieldZero); QCOMPARE(u2.data(), 0U); + u2.template set<all>(std::numeric_limits<uint>::max()); + QCOMPARE(u2.template get<all>(), std::numeric_limits<uint>::max()); + + u2.template set<all>(453); + QCOMPARE(u2.template get<all>(), 453U); + + u2.template set<all>(0); + QCOMPARE(u2.template get<all>(), 0U); + UnionType u3(42U); QCOMPARE(u3.data(), 42U); |