diff options
Diffstat (limited to 'Runtime/IMGUI/GUIContentTests.cpp')
-rw-r--r-- | Runtime/IMGUI/GUIContentTests.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Runtime/IMGUI/GUIContentTests.cpp b/Runtime/IMGUI/GUIContentTests.cpp new file mode 100644 index 0000000..4f45a64 --- /dev/null +++ b/Runtime/IMGUI/GUIContentTests.cpp @@ -0,0 +1,28 @@ +#include "UnityPrefix.h" + +#if ENABLE_UNIT_TESTS + +#include "External/UnitTest++/src/UnitTest++.h" +#include "Runtime/IMGUI/GUIContent.h" +#include "Runtime/Testing/TestFixtures.h" +#include "Runtime/Testing/Testing.h" + +SUITE (GUIContentTests) +{ + typedef TestFixtureBase Fixture; + + TEST_FIXTURE (Fixture, NullContentDoesNotCrash) + { + //Set expectations. + EXPECT (Warning, "GUIContent is null. Use GUIContent.none."); + + // Do. + GUIContent content = MonoGUIContentToTempNative (SCRIPTING_NULL); + + // Assert. + CHECK ((UTF16String)"" == content.m_Text); + CHECK ((UTF16String)"" == content.m_Tooltip); + CHECK (content.m_Image.IsNull()); + } +} +#endif |