Changeset 10197 for code/trunk/test/util
- Timestamp:
- Jan 17, 2015, 6:43:35 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/test/util/MultiTypeTest.cc
r9545 r10197 60 60 TEST(MultiType, ValueBool) { bool value = true; MultiType mt(value); EXPECT_TRUE(mt.isType<bool>()); EXPECT_EQ(true, mt.get<bool>()); } 61 61 TEST(MultiType, ValueVoidpointer) { int* pointer = new int; void* value = pointer; MultiType mt(value); EXPECT_TRUE(mt.isType<void*>()); EXPECT_EQ(value, mt.get<void*>()); delete pointer; } 62 TEST(MultiType, ValueSomepointer) { int* value = new int; MultiType mt(value); EXPECT_TRUE(mt.isType<void*>()); EXPECT_EQ(value, mt.get<int*>()); delete value; } 62 63 TEST(MultiType, ValueString) { std::string value = "Hello World"; MultiType mt(value); EXPECT_TRUE(mt.isType<std::string>()); EXPECT_EQ("Hello World", mt.get<std::string>()); } 63 64 TEST(MultiType, ValueVector2) { Vector2 value = Vector2(11, 22); MultiType mt(value); EXPECT_TRUE(mt.isType<Vector2>()); EXPECT_EQ(Vector2(11, 22), mt.get<Vector2>()); }
Note: See TracChangeset
for help on using the changeset viewer.