4 #include "gtest/gtest.h" 9 template <
typename T>
class valueTest :
public ::testing::Test {
38 typedef ::testing::Types<bool, uint8_t, uint16_t, uint32_t, int8_t, int16_t,
39 int32_t, float,
double>
46 EXPECT_EQ(TypeParam(0), v());
47 EXPECT_FALSE(v.
set());
56 EXPECT_TRUE(v1.
set());
59 EXPECT_TRUE(v2.set());
65 TypeParam ref = std::numeric_limits<TypeParam>::max();
69 EXPECT_TRUE(v1.
set());
72 EXPECT_TRUE(v2.set());
78 TypeParam ref = std::numeric_limits<TypeParam>::min();
82 EXPECT_TRUE(v1.
set());
85 EXPECT_TRUE(v2.set());
90 EXPECT_FALSE(v.
set());
92 const TypeParam ref1 = std::numeric_limits<TypeParam>::max();
99 const TypeParam ref2 = v;
100 EXPECT_EQ(ref1, ref2);
106 EXPECT_EQ(
false, v.
set());
111 v1 = std::string(
"test");
112 EXPECT_EQ(
"test", v1());
113 EXPECT_EQ(
true, v1.
set());
115 EXPECT_EQ(
"test", v2());
116 EXPECT_EQ(
true, v2.set());
121 EXPECT_EQ(
true, v().empty());
122 EXPECT_EQ(
false, v.
set());
128 EXPECT_EQ(1, v1()[0]);
129 EXPECT_EQ(
true, v1.
set());
131 EXPECT_EQ(1, v2()[0]);
132 EXPECT_EQ(
true, v2.set());
137 int main(
int argc,
char **argv) {
138 ::testing::InitGoogleTest(&argc, argv);
139 return RUN_ALL_TESTS();
TYPED_TEST_CASE(ByteVectorBasicTest, basicTypes)
TEST(ByteVectorBasicTest, Initialzation)
::testing::Types< bool, uint8_t, uint16_t, uint32_t, int8_t, int16_t, int32_t, float, double > numTypes
TYPED_TEST(ByteVectorBasicTest, Pack1zero)
int main(int argc, char **argv)
bool set() const
Queries if the data has been set.