window_.show();
object_.show();
- foreach (const int& w, widths_)
+ foreach (const int w, widths_)
{
- foreach (const int& h, heights_)
+ foreach (const int h, heights_)
{
queueCallback(
ModifyCheckCallback(
states_.push_back(EINA_TRUE);
states_.push_back(EINA_FALSE);
states_.push_back(EINA_TRUE);
-
- return;
}
void setup()
states_.push_back(EINA_TRUE);
states_.push_back(EINA_FALSE);
states_.push_back(EINA_TRUE);
-
- return;
}
void setup()
window_.show();
control_.show();
- vector<Eina_Bool>::iterator it;
- for (it = states_.begin(); it != states_.end(); it++)
+ foreach (Eina_Bool state, states_)
{
queueCallback(
ModifyCheckCallback(
- boost::bind(elm_fileselector_button_folder_only_set, boost::ref(control_), *it),
- boost::bind(&FileselectorButtonFolderOnlyTest::checkFolderOnly, boost::ref(*this), *it)
+ boost::bind(elm_fileselector_button_folder_only_set, boost::ref(control_), state),
+ boost::bind(&FileselectorButtonFolderOnlyTest::checkFolderOnly, boost::ref(*this), state)
)
);
}
states_.push_back(EINA_TRUE);
states_.push_back(EINA_FALSE);
states_.push_back(EINA_TRUE);
-
- return;
}
void setup()
window_.show();
control_.show();
- vector<Eina_Bool>::iterator it;
- for (it = states_.begin(); it != states_.end(); it++)
+ foreach (Eina_Bool state, states_)
{
queueCallback(
ModifyCheckCallback(
- boost::bind(elm_fileselector_button_is_save_set, boost::ref(control_), *it),
- boost::bind(&FileselectorButtonIsSaveTest::checkIsSave, boost::ref(*this), *it)
+ boost::bind(elm_fileselector_button_is_save_set, boost::ref(control_), state),
+ boost::bind(&FileselectorButtonIsSaveTest::checkIsSave, boost::ref(*this), state)
)
);
}
states_.push_back(EINA_TRUE);
states_.push_back(EINA_FALSE);
states_.push_back(EINA_TRUE);
-
- return;
}
void setup()
window_.show();
control_.show();
- vector<Eina_Bool>::iterator it;
- for (it = states_.begin(); it != states_.end(); it++)
+ foreach (Eina_Bool state, states_)
{
queueCallback(
ModifyCheckCallback(
- boost::bind(elm_fileselector_button_inwin_mode_set, boost::ref(control_), *it),
- boost::bind(&FileselectorButtonInwinTest::checkInwin, boost::ref(*this), *it)
+ boost::bind(elm_fileselector_button_inwin_mode_set, boost::ref(control_), state),
+ boost::bind(&FileselectorButtonInwinTest::checkInwin, boost::ref(*this), state)
)
);
}
states_.push_back(EINA_TRUE);
states_.push_back(EINA_FALSE);
states_.push_back(EINA_TRUE);
-
- return;
}
void setup()
window_.show();
control_.show();
- vector<Eina_Bool>::iterator it;
- for (it = states_.begin(); it != states_.end(); it++)
+ foreach (Eina_Bool state, states_)
{
queueCallback(
ModifyCheckCallback(
- boost::bind(elm_fileselector_entry_expandable_set, boost::ref(control_), *it),
- boost::bind(&FileselectorEntryExpandableTest::checkExpandable, boost::ref(*this), *it)
+ boost::bind(elm_fileselector_entry_expandable_set, boost::ref(control_), state),
+ boost::bind(&FileselectorEntryExpandableTest::checkExpandable, boost::ref(*this), state)
)
);
}
states_.push_back(EINA_TRUE);
states_.push_back(EINA_FALSE);
states_.push_back(EINA_TRUE);
-
- return;
}
void setup()
window_.show();
control_.show();
- vector<Eina_Bool>::iterator it;
- for (it = states_.begin(); it != states_.end(); it++)
+ foreach (Eina_Bool state, states_)
{
queueCallback(
ModifyCheckCallback(
- boost::bind(elm_fileselector_entry_folder_only_set, boost::ref(control_), *it),
- boost::bind(&FileselectorEntryFolderOnlyTest::checkFolderOnly, boost::ref(*this), *it)
+ boost::bind(elm_fileselector_entry_folder_only_set, boost::ref(control_), state),
+ boost::bind(&FileselectorEntryFolderOnlyTest::checkFolderOnly, boost::ref(*this), state)
)
);
}
window_.show();
control_.show();
- vector<Eina_Bool>::iterator it;
- for (it = states_.begin(); it != states_.end(); it++)
+ foreach (Eina_Bool state, states_)
{
queueCallback(
ModifyCheckCallback(
- boost::bind(elm_fileselector_entry_is_save_set, boost::ref(control_), *it),
- boost::bind(&FileselectorEntryIsSaveTest::checkIsSave, boost::ref(*this), *it)
+ boost::bind(elm_fileselector_entry_is_save_set, boost::ref(control_), state),
+ boost::bind(&FileselectorEntryIsSaveTest::checkIsSave, boost::ref(*this), state)
)
);
}
window_.show();
control_.show();
- vector<Eina_Bool>::iterator it;
- for (it = states_.begin(); it != states_.end(); it++)
+ foreach (Eina_Bool state, states_)
{
queueCallback(
ModifyCheckCallback(
- boost::bind(elm_fileselector_entry_inwin_mode_set, boost::ref(control_), *it),
- boost::bind(&FileselectorEntryInwinTest::checkInwin, boost::ref(*this), *it)
+ boost::bind(elm_fileselector_entry_inwin_mode_set, boost::ref(control_), state),
+ boost::bind(&FileselectorEntryInwinTest::checkInwin, boost::ref(*this), state)
)
);
}
options_.push_back(ELM_FLIP_PAGE_RIGHT);
options_.push_back(ELM_FLIP_PAGE_UP);
options_.push_back(ELM_FLIP_PAGE_DOWN);
-
- return;
}
void setup()
second_.show();
window_.show();
- vector<Elm_Flip_Mode>::iterator it;
- for (it = options_.begin(); it != options_.end(); it++)
+ foreach (Elm_Flip_Mode option, options_)
{
queueCallback(
ModifyCheckCallback(
- boost::bind(elm_flip_go, boost::ref(control_), *it),
+ boost::bind(elm_flip_go, boost::ref(control_), option),
boost::bind(&FlipGoTest::checkFront, boost::ref(*this), EINA_TRUE)
)
);
queueCallback(
ModifyCheckCallback(
- boost::bind(elm_flip_go, boost::ref(control_), *it),
+ boost::bind(elm_flip_go, boost::ref(control_), option),
boost::bind(&FlipGoTest::checkFront, boost::ref(*this), EINA_FALSE)
)
);
void setup()
{
- vector<string>::iterator string_it;
- for (string_it = strings_.begin(); string_it != strings_.end(); string_it++)
+ Elm_Object_Item* pivot(
+ elm_flipselector_item_append(
+ control_, "PIVOT", NULL, NULL
+ )
+ );
+
+ BOOST_CHECK_NE(pivot, static_cast<Elm_Object_Item*>(NULL));
+
+ vector<Elm_Object_Item*> items;
+
+ foreach (const std::string& label, strings_)
{
- Elm_Object_Item* item = elm_flipselector_item_append(control_, string_it->c_str(), NULL, NULL);
- BOOST_CHECK_NE(item, (Elm_Object_Item*)NULL);
+ Elm_Object_Item* item = elm_flipselector_item_append(control_, label.c_str(), NULL, NULL);
+ BOOST_CHECK_NE(item, static_cast<Elm_Object_Item*>(NULL));
if (item != NULL)
{
- items_.push_back(item);
+ items.push_back(item);
}
}
control_.setSize(200, 200);
control_.setPosition(50, 10);
- vector<Elm_Object_Item*>::reverse_iterator item_it;
- for (item_it = items_.rbegin(); item_it != items_.rend(); item_it++)
+ foreach_reverse (Elm_Object_Item* item, items)
{
queueCallback(
ModifyCheckCallback(
- boost::bind(elm_flipselector_item_selected_set, boost::ref(*item_it), EINA_TRUE),
- boost::bind(&FlipSelectorItemTest::checkItem, boost::ref(*this), *item_it)
+ boost::bind(elm_flipselector_item_selected_set, item, EINA_TRUE),
+ boost::bind(&FlipSelectorItemTest::checkItem, boost::ref(*this), item, pivot, EINA_TRUE)
+ )
+ );
+ queueCallback(
+ ModifyCheckCallback(
+ boost::bind(elm_flipselector_item_selected_set, pivot, EINA_TRUE),
+ boost::bind(&FlipSelectorItemTest::checkItem, boost::ref(*this), item, pivot, EINA_FALSE)
+ )
+ );
+ queueCallback(
+ ModifyCheckCallback(
+ boost::bind(elm_flipselector_item_selected_set, item, EINA_TRUE),
+ boost::bind(&FlipSelectorItemTest::checkItem, boost::ref(*this), item, pivot, EINA_TRUE)
)
);
}
}
- void checkItem(const Elm_Object_Item* expected)
+ void checkItem(const Elm_Object_Item* item, const Elm_Object_Item* pivot, Eina_Bool expected)
{
- BOOST_CHECK_EQUAL(elm_flipselector_item_selected_get(expected), EINA_TRUE);
+ BOOST_CHECK_EQUAL(elm_flipselector_item_selected_get(item), expected);
+ BOOST_CHECK_EQUAL(elm_flipselector_item_selected_get(pivot), not expected);
}
private:
- Window window_;
- Flipselector control_;
- vector<string> strings_;
- vector<Elm_Object_Item*> items_;
-
+ Window window_;
+ Flipselector control_;
+ vector<string> strings_;
};
typedef ResizeObjectTest<Flipselector> FlipSelectorResizeTest;
BOOST_AUTO_TEST_SUITE(EFL)
- BOOST_AUTO_TEST_SUITE(FlipSelectorSuite)
+ BOOST_AUTO_TEST_SUITE(FlipSelector)
WAYLAND_ELM_HARNESS_TEST_CASE(FlipSelectorItemTest)
WAYLAND_ELM_HARNESS_TEST_CASE(FlipSelectorResizeTest)
#include <boost/foreach.hpp>
#define foreach BOOST_FOREACH
+#define foreach_reverse BOOST_REVERSE_FOREACH
#endif