|
@@ -60,6 +60,8 @@ TEST_F(SimpleTest, SimpleBoolMessageTest)
|
|
ASSERT_TRUE(test.setProperty(propertyName, QVariant::fromValue(true)));
|
|
ASSERT_TRUE(test.setProperty(propertyName, QVariant::fromValue(true)));
|
|
ASSERT_EQ(test.property(propertyName).value<bool>(), true);
|
|
ASSERT_EQ(test.property(propertyName).value<bool>(), true);
|
|
ASSERT_EQ(test.testFieldBool(), true);
|
|
ASSERT_EQ(test.testFieldBool(), true);
|
|
|
|
+
|
|
|
|
+ EXPECT_EQ(SimpleBoolMessage::TestFieldBoolProtoFieldNumber, 1);
|
|
}
|
|
}
|
|
|
|
|
|
TEST_F(SimpleTest, SimpleIntMessageTest)
|
|
TEST_F(SimpleTest, SimpleIntMessageTest)
|
|
@@ -71,6 +73,8 @@ TEST_F(SimpleTest, SimpleIntMessageTest)
|
|
ASSERT_TRUE(test.setProperty(propertyName, QVariant::fromValue<int32>(1)));
|
|
ASSERT_TRUE(test.setProperty(propertyName, QVariant::fromValue<int32>(1)));
|
|
ASSERT_EQ(test.property(propertyName).value<int32>(), 1);
|
|
ASSERT_EQ(test.property(propertyName).value<int32>(), 1);
|
|
ASSERT_EQ(test.testFieldInt(), 1);
|
|
ASSERT_EQ(test.testFieldInt(), 1);
|
|
|
|
+
|
|
|
|
+ EXPECT_EQ(SimpleIntMessage::TestFieldIntProtoFieldNumber, 1);
|
|
}
|
|
}
|
|
|
|
|
|
TEST_F(SimpleTest, SimpleSIntMessageTest)
|
|
TEST_F(SimpleTest, SimpleSIntMessageTest)
|
|
@@ -82,6 +86,8 @@ TEST_F(SimpleTest, SimpleSIntMessageTest)
|
|
ASSERT_TRUE(test.setProperty(propertyName, QVariant::fromValue<sint32>(1)));
|
|
ASSERT_TRUE(test.setProperty(propertyName, QVariant::fromValue<sint32>(1)));
|
|
ASSERT_EQ(test.property(propertyName).value<sint32>(), 1);
|
|
ASSERT_EQ(test.property(propertyName).value<sint32>(), 1);
|
|
ASSERT_EQ(test.testFieldInt(), 1);
|
|
ASSERT_EQ(test.testFieldInt(), 1);
|
|
|
|
+
|
|
|
|
+ EXPECT_EQ(SimpleSIntMessage::TestFieldIntProtoFieldNumber, 1);
|
|
}
|
|
}
|
|
|
|
|
|
TEST_F(SimpleTest, SimpleUIntMessageTest)
|
|
TEST_F(SimpleTest, SimpleUIntMessageTest)
|
|
@@ -93,6 +99,8 @@ TEST_F(SimpleTest, SimpleUIntMessageTest)
|
|
ASSERT_TRUE(test.setProperty(propertyName, QVariant::fromValue<uint32>(1)));
|
|
ASSERT_TRUE(test.setProperty(propertyName, QVariant::fromValue<uint32>(1)));
|
|
ASSERT_EQ(test.property(propertyName).value<uint32>(), 1);
|
|
ASSERT_EQ(test.property(propertyName).value<uint32>(), 1);
|
|
ASSERT_EQ(test.testFieldInt(), 1);
|
|
ASSERT_EQ(test.testFieldInt(), 1);
|
|
|
|
+
|
|
|
|
+ EXPECT_EQ(SimpleUIntMessage::TestFieldIntProtoFieldNumber, 1);
|
|
}
|
|
}
|
|
|
|
|
|
TEST_F(SimpleTest, SimpleInt64MessageTest)
|
|
TEST_F(SimpleTest, SimpleInt64MessageTest)
|
|
@@ -104,6 +112,8 @@ TEST_F(SimpleTest, SimpleInt64MessageTest)
|
|
ASSERT_TRUE(test.setProperty(propertyName, QVariant::fromValue<int64>(1)));
|
|
ASSERT_TRUE(test.setProperty(propertyName, QVariant::fromValue<int64>(1)));
|
|
ASSERT_EQ(test.property(propertyName).value<int64>(), 1);
|
|
ASSERT_EQ(test.property(propertyName).value<int64>(), 1);
|
|
ASSERT_EQ(test.testFieldInt(), 1);
|
|
ASSERT_EQ(test.testFieldInt(), 1);
|
|
|
|
+
|
|
|
|
+ EXPECT_EQ(SimpleInt64Message::TestFieldIntProtoFieldNumber, 1);
|
|
}
|
|
}
|
|
|
|
|
|
TEST_F(SimpleTest, SimpleSInt64MessageTest)
|
|
TEST_F(SimpleTest, SimpleSInt64MessageTest)
|
|
@@ -115,6 +125,8 @@ TEST_F(SimpleTest, SimpleSInt64MessageTest)
|
|
ASSERT_TRUE(test.setProperty(propertyName, QVariant::fromValue<sint64>(1)));
|
|
ASSERT_TRUE(test.setProperty(propertyName, QVariant::fromValue<sint64>(1)));
|
|
ASSERT_EQ(test.property(propertyName).value<sint64>(), 1);
|
|
ASSERT_EQ(test.property(propertyName).value<sint64>(), 1);
|
|
ASSERT_EQ(test.testFieldInt(), 1);
|
|
ASSERT_EQ(test.testFieldInt(), 1);
|
|
|
|
+
|
|
|
|
+ EXPECT_EQ(SimpleSInt64Message::TestFieldIntProtoFieldNumber, 1);
|
|
}
|
|
}
|
|
|
|
|
|
TEST_F(SimpleTest, SimpleUInt64MessageTest)
|
|
TEST_F(SimpleTest, SimpleUInt64MessageTest)
|
|
@@ -126,6 +138,8 @@ TEST_F(SimpleTest, SimpleUInt64MessageTest)
|
|
ASSERT_TRUE(test.setProperty(propertyName, QVariant::fromValue<uint64>(1)));
|
|
ASSERT_TRUE(test.setProperty(propertyName, QVariant::fromValue<uint64>(1)));
|
|
ASSERT_EQ(test.property(propertyName).value<uint64>(), 1);
|
|
ASSERT_EQ(test.property(propertyName).value<uint64>(), 1);
|
|
ASSERT_EQ(test.testFieldInt(), 1);
|
|
ASSERT_EQ(test.testFieldInt(), 1);
|
|
|
|
+
|
|
|
|
+ EXPECT_EQ(SimpleUInt64Message::TestFieldIntProtoFieldNumber, 1);
|
|
}
|
|
}
|
|
|
|
|
|
TEST_F(SimpleTest, SimpleFixedInt32MessageTest)
|
|
TEST_F(SimpleTest, SimpleFixedInt32MessageTest)
|
|
@@ -137,6 +151,8 @@ TEST_F(SimpleTest, SimpleFixedInt32MessageTest)
|
|
ASSERT_TRUE(test.setProperty(propertyName, QVariant::fromValue<fixed32>(1)));
|
|
ASSERT_TRUE(test.setProperty(propertyName, QVariant::fromValue<fixed32>(1)));
|
|
ASSERT_EQ(test.property(propertyName).value<fixed32>(), 1);
|
|
ASSERT_EQ(test.property(propertyName).value<fixed32>(), 1);
|
|
ASSERT_EQ(test.testFieldFixedInt32(), 1);
|
|
ASSERT_EQ(test.testFieldFixedInt32(), 1);
|
|
|
|
+
|
|
|
|
+ EXPECT_EQ(SimpleFixedInt32Message::TestFieldFixedInt32ProtoFieldNumber, 1);
|
|
}
|
|
}
|
|
|
|
|
|
TEST_F(SimpleTest, SimpleFixedInt64MessageTest)
|
|
TEST_F(SimpleTest, SimpleFixedInt64MessageTest)
|
|
@@ -148,6 +164,8 @@ TEST_F(SimpleTest, SimpleFixedInt64MessageTest)
|
|
ASSERT_TRUE(test.setProperty(propertyName, QVariant::fromValue<fixed64>(1)));
|
|
ASSERT_TRUE(test.setProperty(propertyName, QVariant::fromValue<fixed64>(1)));
|
|
ASSERT_EQ(test.property(propertyName).value<fixed64>(), 1);
|
|
ASSERT_EQ(test.property(propertyName).value<fixed64>(), 1);
|
|
ASSERT_EQ(test.testFieldFixedInt64(), 1);
|
|
ASSERT_EQ(test.testFieldFixedInt64(), 1);
|
|
|
|
+
|
|
|
|
+ EXPECT_EQ(SimpleFixedInt64Message::TestFieldFixedInt64ProtoFieldNumber, 1);
|
|
}
|
|
}
|
|
|
|
|
|
TEST_F(SimpleTest, SimpleSFixedInt32MessageTest)
|
|
TEST_F(SimpleTest, SimpleSFixedInt32MessageTest)
|
|
@@ -159,6 +177,8 @@ TEST_F(SimpleTest, SimpleSFixedInt32MessageTest)
|
|
ASSERT_TRUE(test.setProperty(propertyName, QVariant::fromValue<sfixed32>(1)));
|
|
ASSERT_TRUE(test.setProperty(propertyName, QVariant::fromValue<sfixed32>(1)));
|
|
ASSERT_EQ(test.property(propertyName).value<sfixed32>(), 1);
|
|
ASSERT_EQ(test.property(propertyName).value<sfixed32>(), 1);
|
|
ASSERT_EQ(test.testFieldFixedInt32(), 1);
|
|
ASSERT_EQ(test.testFieldFixedInt32(), 1);
|
|
|
|
+
|
|
|
|
+ EXPECT_EQ(SimpleSFixedInt32Message::TestFieldFixedInt32ProtoFieldNumber, 1);
|
|
}
|
|
}
|
|
|
|
|
|
TEST_F(SimpleTest, SimpleSFixedInt64MessageTest)
|
|
TEST_F(SimpleTest, SimpleSFixedInt64MessageTest)
|
|
@@ -170,6 +190,8 @@ TEST_F(SimpleTest, SimpleSFixedInt64MessageTest)
|
|
ASSERT_TRUE(test.setProperty(propertyName, QVariant::fromValue<sfixed64>(1)));
|
|
ASSERT_TRUE(test.setProperty(propertyName, QVariant::fromValue<sfixed64>(1)));
|
|
ASSERT_EQ(test.property(propertyName).value<sfixed64>(), 1);
|
|
ASSERT_EQ(test.property(propertyName).value<sfixed64>(), 1);
|
|
ASSERT_EQ(test.testFieldFixedInt64(), 1);
|
|
ASSERT_EQ(test.testFieldFixedInt64(), 1);
|
|
|
|
+
|
|
|
|
+ EXPECT_EQ(SimpleSFixedInt64Message::TestFieldFixedInt64ProtoFieldNumber, 1);
|
|
}
|
|
}
|
|
|
|
|
|
TEST_F(SimpleTest, SimpleStringMessageTest)
|
|
TEST_F(SimpleTest, SimpleStringMessageTest)
|
|
@@ -182,6 +204,8 @@ TEST_F(SimpleTest, SimpleStringMessageTest)
|
|
ASSERT_TRUE(test.setProperty(propertyName, QVariant::fromValue(QString("test1"))));
|
|
ASSERT_TRUE(test.setProperty(propertyName, QVariant::fromValue(QString("test1"))));
|
|
ASSERT_STREQ(test.property(propertyName).toString().toStdString().c_str(), "test1");
|
|
ASSERT_STREQ(test.property(propertyName).toString().toStdString().c_str(), "test1");
|
|
ASSERT_STREQ(test.testFieldString().toStdString().c_str(), "test1");
|
|
ASSERT_STREQ(test.testFieldString().toStdString().c_str(), "test1");
|
|
|
|
+
|
|
|
|
+ EXPECT_EQ(SimpleStringMessage::TestFieldStringProtoFieldNumber, 6);
|
|
}
|
|
}
|
|
|
|
|
|
TEST_F(SimpleTest, SimpleFloatMessageTest)
|
|
TEST_F(SimpleTest, SimpleFloatMessageTest)
|
|
@@ -196,6 +220,8 @@ TEST_F(SimpleTest, SimpleFloatMessageTest)
|
|
ASSERT_TRUE(test.setProperty(propertyName, QVariant::fromValue<float>(assignedValue)));
|
|
ASSERT_TRUE(test.setProperty(propertyName, QVariant::fromValue<float>(assignedValue)));
|
|
ASSERT_FLOAT_EQ(test.property(propertyName).toFloat(), assignedValue);
|
|
ASSERT_FLOAT_EQ(test.property(propertyName).toFloat(), assignedValue);
|
|
ASSERT_FLOAT_EQ(test.testFieldFloat(), assignedValue);
|
|
ASSERT_FLOAT_EQ(test.testFieldFloat(), assignedValue);
|
|
|
|
+
|
|
|
|
+ EXPECT_EQ(SimpleFloatMessage::TestFieldFloatProtoFieldNumber, 7);
|
|
}
|
|
}
|
|
|
|
|
|
TEST_F(SimpleTest, SimpleDoubleMessageTest)
|
|
TEST_F(SimpleTest, SimpleDoubleMessageTest)
|
|
@@ -210,6 +236,8 @@ TEST_F(SimpleTest, SimpleDoubleMessageTest)
|
|
ASSERT_TRUE(test.setProperty(propertyName, QVariant::fromValue<double>(assignedValue)));
|
|
ASSERT_TRUE(test.setProperty(propertyName, QVariant::fromValue<double>(assignedValue)));
|
|
ASSERT_DOUBLE_EQ(test.property(propertyName).toDouble(), assignedValue);
|
|
ASSERT_DOUBLE_EQ(test.property(propertyName).toDouble(), assignedValue);
|
|
ASSERT_DOUBLE_EQ(test.testFieldDouble(), assignedValue);
|
|
ASSERT_DOUBLE_EQ(test.testFieldDouble(), assignedValue);
|
|
|
|
+
|
|
|
|
+ EXPECT_EQ(SimpleDoubleMessage::TestFieldDoubleProtoFieldNumber, 8);
|
|
}
|
|
}
|
|
|
|
|
|
TEST_F(SimpleTest, SimpleLocalEnumTest)
|
|
TEST_F(SimpleTest, SimpleLocalEnumTest)
|