mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-27 06:01:14 +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.
20 lines
584 B
C++
20 lines
584 B
C++
#include "Test.hpp"
|
|
|
|
TEST(UI_slider, to_from_json)
|
|
{
|
|
UI_slider slider("slider_text", Color(255, 255, 255), Color(0, 0, 0), 0, 100, 50, nullptr);
|
|
json j = slider.to_json(0);
|
|
UI_slider slider2;
|
|
slider2.from_json(j);
|
|
EXPECT_EQ(slider.text(), slider2.text());
|
|
EXPECT_EQ(slider.fg_color(), slider2.fg_color());
|
|
EXPECT_EQ(slider.bg_color(), slider2.bg_color());
|
|
EXPECT_EQ(slider.value(), slider2.value());
|
|
}
|
|
|
|
TEST(UI_slider, value)
|
|
{
|
|
UI_slider slider("slider_text", Color(255, 255, 255), Color(0, 0, 0), 0, 100, 50);
|
|
EXPECT_EQ(slider.value(), 50);
|
|
}
|