Index: code/branches/cpp11_v2/test/util/MultiTypeTest.cc
===================================================================
--- code/branches/cpp11_v2/test/util/MultiTypeTest.cc	(revision 10989)
+++ code/branches/cpp11_v2/test/util/MultiTypeTest.cc	(revision 11002)
@@ -697,3 +697,242 @@
         EXPECT_TRUE(mt.null());
     }
+
+    ///////////////////////////////
+    // Strongly typed enum class //
+    ///////////////////////////////
+    enum class EnumWithChar : unsigned char
+    {
+        ValueA = 'A',
+        ValueB = 'B',
+        ValueC = 'C',
+    };
+    enum class EnumWithInt
+    {
+        Value1 = 50,
+        Value2 = 0,
+        Value3,
+    };
+
+    TEST(MultiType, Enum_Constructor)
+    {
+        // Constructor:
+        {
+            MultiType mt = EnumWithChar::ValueA;
+
+            EXPECT_TRUE(mt.isType<EnumWithChar>());
+            EXPECT_EQ(EnumWithChar::ValueA, mt.get<EnumWithChar>());
+        }
+        {
+            MultiType mt = MultiType(EnumWithInt::Value1);
+
+            EXPECT_TRUE(mt.isType<EnumWithInt>());
+            EXPECT_EQ(EnumWithInt::Value1, mt.get<EnumWithInt>());
+        }
+    }
+
+    TEST(MultiType, Enum_Assignment)
+    {
+        // operator=:
+        MultiType mt;
+        mt = EnumWithChar::ValueB;
+
+        EXPECT_TRUE(mt.isType<EnumWithChar>());
+        EXPECT_EQ(EnumWithChar::ValueB, mt.get<EnumWithChar>());
+    }
+
+    TEST(MultiType, Enum_Set)
+    {
+        // set(value):
+        {
+            MultiType mt;
+            mt.set(EnumWithInt::Value2); // assign enum to an empty MultiType
+
+            EXPECT_TRUE(mt.isType<EnumWithInt>());
+            EXPECT_EQ(EnumWithInt::Value2, mt.get<EnumWithInt>());
+        }
+        {
+            MultiType mt = "string";
+            mt.set(EnumWithChar::ValueC); // assign enum to a MultiType with type std::string
+
+            EXPECT_TRUE(mt.isType<std::string>());
+            EXPECT_EQ("C", mt.get<std::string>());
+        }
+        {
+            MultiType mt = EnumWithChar::ValueA;
+            mt.set(EnumWithChar::ValueB); // assign enum to a MultiType with type std::string
+
+            EXPECT_TRUE(mt.isType<EnumWithChar>());
+            EXPECT_EQ(EnumWithChar::ValueB, mt.get<EnumWithChar>());
+        }
+        {
+            MultiType mt = EnumWithInt::Value3;
+            mt.set("50"); // assign enum to a MultiType with type std::string
+
+            EXPECT_TRUE(mt.isType<EnumWithInt>());
+            EXPECT_EQ(EnumWithInt::Value1, mt.get<EnumWithInt>());
+        }
+    }
+
+    TEST(MultiType, Enum_Force)
+    {
+        // force(value):
+        {
+            MultiType mt = "string";
+            EXPECT_TRUE(mt.isType<std::string>());
+            EXPECT_EQ("string", mt.get<std::string>());
+
+            mt.force<EnumWithChar>("C");
+
+            EXPECT_TRUE(mt.isType<EnumWithChar>());
+            EXPECT_EQ(EnumWithChar::ValueC, mt.get<EnumWithChar>());
+        }
+        {
+            MultiType mt = EnumWithChar::ValueA;
+            EXPECT_TRUE(mt.isType<EnumWithChar>());
+            EXPECT_EQ(EnumWithChar::ValueA, mt.get<EnumWithChar>());
+
+            mt.force<std::string>(EnumWithChar::ValueB);
+
+            EXPECT_TRUE(mt.isType<std::string>());
+            EXPECT_EQ("B", mt.get<std::string>());
+        }
+    }
+
+    TEST(MultiType, Enum_Convert)
+    {
+        // convert():
+        {
+            MultiType mt = "C";
+            mt.convert<EnumWithChar>();
+
+            EXPECT_TRUE(mt.isType<EnumWithChar>());
+            EXPECT_EQ(EnumWithChar::ValueC, mt.get<EnumWithChar>());
+        }
+        {
+            MultiType mt = EnumWithChar::ValueA;
+            mt.convert<std::string>();
+
+            EXPECT_TRUE(mt.isType<std::string>());
+            EXPECT_EQ("A", mt.get<std::string>());
+        }
+    }
+
+    TEST(MultiType, Enum_Reset)
+    {
+        // reset():
+        {
+            MultiType mt = EnumWithChar::ValueA;
+            mt.reset<EnumWithChar>();
+
+            EXPECT_TRUE(mt.isType<EnumWithChar>());
+            EXPECT_TRUE(mt.isType<unsigned char>());
+            EXPECT_EQ('\0', mt.get<unsigned char>());
+        }
+        {
+            MultiType mt = "string";
+            mt.reset<EnumWithInt>();
+
+            EXPECT_TRUE(mt.isType<EnumWithInt>());
+            EXPECT_TRUE(mt.isType<int>());
+            EXPECT_EQ(0, mt.get<int>());
+        }
+    }
+
+    TEST(MultiType, Enum_IsType)
+    {
+        // isType():
+        {
+            MultiType mt = EnumWithChar::ValueB;
+            EXPECT_TRUE(mt.isType<EnumWithChar>());
+            EXPECT_TRUE(mt.isType<unsigned char>());
+            EXPECT_FALSE(mt.isType<char>());
+            EXPECT_FALSE(mt.isType<int>());
+            EXPECT_FALSE(mt.isType<bool>());
+            EXPECT_FALSE(mt.isType<std::string>());
+        }
+        {
+            MultiType mt = EnumWithInt::Value3;
+            EXPECT_TRUE(mt.isType<EnumWithInt>());
+            EXPECT_TRUE(mt.isType<int>());
+            EXPECT_FALSE(mt.isType<unsigned char>());
+            EXPECT_FALSE(mt.isType<char>());
+            EXPECT_FALSE(mt.isType<bool>());
+            EXPECT_FALSE(mt.isType<std::string>());
+        }
+    }
+
+    TEST(MultiType, Enum_ConversionOperator)
+    {
+        // conversion operator:
+        {
+            MultiType mt = EnumWithChar::ValueA;
+            EnumWithChar value = mt;
+            EXPECT_EQ(EnumWithChar::ValueA, value);
+        }
+        {
+            MultiType mt = 'B';
+            EnumWithChar value = mt;
+            EXPECT_EQ(EnumWithChar::ValueB, value);
+        }
+        {
+            MultiType mt = EnumWithInt::Value1;
+            std::string value = mt;
+            EXPECT_EQ("50", value);
+        }
+    }
+
+    TEST(MultiType, Enum_GetValue)
+    {
+        // getValue():
+        {
+            MultiType mt = EnumWithChar::ValueA;
+            EnumWithChar value;
+            mt.getValue(&value);
+            EXPECT_EQ(EnumWithChar::ValueA, value);
+        }
+        {
+            MultiType mt = 'B';
+            EnumWithChar value;
+            mt.getValue(&value);
+            EXPECT_EQ(EnumWithChar::ValueB, value);
+        }
+        {
+            MultiType mt = EnumWithInt::Value1;
+            std::string value;
+            mt.getValue(&value);
+            EXPECT_EQ("50", value);
+        }
+    }
+
+    TEST(MultiType, Enum_Get)
+    {
+        // get():
+        {
+            MultiType mt = EnumWithChar::ValueB;
+            EXPECT_EQ(EnumWithChar::ValueB, mt.get<EnumWithChar>());
+
+            EXPECT_EQ('B', mt.get<unsigned char>());
+            EXPECT_EQ("B", mt.get<std::string>());
+            EXPECT_EQ(66, mt.get<int>());
+            EXPECT_TRUE(mt.get<bool>());
+        }
+        {
+            MultiType mt = EnumWithInt::Value1;
+            EXPECT_EQ(EnumWithInt::Value1, mt.get<EnumWithInt>());
+
+            EXPECT_EQ('2', mt.get<unsigned char>());
+            EXPECT_EQ("50", mt.get<std::string>());
+            EXPECT_EQ(50, mt.get<int>());
+            EXPECT_TRUE(mt.get<bool>());
+        }
+        {
+            MultiType mt = EnumWithInt::Value2;
+            EXPECT_EQ(EnumWithInt::Value2, mt.get<EnumWithInt>());
+
+            EXPECT_EQ('\0', mt.get<unsigned char>());
+            EXPECT_EQ("0", mt.get<std::string>());
+            EXPECT_EQ(0, mt.get<int>());
+            EXPECT_FALSE(mt.get<bool>());
+        }
+    }
 }
