Test inserting primitive sand encoding as AMQP.
| 85 | |
| 86 | // Test inserting primitive sand encoding as AMQP. |
| 87 | void test_encoder_primitives() { |
| 88 | value dv; |
| 89 | encoder e(dv); |
| 90 | e << true << false; |
| 91 | e << ::uint8_t(42); |
| 92 | e << ::uint16_t(42) << ::int16_t(-42); |
| 93 | e << ::uint32_t(12345) << ::int32_t(-12345); |
| 94 | e << ::uint64_t(12345) << ::int64_t(-12345); |
| 95 | e << float(0.125) << double(0.125); |
| 96 | ASSERT_EQUAL("true, false, 42, 42, -42, 12345, -12345, 12345, -12345, 0.125, 0.125", str(e)); |
| 97 | std::string data = e.encode(); |
| 98 | ASSERT_EQUAL(read("primitives"), data); |
| 99 | } |
| 100 | |
| 101 | } |
| 102 |