15 #define GETTEXT_DOMAIN "wesnoth-lib"
17 #include <boost/test/unit_test.hpp>
44 "At '0'. Iterate widget: reached the end. Iterate grid: failed. "
45 "Iterate child: proceed. Down and visit '1'.\n"
46 "At '1'. Iterate widget: reached the end. Iterate grid: failed. "
47 "Iterate child: proceed. Down and visit '5'.\n"
48 "At '5'. Iterate widget: reached the end. Iterate grid: failed. "
49 "Iterate child: reached the end. Up widget '5'. "
50 "Iterate: reached '6'. Down and visit '6'.\n"
51 "At '6'. Iterate widget: reached the end. Iterate grid: failed. "
52 "Iterate child: reached the end. Up widget '6'. "
53 "Iterate: reached '7'. Down and visit '7'.\n"
54 "At '7'. Iterate widget: reached the end. Iterate grid: failed. "
55 "Iterate child: reached the end. Up widget '7'. "
56 "Iterate: reached '8'. Down and visit '8'.\n"
57 "At '8'. Iterate widget: reached the end. Iterate grid: failed. "
58 "Iterate child: reached the end. Up widget '8'. "
59 "Iterate: failed. Up widget '1'. "
60 "Iterate: reached '2'. Down and visit '2'.\n"
61 "At '2'. Iterate widget: reached the end. Iterate grid: failed. "
62 "Iterate child: reached the end. Up widget '2'. "
63 "Iterate: reached '3'. Down and visit '3'.\n"
64 "At '3'. Iterate widget: reached the end. Iterate grid: failed. "
65 "Iterate child: reached the end. Up widget '3'. "
66 "Iterate: reached '4'. Down and visit '4'.\n"
67 "At '4'. Iterate widget: reached the end. Iterate grid: failed. "
68 "Iterate child: reached the end. Up widget '4'. "
69 "Iterate: failed. Finished iteration.\n";
77 "Constructor: Down widget '1'. Down widget '5'. Finished at '5'.\n"
78 "At '5'. Iterate widget: reached the end. Iterate grid: failed. "
79 "Iterate child: Up '1'. Iterate child: visit '1'. "
80 "Down widget '6'. Visit '6'.\n"
81 "At '6'. Iterate widget: reached the end. Iterate grid: failed. "
82 "Iterate child: Up '1'. Iterate child: visit '1'. "
83 "Down widget '7'. Visit '7'.\n"
84 "At '7'. Iterate widget: reached the end. Iterate grid: failed. "
85 "Iterate child: Up '1'. Iterate child: visit '1'. "
86 "Down widget '8'. Visit '8'.\n"
87 "At '8'. Iterate widget: reached the end. Iterate grid: failed. "
88 "Iterate child: Up '1'. Iterate child: reached the end. Visit '1'.\n"
89 "At '1'. Iterate widget: reached the end. Iterate grid: failed. "
90 "Iterate child: Up '0'. Iterate child: visit '0'. "
91 "Down widget '2'. Visit '2'.\n"
92 "At '2'. Iterate widget: reached the end. Iterate grid: failed. "
93 "Iterate child: Up '0'. Iterate child: visit '0'. "
94 "Down widget '3'. Visit '3'.\n"
95 "At '3'. Iterate widget: reached the end. Iterate grid: failed. "
96 "Iterate child: Up '0'. Iterate child: visit '0'. "
97 "Down widget '4'. Visit '4'.\n"
98 "At '4'. Iterate widget: reached the end. Iterate grid: failed. "
99 "Iterate child: Up '0'. Iterate child: reached the end. Visit '0'.\n"
100 "At '0'. Iterate widget: reached the end. Iterate grid: failed. "
101 "Iterate child: Finished iteration.\n";
112 BOOST_REQUIRE_NE(widget, static_cast<gui2::twidget*>(
nullptr));
137 BOOST_CHECK_EQUAL(iterator.at_end(),
false);
139 BOOST_CHECK_EQUAL(&*iterator, &control);
143 BOOST_CHECK_EQUAL(iterator.next(),
false);
145 BOOST_CHECK_EQUAL(iterator.at_end(),
true);
157 BOOST_CHECK_EQUAL(iterator.at_end(),
true);
162 BOOST_CHECK_EQUAL(iterator.
at_end(),
false);
166 BOOST_CHECK_EQUAL(iterator.
at_end(),
true);
173 test_control<gui2::tlabel>();
180 test_control<gui2::tgrid>();
198 std::stringstream sstr;
207 while(iterator.next()) {
214 std::stringstream sstr;
223 for( ; !iterator.at_end(); ++
iterator) {
230 std::stringstream sstr;
239 while(iterator.next()) {
246 std::stringstream sstr;
255 for( ; !iterator.at_end(); ++
iterator) {
275 std::stringstream sstr;
static config_cache & instance()
Get reference to the singleton object.
static const unsigned VERTICAL_GROW_SEND_TO_CLIENT
static const unsigned HORIZONTAL_GROW_SEND_TO_CLIENT
static void test_control()
bool set_log_domain_severity(std::string const &name, int severity)
static void add_widget(gui2::tgrid &grid, gui2::twidget *widget, const std::string &id, const unsigned row, const unsigned column)
Contains the base iterator class for the gui2 widgets.
static std::string top_down_t_t_t_result()
GLenum GLenum GLvoid GLvoid * column
void clear_defines()
Clear stored defines map to default values.
GLenum GLenum GLvoid * row
static std::string bottom_up_t_t_t_result()
BOOST_AUTO_TEST_CASE(test_gui2_iterator)
void set_child(twidget *widget, const unsigned row, const unsigned col, const unsigned flags, const unsigned border_size)
Sets a child in the grid.
Helper class to redirect the output of the logger in a certain scope.
void add_define(const std::string &define)
Add a entry to preproc defines map.
GLsizei const GLcharARB ** string
bool at_end() const
Has the iterator reached the end?
Singleton class to manage game config file caching.