summaryrefslogtreecommitdiff
path: root/Runtime/IMGUI/GUIContentTests.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-08-14 22:50:43 +0800
committerchai <chaifix@163.com>2019-08-14 22:50:43 +0800
commit15740faf9fe9fe4be08965098bbf2947e096aeeb (patch)
treea730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/IMGUI/GUIContentTests.cpp
+Unity Runtime codeHEADmaster
Diffstat (limited to 'Runtime/IMGUI/GUIContentTests.cpp')
-rw-r--r--Runtime/IMGUI/GUIContentTests.cpp28
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