From 4f831feb3e896948159c26f428e3ce4db8e46a8c Mon Sep 17 00:00:00 2001 From: Tanner Kvarfordt Date: Fri, 14 Jun 2024 14:07:42 -0600 Subject: [PATCH 1/2] Added i32 unit tests --- testing/gtest/SpicyProtobufTest.cpp | 304 +++++++++++++++++++++++++++- 1 file changed, 303 insertions(+), 1 deletion(-) diff --git a/testing/gtest/SpicyProtobufTest.cpp b/testing/gtest/SpicyProtobufTest.cpp index 0b893a0..fbe93f5 100644 --- a/testing/gtest/SpicyProtobufTest.cpp +++ b/testing/gtest/SpicyProtobufTest.cpp @@ -1,8 +1,11 @@ +#include +#include #include #include #include #include #include +#include #include #include #include @@ -10,8 +13,8 @@ #include #include #include -#include #include +#include #include namespace { // anonymous namespace @@ -282,4 +285,303 @@ TEST_F(SpicyProtobufTest, TestVarIntZigZag) { } } +TEST_F(SpicyProtobufTest, Testi32) { + using namespace __hlt::protobuf; + + const float abs_err = 0.00001; + + // protobuf_i32 + auto p_data = parseMessage(reinterpret_cast(i32_protobuf_i32_binpb), i32_protobuf_i32_binpb_len); + auto p_msg = p_data->message; + ASSERT_EQ(p_msg->size(), 28); + + { // field 1 + auto tag_and_val = p_data->message->at(0); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 1); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I32); + ASSERT_FALSE(tag_and_val.value.value()->i32->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_unsigned, 0); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_twos_compliment, 0); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_float, 0.0); + } + + { // field 2 + auto tag_and_val = p_data->message->at(1); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 2); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I32); + ASSERT_FALSE(tag_and_val.value.value()->i32->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_unsigned, 1); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_twos_compliment, 1); + EXPECT_FLOAT_EQ(tag_and_val.value.value()->i32.value()->as_float, 1.4013e-45); + } + + { // field 3 + auto tag_and_val = p_data->message->at(2); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 3); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I32); + ASSERT_FALSE(tag_and_val.value.value()->i32->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_unsigned, 4294967295); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_twos_compliment, -1); + EXPECT_TRUE(std::isnan(tag_and_val.value.value()->i32.value()->as_float)); + EXPECT_TRUE(std::signbit(tag_and_val.value.value()->i32.value()->as_float)); + } + + { // field 4 + auto tag_and_val = p_data->message->at(3); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 4); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I32); + ASSERT_FALSE(tag_and_val.value.value()->i32->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_unsigned, 4294967295); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_twos_compliment, -1); + EXPECT_TRUE(std::isnan(tag_and_val.value.value()->i32.value()->as_float)); + EXPECT_TRUE(std::signbit(tag_and_val.value.value()->i32.value()->as_float)); + } + + { // field 5 + auto tag_and_val = p_data->message->at(4); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 5); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I32); + ASSERT_FALSE(tag_and_val.value.value()->i32->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_unsigned, 1); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_twos_compliment, 1); + EXPECT_FLOAT_EQ(tag_and_val.value.value()->i32.value()->as_float, 1.4013e-45); + } + + { // field 6 + auto tag_and_val = p_data->message->at(5); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 6); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I32); + ASSERT_FALSE(tag_and_val.value.value()->i32->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_unsigned, 8388607); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_twos_compliment, 8388607); + EXPECT_FLOAT_EQ(tag_and_val.value.value()->i32.value()->as_float, 1.1754942107e-38); + } + + { // field 7 + auto tag_and_val = p_data->message->at(6); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 7); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I32); + ASSERT_FALSE(tag_and_val.value.value()->i32->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_unsigned, 8388608); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_twos_compliment, 8388608); + EXPECT_FLOAT_EQ(tag_and_val.value.value()->i32.value()->as_float, 1.1754943508e-38); + } + + { // field 8 + auto tag_and_val = p_data->message->at(7); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 8); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I32); + ASSERT_FALSE(tag_and_val.value.value()->i32->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_unsigned, 2139095039); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_twos_compliment, 2139095039); + EXPECT_FLOAT_EQ(tag_and_val.value.value()->i32.value()->as_float, 3.4028234664e+38); + } + + { // field 9 + auto tag_and_val = p_data->message->at(8); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 9); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I32); + ASSERT_FALSE(tag_and_val.value.value()->i32->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_unsigned, 1065353215); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_twos_compliment, 1065353215); + EXPECT_FLOAT_EQ(tag_and_val.value.value()->i32.value()->as_float, 1.0); + } + + { // field 10 + auto tag_and_val = p_data->message->at(9); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 10); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I32); + ASSERT_FALSE(tag_and_val.value.value()->i32->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_unsigned, 1065353216); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_twos_compliment, 1065353216); + EXPECT_FLOAT_EQ(tag_and_val.value.value()->i32.value()->as_float, 1.0); + } + + { // field 11 + auto tag_and_val = p_data->message->at(10); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 11); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I32); + ASSERT_FALSE(tag_and_val.value.value()->i32->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_unsigned, 1065353217); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_twos_compliment, 1065353217); + EXPECT_FLOAT_EQ(tag_and_val.value.value()->i32.value()->as_float, 1.0); + } + + { // field 12 + auto tag_and_val = p_data->message->at(11); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 12); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I32); + ASSERT_FALSE(tag_and_val.value.value()->i32->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_unsigned, 3221225472); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_twos_compliment, -1073741824); + EXPECT_FLOAT_EQ(tag_and_val.value.value()->i32.value()->as_float, -2.0); + } + + { // field 13 + auto tag_and_val = p_data->message->at(12); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 13); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I32); + ASSERT_FALSE(tag_and_val.value.value()->i32->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_unsigned, 0); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_twos_compliment, 0); + EXPECT_FLOAT_EQ(tag_and_val.value.value()->i32.value()->as_float, 0.0); + } + + { // field 14 + auto tag_and_val = p_data->message->at(13); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 14); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I32); + ASSERT_FALSE(tag_and_val.value.value()->i32->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_unsigned, 2147483648); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_twos_compliment, -2147483648); + EXPECT_FLOAT_EQ(tag_and_val.value.value()->i32.value()->as_float, -0.0); + } + + { // field 15 + auto tag_and_val = p_data->message->at(14); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 15); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I32); + ASSERT_FALSE(tag_and_val.value.value()->i32->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_unsigned, 2139095040); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_twos_compliment, 2139095040); + EXPECT_TRUE(std::isinf(tag_and_val.value.value()->i32.value()->as_float)); + EXPECT_FALSE(std::signbit(tag_and_val.value.value()->i32.value()->as_float)); + } + + { // field 16 + auto tag_and_val = p_data->message->at(15); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 16); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I32); + ASSERT_FALSE(tag_and_val.value.value()->i32->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_unsigned, 4286578688); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_twos_compliment, -8388608); + EXPECT_TRUE(std::isinf(tag_and_val.value.value()->i32.value()->as_float)); + EXPECT_TRUE(std::signbit(tag_and_val.value.value()->i32.value()->as_float)); + } + + { // field 17 + auto tag_and_val = p_data->message->at(16); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 17); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I32); + ASSERT_FALSE(tag_and_val.value.value()->i32->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_unsigned, 1078530011); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_twos_compliment, 1078530011); + EXPECT_FLOAT_EQ(tag_and_val.value.value()->i32.value()->as_float, 3.14159265358979323846); + } + + { // field 18 + auto tag_and_val = p_data->message->at(17); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 18); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I32); + ASSERT_FALSE(tag_and_val.value.value()->i32->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_unsigned, 1051372203); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_twos_compliment, 1051372203); + EXPECT_FLOAT_EQ(tag_and_val.value.value()->i32.value()->as_float, 1.0/3.0); + } + + { // field 19 + auto tag_and_val = p_data->message->at(18); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 19); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I32); + ASSERT_FALSE(tag_and_val.value.value()->i32->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_unsigned, 4290772993); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_twos_compliment, -4194303); + EXPECT_TRUE(std::isnan(tag_and_val.value.value()->i32.value()->as_float)); + } + + { // field 20 + auto tag_and_val = p_data->message->at(19); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 20); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I32); + ASSERT_FALSE(tag_and_val.value.value()->i32->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_unsigned, 4286578689); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_twos_compliment, -8388607); + EXPECT_TRUE(std::isnan(tag_and_val.value.value()->i32.value()->as_float)); + } + + { // field 21 + auto tag_and_val = p_data->message->at(20); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 21); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I32); + ASSERT_FALSE(tag_and_val.value.value()->i32->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_unsigned, 0); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_twos_compliment, 0); + EXPECT_FLOAT_EQ(tag_and_val.value.value()->i32.value()->as_float, 0.0); + } + + { // field 22 + auto tag_and_val = p_data->message->at(21); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 22); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I32); + ASSERT_FALSE(tag_and_val.value.value()->i32->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_unsigned, 2147483648); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_twos_compliment, -2147483648); + EXPECT_FLOAT_EQ(tag_and_val.value.value()->i32.value()->as_float, -0.0); + } + + { // field 23 + auto tag_and_val = p_data->message->at(22); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 23); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I32); + ASSERT_FALSE(tag_and_val.value.value()->i32->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_unsigned, 2139095040); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_twos_compliment, 2139095040); + EXPECT_TRUE(std::isinf(tag_and_val.value.value()->i32.value()->as_float)); + EXPECT_FALSE(std::signbit(tag_and_val.value.value()->i32.value()->as_float)); + } + + { // field 24 + auto tag_and_val = p_data->message->at(23); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 24); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I32); + ASSERT_FALSE(tag_and_val.value.value()->i32->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_unsigned, 4286578688); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_twos_compliment, -8388608); + EXPECT_TRUE(std::isinf(tag_and_val.value.value()->i32.value()->as_float)); + EXPECT_TRUE(std::signbit(tag_and_val.value.value()->i32.value()->as_float)); + } + + { // field 25 + auto tag_and_val = p_data->message->at(24); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 25); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I32); + ASSERT_FALSE(tag_and_val.value.value()->i32->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_unsigned, 150); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_twos_compliment, 150); + EXPECT_FLOAT_EQ(tag_and_val.value.value()->i32.value()->as_float, 2.10195e-43); + } + + { // field 26 + auto tag_and_val = p_data->message->at(25); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 26); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I32); + ASSERT_FALSE(tag_and_val.value.value()->i32->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_unsigned, 4294967146); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_twos_compliment, -150); + EXPECT_TRUE(std::isnan(tag_and_val.value.value()->i32.value()->as_float)); + EXPECT_TRUE(std::signbit(tag_and_val.value.value()->i32.value()->as_float)); + } + + { // field 27 + auto tag_and_val = p_data->message->at(26); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 27); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I32); + ASSERT_FALSE(tag_and_val.value.value()->i32->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_unsigned, 1125521818); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_twos_compliment, 1125521818); + EXPECT_FLOAT_EQ(tag_and_val.value.value()->i32.value()->as_float, 150.1); + } + + { // field 28 + auto tag_and_val = p_data->message->at(27); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 28); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I32); + ASSERT_FALSE(tag_and_val.value.value()->i32->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_unsigned, 3273005466); + EXPECT_EQ(tag_and_val.value.value()->i32.value()->as_twos_compliment, -1021961830); + EXPECT_FLOAT_EQ(tag_and_val.value.value()->i32.value()->as_float, -150.1); + } + +} + } // anonymous namespace From 5a6c2a81ae493ae0145b06c0a2feaeb504fd73a1 Mon Sep 17 00:00:00 2001 From: Tanner Kvarfordt Date: Fri, 14 Jun 2024 14:39:07 -0600 Subject: [PATCH 2/2] Added I64 unit tests --- testing/gtest/SpicyProtobufTest.cpp | 264 +++++++++++++++++++++++++++- 1 file changed, 260 insertions(+), 4 deletions(-) diff --git a/testing/gtest/SpicyProtobufTest.cpp b/testing/gtest/SpicyProtobufTest.cpp index fbe93f5..96f7c2e 100644 --- a/testing/gtest/SpicyProtobufTest.cpp +++ b/testing/gtest/SpicyProtobufTest.cpp @@ -1,11 +1,12 @@ #include -#include #include #include #include +#include #include #include #include +#include #include #include #include @@ -285,11 +286,9 @@ TEST_F(SpicyProtobufTest, TestVarIntZigZag) { } } -TEST_F(SpicyProtobufTest, Testi32) { +TEST_F(SpicyProtobufTest, TestI32) { using namespace __hlt::protobuf; - const float abs_err = 0.00001; - // protobuf_i32 auto p_data = parseMessage(reinterpret_cast(i32_protobuf_i32_binpb), i32_protobuf_i32_binpb_len); auto p_msg = p_data->message; @@ -584,4 +583,261 @@ TEST_F(SpicyProtobufTest, Testi32) { } +TEST_F(SpicyProtobufTest, TestI64) { + using namespace __hlt::protobuf; + + // protobuf_i64 + auto p_data = parseMessage(reinterpret_cast(i64_protobuf_i64_binpb), i64_protobuf_i64_binpb_len); + auto p_msg = p_data->message; + ASSERT_EQ(p_msg->size(), 24); + + { // field 1 + auto tag_and_val = p_data->message->at(0); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 1); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I64); + ASSERT_FALSE(tag_and_val.value.value()->i64->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_unsigned, 0); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_twos_compliment, 0); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_double, 0.0); + } + + { // field 2 + auto tag_and_val = p_data->message->at(1); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 2); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I64); + ASSERT_FALSE(tag_and_val.value.value()->i64->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_unsigned, 1); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_twos_compliment, 1); + EXPECT_DOUBLE_EQ(tag_and_val.value.value()->i64.value()->as_double, 4.94066e-324); + } + + { // field 3 + auto tag_and_val = p_data->message->at(2); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 3); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I64); + ASSERT_FALSE(tag_and_val.value.value()->i64->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_unsigned, 18446744073709551615u); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_twos_compliment, -1); + EXPECT_TRUE(std::isnan(tag_and_val.value.value()->i64.value()->as_double)); + EXPECT_TRUE(std::signbit(tag_and_val.value.value()->i64.value()->as_double)); + } + + { // field 4 + auto tag_and_val = p_data->message->at(3); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 4); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I64); + ASSERT_FALSE(tag_and_val.value.value()->i64->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_unsigned, 18446744073709551615u); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_twos_compliment, -1); + EXPECT_TRUE(std::isnan(tag_and_val.value.value()->i64.value()->as_double)); + EXPECT_TRUE(std::signbit(tag_and_val.value.value()->i64.value()->as_double)); + } + + { // field 5 + auto tag_and_val = p_data->message->at(4); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 5); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I64); + ASSERT_FALSE(tag_and_val.value.value()->i64->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_unsigned, 0); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_twos_compliment, 0); + EXPECT_DOUBLE_EQ(tag_and_val.value.value()->i64.value()->as_double, 0.0); + } + + { // field 6 + auto tag_and_val = p_data->message->at(5); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 6); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I64); + ASSERT_FALSE(tag_and_val.value.value()->i64->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_unsigned, 9223372036854775808u); + EXPECT_DOUBLE_EQ(tag_and_val.value.value()->i64.value()->as_double, -0.0); + } + + { // field 7 + auto tag_and_val = p_data->message->at(6); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 7); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I64); + ASSERT_FALSE(tag_and_val.value.value()->i64->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_unsigned, 0); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_twos_compliment, 0); + EXPECT_DOUBLE_EQ(tag_and_val.value.value()->i64.value()->as_double, 0.0); + } + + { // field 8 + auto tag_and_val = p_data->message->at(7); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 8); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I64); + ASSERT_FALSE(tag_and_val.value.value()->i64->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_unsigned, 9218868437227405312); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_twos_compliment, 9218868437227405312); + EXPECT_TRUE(std::isinf(tag_and_val.value.value()->i64.value()->as_double)); + EXPECT_FALSE(std::signbit(tag_and_val.value.value()->i64.value()->as_double)); + } + + { // field 9 + auto tag_and_val = p_data->message->at(8); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 9); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I64); + ASSERT_FALSE(tag_and_val.value.value()->i64->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_unsigned, 18442240474082181120u); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_twos_compliment, -4503599627370496); + EXPECT_TRUE(std::isinf(tag_and_val.value.value()->i64.value()->as_double)); + EXPECT_TRUE(std::signbit(tag_and_val.value.value()->i64.value()->as_double)); + } + + { // field 10 + auto tag_and_val = p_data->message->at(9); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 10); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I64); + ASSERT_FALSE(tag_and_val.value.value()->i64->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_unsigned, 150); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_twos_compliment, 150); + EXPECT_DOUBLE_EQ(tag_and_val.value.value()->i64.value()->as_double, 7.41098e-322); + } + + { // field 11 + auto tag_and_val = p_data->message->at(10); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 11); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I64); + ASSERT_FALSE(tag_and_val.value.value()->i64->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_unsigned, 18446744073709551466u); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_twos_compliment, -150); + EXPECT_TRUE(std::isnan(tag_and_val.value.value()->i64.value()->as_double)); + EXPECT_TRUE(std::signbit(tag_and_val.value.value()->i64.value()->as_double)); + } + + { // field 12 + auto tag_and_val = p_data->message->at(11); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 12); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I64); + ASSERT_FALSE(tag_and_val.value.value()->i64->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_unsigned, 4639485190814774067); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_twos_compliment, 4639485190814774067); + EXPECT_DOUBLE_EQ(tag_and_val.value.value()->i64.value()->as_double, 150.1); + } + + { // field 13 + auto tag_and_val = p_data->message->at(12); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 13); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I64); + ASSERT_FALSE(tag_and_val.value.value()->i64->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_unsigned, 13862857227669549875u); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_twos_compliment, -4583886846040001741); + EXPECT_DOUBLE_EQ(tag_and_val.value.value()->i64.value()->as_double, -150.1); + } + + { // field 14 + auto tag_and_val = p_data->message->at(13); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 14); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I64); + ASSERT_FALSE(tag_and_val.value.value()->i64->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_unsigned, 4607182418800017409); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_twos_compliment, 4607182418800017409); + EXPECT_DOUBLE_EQ(tag_and_val.value.value()->i64.value()->as_double, 1.0); + } + + { // field 15 + auto tag_and_val = p_data->message->at(14); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 15); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I64); + ASSERT_FALSE(tag_and_val.value.value()->i64->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_unsigned, 4577909021222109184); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_twos_compliment, 4577909021222109184); + EXPECT_DOUBLE_EQ(tag_and_val.value.value()->i64.value()->as_double, 3.0 / 256.0); + } + + { // field 16 + auto tag_and_val = p_data->message->at(15); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 16); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I64); + ASSERT_FALSE(tag_and_val.value.value()->i64->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_unsigned, 1); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_twos_compliment, 1); + EXPECT_DOUBLE_EQ(tag_and_val.value.value()->i64.value()->as_double, 4.9406564584124654e-324); + } + + { // field 17 + auto tag_and_val = p_data->message->at(16); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 17); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I64); + ASSERT_FALSE(tag_and_val.value.value()->i64->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_unsigned, 4503599627370495); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_twos_compliment, 4503599627370495); + EXPECT_DOUBLE_EQ(tag_and_val.value.value()->i64.value()->as_double, 2.2250738585072009e-308); + } + + { // field 18 + auto tag_and_val = p_data->message->at(17); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 18); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I64); + ASSERT_FALSE(tag_and_val.value.value()->i64->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_unsigned, 4503599627370496); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_twos_compliment, 4503599627370496); + EXPECT_DOUBLE_EQ(tag_and_val.value.value()->i64.value()->as_double, 2.2250738585072014e-308); + } + + { // field 19 + auto tag_and_val = p_data->message->at(18); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 19); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I64); + ASSERT_FALSE(tag_and_val.value.value()->i64->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_unsigned, 9218868437227405311); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_twos_compliment, 9218868437227405311); + EXPECT_DOUBLE_EQ(tag_and_val.value.value()->i64.value()->as_double, 1.7976931348623157e308); + } + + { // field 20 + auto tag_and_val = p_data->message->at(19); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 20); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I64); + ASSERT_FALSE(tag_and_val.value.value()->i64->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_unsigned, 9218868437227405313); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_twos_compliment, 9218868437227405313); + EXPECT_TRUE(std::isnan(tag_and_val.value.value()->i64.value()->as_double)); + EXPECT_FALSE(std::signbit(tag_and_val.value.value()->i64.value()->as_double)); + } + + { // field 21 + auto tag_and_val = p_data->message->at(20); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 21); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I64); + ASSERT_FALSE(tag_and_val.value.value()->i64->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_unsigned, 9221120237041090561); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_twos_compliment, 9221120237041090561); + EXPECT_TRUE(std::isnan(tag_and_val.value.value()->i64.value()->as_double)); + EXPECT_FALSE(std::signbit(tag_and_val.value.value()->i64.value()->as_double)); + } + + { // field 22 + auto tag_and_val = p_data->message->at(21); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 22); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I64); + ASSERT_FALSE(tag_and_val.value.value()->i64->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_unsigned, 9223372036854775807); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_twos_compliment, 9223372036854775807); + EXPECT_TRUE(std::isnan(tag_and_val.value.value()->i64.value()->as_double)); + EXPECT_FALSE(std::signbit(tag_and_val.value.value()->i64.value()->as_double)); + } + + { // field 23 + auto tag_and_val = p_data->message->at(22); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 23); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I64); + ASSERT_FALSE(tag_and_val.value.value()->i64->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_unsigned, 4599676419421066581); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_twos_compliment, 4599676419421066581); + EXPECT_DOUBLE_EQ(tag_and_val.value.value()->i64.value()->as_double, 1.0 / 3.0); + } + + { // field 24 + auto tag_and_val = p_data->message->at(23); + EXPECT_EQ(tag_and_val.tag.value()->field_num, 24); + EXPECT_EQ(tag_and_val.tag.value()->wire_type.value(), WireType::I64); + ASSERT_FALSE(tag_and_val.value.value()->i64->isNull()); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_unsigned, 4614256656748904448); + EXPECT_EQ(tag_and_val.value.value()->i64.value()->as_twos_compliment, 4614256656748904448); + EXPECT_DOUBLE_EQ(tag_and_val.value.value()->i64.value()->as_double, 3.14159274101257324); + } + +} + } // anonymous namespace