ScalarCodec - added representation correctness test

This commit is contained in:
Pavel Kirienko
2014-02-21 00:42:11 +04:00
parent dc3111c77d
commit df04599ac0
2 changed files with 21 additions and 0 deletions
@@ -40,6 +40,12 @@ class ScalarCodec
u.l = 1;
const bool big_endian = u.c[sizeof(long int) - 1] == 1;
#endif
/*
* I didn't have any big endian machine nearby, so big endian support wasn't tested yet.
* It is likely to be OK anyway, so feel free to remove this assert() as needed.
*/
assert(big_endian == false);
if (big_endian)
swapByteOrder(bytes);
}