From: Joe Konno Date: Tue, 19 Jun 2012 18:44:35 +0000 (-0700) Subject: Add Wayland_EFL_Background_Suite X-Git-Tag: upstream/0.2.1~325 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c92003efa81685d3297916f12eefc1778b150dc9;p=test%2Fgeneric%2Fwayland-fits.git Add Wayland_EFL_Background_Suite In test_background.cpp, dependent on Background class. Signed-off-by: Joe Konno --- diff --git a/src/efl/Makefile.am b/src/efl/Makefile.am index 4efc149..b3c3a75 100644 --- a/src/efl/Makefile.am +++ b/src/efl/Makefile.am @@ -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 index 0000000..1bef603 --- /dev/null +++ b/src/efl/test_background.cpp @@ -0,0 +1,57 @@ +#include +#include + +#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()