MCPcopy Create free account
hub / github.com/apache/qpid-proton / test_encoder_primitives

Function test_encoder_primitives

cpp/src/interop_test.cpp:87–99  ·  view source on GitHub ↗

Test inserting primitive sand encoding as AMQP.

Source from the content-addressed store, hash-verified

85
86// Test inserting primitive sand encoding as AMQP.
87void 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

Callers 1

mainFunction · 0.85

Calls 3

readFunction · 0.85
strFunction · 0.70
encodeMethod · 0.45

Tested by

no test coverage detected