Add Wayland_EFL_Actionslider_Suite
authorJoe Konno <joe.konno@intel.com>
Tue, 19 Jun 2012 17:53:03 +0000 (10:53 -0700)
committerJoe Konno <joe.konno@intel.com>
Tue, 19 Jun 2012 17:53:33 +0000 (10:53 -0700)
Contained in test_actionslider.cpp, dependent on the Actionslider class.

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

index 33de4af..610d5d5 100644 (file)
@@ -27,6 +27,7 @@ wayland_efl_test_SOURCES =    \
        test_button.cpp         \
        test_window.cpp         \
        test_engine_set.cpp     \
+       test_actionslider.cpp   \
        ../testmain.cpp
 
 endif
diff --git a/src/efl/test_actionslider.cpp b/src/efl/test_actionslider.cpp
new file mode 100644 (file)
index 0000000..db9cea6
--- /dev/null
@@ -0,0 +1,59 @@
+#include <Elementary.h>
+#include <boost/bind.hpp>
+
+#include "window.h"
+#include "actionslider.h"
+#include "evasobject.h"
+#include "elmtestharness.h"
+
+class ActionsliderPosTest : public ElmTestHarness
+{
+public:
+
+       ActionsliderPosTest()
+               : ElmTestHarness::ElmTestHarness()
+               , window_("ActionsliderPosTest", "Actionslider Position Test")
+               , as_(window_)
+       {
+               return;
+       }
+
+       void setup()
+       {
+               elm_win_resize_object_add(window_, as_);
+               window_.show();
+               as_.show();
+
+               const Elm_Actionslider_Pos position[] = {
+                                                         ELM_ACTIONSLIDER_LEFT,
+                                                         ELM_ACTIONSLIDER_CENTER,
+                                                         ELM_ACTIONSLIDER_RIGHT
+                                                       };
+
+               unsigned int p;
+               for (p = 0; p < (sizeof(position) / sizeof(Elm_Actionslider_Pos)); p++)
+               {
+                       queueCallback(
+                               ModifyCheckCallback(
+                                       boost::bind(&Actionslider::setPos, boost::ref(as_), position[p]),
+                                       boost::bind(&ActionsliderPosTest::checkPos, boost::ref(*this), position[p])
+                               )
+                       );
+               }
+       }
+
+       void checkPos(Elm_Actionslider_Pos pos)
+       {
+               BOOST_CHECK_EQUAL(as_.getPos(), pos);
+       }
+
+private:
+       Window          window_;
+       Actionslider    as_;
+};
+
+BOOST_AUTO_TEST_SUITE(Wayland_EFL_Actionslider_Suite)
+
+       WAYLAND_ELM_HARNESS_TEST_CASE(ActionsliderPosTest)
+
+BOOST_AUTO_TEST_SUITE_END()