Changeset 3ae7827 in mainline


Ignore:
Timestamp:
2018-07-05T21:41:25Z (6 years ago)
Author:
Dzejrou <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1caddc6
Parents:
07eaeea
git-author:
Dzejrou <dzejrou@…> (2018-07-03 18:40:07)
git-committer:
Dzejrou <dzejrou@…> (2018-07-05 21:41:25)
Message:

cpp: fixed a bug in bitset test which caused endianity to change result of the test

Location:
uspace/lib/cpp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/cpp/include/__bits/adt/bitset.hpp

    r07eaeea r3ae7827  
    270270            {
    271271                // TODO: throw overflow_error if N > bits in ulong
    272                 return static_cast<unsigned long>(data_[0] & (~0UL));
     272                return static_cast<unsigned long>(data_[0]);
    273273            }
    274274
  • uspace/lib/cpp/src/__bits/test/bitset.cpp

    r07eaeea r3ae7827  
    9292        );
    9393
    94         std::bitset<64> b4{0xABCD'DCBA'DEAD'BEEF};
     94        std::bitset<64> b4{0xABCD'DCBA'DEAD'BEEFULL};
    9595        test_eq(
    9696            "from hex to number equivalence",
    97             b4.to_ulong(), 0xABCD'DCBA'DEAD'BEEF
     97            b4.to_ulong(), static_cast<unsigned long>(0xABCD'DCBA'DEAD'BEEFULL)
    9898        );
    9999
Note: See TracChangeset for help on using the changeset viewer.