From 47533c3b3dcd3e0c82dab4fa0327cd132858e6ee Mon Sep 17 00:00:00 2001 From: Sander Speetjens Date: Mon, 26 Aug 2024 14:59:25 +0200 Subject: [PATCH] Tests fix tests --- tests/UI_button.cpp | 2 -- tests/UI_item.cpp | 6 ++++-- tests/UI_label.cpp | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/UI_button.cpp b/tests/UI_button.cpp index bab5804..f5046b0 100644 --- a/tests/UI_button.cpp +++ b/tests/UI_button.cpp @@ -9,8 +9,6 @@ TEST(UI_button, to_from_json) EXPECT_EQ(button.text(), button2.text()); EXPECT_EQ(button.fg_color(), button2.fg_color()); EXPECT_EQ(button.bg_color(), button2.bg_color()); - - std::cout << j.dump(4) << std::endl; } void on_click(std::string id) diff --git a/tests/UI_item.cpp b/tests/UI_item.cpp index 4b6b2b3..ec947a4 100644 --- a/tests/UI_item.cpp +++ b/tests/UI_item.cpp @@ -49,8 +49,10 @@ TEST(UI_item, from_json) j["id"] = "item_id"; j["text"] = "item_text"; j["text_size"] = 12; - j["fg_color"] = "0xFFFFFF00"; - j["bg_color"] = "0x00000000"; + j["fg_color"] = "0xFFFFFFFF"; + j["bg_color"] = "0x000000FF"; + j["enabled"] = true; + j["visible"] = true; item.from_json(j); EXPECT_EQ(item.id(), "item_id"); diff --git a/tests/UI_label.cpp b/tests/UI_label.cpp index 5ede9b5..df4074a 100644 --- a/tests/UI_label.cpp +++ b/tests/UI_label.cpp @@ -4,12 +4,12 @@ TEST(UI_label, to_from_json) { UI_label label(std::string("label"), std::string("label_text"), Color(0, 0, 0), Color(255, 255, 255)); json j = label.to_json(); - EXPECT_EQ(j["type"], "UIlabel"); + EXPECT_EQ(j["type"], "UI_label"); EXPECT_EQ(j["id"], "label"); EXPECT_EQ(j["text"], "label_text"); EXPECT_EQ(j["text_size"], 12); - EXPECT_EQ(j["fg_color"], "0x00000000"); - EXPECT_EQ(j["bg_color"], "0xFFFFFF00"); + EXPECT_EQ(j["fg_color"], "#000000FF"); + EXPECT_EQ(j["bg_color"], "#FFFFFFFF"); UI_label label2(j); EXPECT_EQ(label2.id(), "label");