| 29 | // NOTE: proton::coerce<> and bad proton::get() are tested in value_test to avoid redundant test code. |
| 30 | |
| 31 | void encode_decode_test() { |
| 32 | value v; |
| 33 | scalar a("foo"); |
| 34 | v = a; // Assignment to value does encode, get<> does decode. |
| 35 | ASSERT_EQUAL(v, a); |
| 36 | ASSERT_EQUAL(std::string("foo"), get<std::string>(v)); |
| 37 | scalar a2 = get<scalar>(v); |
| 38 | ASSERT_EQUAL(std::string("foo"), get<std::string>(a2)); |
| 39 | } |
| 40 | |
| 41 | void message_id_test() { |
| 42 | ASSERT_EQUAL(23, coerce<int64_t>(message_id(23))); |