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
-1
@@ -4,7 +4,8 @@ TEST(UI_led, to_from_json)
|
||||
{
|
||||
UI_led led("led_text", Color(0, 0, 0), Color(255, 255, 255));
|
||||
json j = led.to_json(0);
|
||||
UI_led led2(j);
|
||||
UI_led led2;
|
||||
led2.from_json(j);
|
||||
EXPECT_EQ(led.text(), led2.text());
|
||||
EXPECT_EQ(led.fg_color(), led2.fg_color());
|
||||
EXPECT_EQ(led.bg_color(), led2.bg_color());
|
||||
|
||||
Reference in New Issue
Block a user