Add Wayland_EFL_Background_Suite
authorJoe Konno <joe.konno@intel.com>
Tue, 19 Jun 2012 18:44:35 +0000 (11:44 -0700)
committerJoe Konno <joe.konno@intel.com>
Tue, 19 Jun 2012 18:45:16 +0000 (11:45 -0700)
In test_background.cpp, dependent on Background class.

Signed-off-by: Joe Konno <joe.konno@intel.com>
src/efl/Makefile.am
src/efl/test_background.cpp [new file with mode: 0644]

index 4efc149..b3c3a75 100644 (file)
@@ -29,6 +29,7 @@ wayland_efl_test_SOURCES =    \
        test_window.cpp         \
        test_engine_set.cpp     \
        test_actionslider.cpp   \
+       test_background.cpp     \
        ../testmain.cpp
 
 endif
diff --git a/src/efl/test_background.cpp b/src/efl/test_background.cpp
new file mode 100644 (file)
index 0000000..1bef603
--- /dev/null
@@ -0,0 +1,57 @@
+#include <Elementary.h>
+#include <boost/bind.hpp>
+
+#include "window.h"
+#include "background.h"
+#include "evasobject.h"
+#include "elmtestharness.h"
+
+class BackgroundColorTest : public ElmTestHarness
+{
+public:
+
+       BackgroundColorTest()
+               : ElmTestHarness::ElmTestHarness()
+               , window_("BackgroundColorTest", "Background Color Test")
+               , bg_(window_)
+       {
+               return;
+       }
+
+       void setup()
+       {
+               bg_.show();
+               window_.show();
+
+               int r, g, b;
+               for (r = 0; r < 256; r += 64)
+                       for (g = 0; g < 256; g += 64)
+                               for (b = 0; b < 256; b += 64)
+               {
+                       queueCallback(
+                               ModifyCheckCallback(
+                                       boost::bind(&Background::setColor, boost::ref(bg_), r, g, b),
+                                       boost::bind(&BackgroundColorTest::checkColor, boost::ref(*this), r, g, b)
+                               )
+                       );
+               }
+       }
+
+       void checkColor(int r, int g, int b)
+       {
+               int r_, g_, b_;
+               bg_.getColor(&r_, &g_, &b_);
+
+               BOOST_CHECK(r_ == r && g_ == g && b_ == b);
+       }
+
+private:
+       Window          window_;
+       Background      bg_;
+};
+
+BOOST_AUTO_TEST_SUITE(Wayland_EFL_Background_Suite)
+
+       WAYLAND_ELM_HARNESS_TEST_CASE(BackgroundColorTest)
+
+BOOST_AUTO_TEST_SUITE_END()