mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-26 21:51:13 +01:00
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.
14 lines
393 B
C++
14 lines
393 B
C++
#include "Test.hpp"
|
|
#include <QObject>
|
|
|
|
TEST(UI_button, to_from_json)
|
|
{
|
|
UI_button button("button_text", Color(255, 255, 255), Color(0, 0, 0), nullptr);
|
|
json j = button.to_json(0);
|
|
UI_button button2;
|
|
button2.from_json(j);
|
|
EXPECT_EQ(button.text(), button2.text());
|
|
EXPECT_EQ(button.fg_color(), button2.fg_color());
|
|
EXPECT_EQ(button.bg_color(), button2.bg_color());
|
|
}
|