mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-26 21:51:13 +01:00
Removes JSON constructor from UI elements
This fixes the error: clang:optin.cplusplus.VirtualCall When virtual methods are called during construction and destruction the polymorphism is restricted to the class that’s being constructed or destructed because the more derived contexts are either not yet initialized or already destructed.
This commit is contained in:
@@ -2,11 +2,12 @@
|
||||
|
||||
TEST(UI_combobox, to_from_json)
|
||||
{
|
||||
UI_combobox checkbox(Color(255, 255, 255), Color(0, 0, 0), {"option1", "option2"});
|
||||
json j = checkbox.to_json(0);
|
||||
UI_combobox checkbox2(j);
|
||||
EXPECT_EQ(checkbox.text(), checkbox2.text());
|
||||
EXPECT_EQ(checkbox.fg_color(), checkbox2.fg_color());
|
||||
EXPECT_EQ(checkbox.bg_color(), checkbox2.bg_color());
|
||||
EXPECT_EQ(checkbox.selected(), checkbox2.selected());
|
||||
UI_combobox combobox(Color(255, 255, 255), Color(0, 0, 0), {"option1", "option2"});
|
||||
json j = combobox.to_json(0);
|
||||
UI_combobox combobox2;
|
||||
combobox2.from_json(j);
|
||||
EXPECT_EQ(combobox.text(), combobox2.text());
|
||||
EXPECT_EQ(combobox.fg_color(), combobox2.fg_color());
|
||||
EXPECT_EQ(combobox.bg_color(), combobox2.bg_color());
|
||||
EXPECT_EQ(combobox.selected(), combobox2.selected());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user