| 22 | namespace core { |
| 23 | |
| 24 | TEST(Coding, Fixed16) { |
| 25 | static const uint16 N = 50000; |
| 26 | |
| 27 | string s; |
| 28 | for (uint16 v = 0; v < N; v++) { |
| 29 | char buf[sizeof(uint16)]; |
| 30 | EncodeFixed16(buf, v); |
| 31 | s.append(buf, sizeof(buf)); |
| 32 | } |
| 33 | |
| 34 | const char* p = s.data(); |
| 35 | for (uint16 v = 0; v < N; v++) { |
| 36 | uint16 actual = DecodeFixed16(p); |
| 37 | ASSERT_EQ(v, actual); |
| 38 | p += sizeof(uint16); |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | TEST(Coding, Fixed32) { |
| 43 | static const uint32 N = 100000; |
nothing calls this directly
no test coverage detected