2019-02-26 11:36:12 +08:00
|
|
|
|
#include "widgets/tab_button_group.h"
|
|
|
|
|
#include "gtest/gtest.h"
|
|
|
|
|
|
|
|
|
|
TEST(TabButtonGroup, cast) {
|
|
|
|
|
widget_t* w = tab_button_group_create(NULL, 10, 20, 30, 40);
|
|
|
|
|
|
|
|
|
|
ASSERT_EQ(w, tab_button_group_cast(w));
|
2019-07-11 09:11:35 +08:00
|
|
|
|
ASSERT_EQ(widget_get_prop_bool(w, WIDGET_PROP_COMPACT, FALSE), FALSE);
|
|
|
|
|
ASSERT_EQ(widget_get_prop_bool(w, WIDGET_PROP_SCROLLABLE, FALSE), FALSE);
|
|
|
|
|
|
|
|
|
|
ASSERT_EQ(widget_set_prop_bool(w, WIDGET_PROP_COMPACT, TRUE), FALSE);
|
|
|
|
|
ASSERT_EQ(widget_set_prop_bool(w, WIDGET_PROP_SCROLLABLE, TRUE), FALSE);
|
|
|
|
|
|
|
|
|
|
ASSERT_EQ(widget_get_prop_bool(w, WIDGET_PROP_COMPACT, FALSE), TRUE);
|
|
|
|
|
ASSERT_EQ(widget_get_prop_bool(w, WIDGET_PROP_SCROLLABLE, FALSE), TRUE);
|
2019-02-26 11:36:12 +08:00
|
|
|
|
|
|
|
|
|
widget_destroy(w);
|
2020-10-18 12:17:55 +08:00
|
|
|
|
idle_dispatch();
|
2019-02-26 11:36:12 +08:00
|
|
|
|
}
|