Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10197 for code/trunk/test/util


Ignore:
Timestamp:
Jan 17, 2015, 6:43:35 PM (10 years ago)
Author:
landauf
Message:

avoid implicit conversion in MultiType.get<T>()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/test/util/MultiTypeTest.cc

    r9545 r10197  
    6060    TEST(MultiType, ValueBool)              { bool value = true;                                MultiType mt(value);    EXPECT_TRUE(mt.isType<bool>());                 EXPECT_EQ(true, mt.get<bool>()); }
    6161    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; }
    6263    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>()); }
    6364    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.