MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / TEST_F

Function TEST_F

tests/src/Gui/StyleParameters/ParameterManagerTest.cpp:67–97  ·  view source on GitHub ↗

Test basic parameter resolution

Source from the content-addressed store, hash-verified

65
66// Test basic parameter resolution
67TEST_F(ParameterManagerTest, BasicParameterResolution)
68{
69 {
70 auto result = manager.resolve("BaseSize");
71 EXPECT_TRUE(result.has_value());
72 EXPECT_TRUE(std::holds_alternative<Numeric>(*result));
73 auto length = std::get<Numeric>(*result);
74 EXPECT_DOUBLE_EQ(length.value, 16.0); // Should get value from source2 (later source)
75 EXPECT_EQ(length.unit, "px");
76 }
77
78 {
79 auto result = manager.resolve("PrimaryColor");
80 EXPECT_TRUE(result.has_value());
81 EXPECT_TRUE(std::holds_alternative<Base::Color>(*result));
82 auto color = std::get<Base::Color>(*result);
83 EXPECT_EQ(color.r, 1);
84 EXPECT_EQ(color.g, 0);
85 EXPECT_EQ(color.b, 0);
86 }
87
88 {
89 auto result = manager.resolve("SecondaryColor");
90 EXPECT_TRUE(result.has_value());
91 EXPECT_TRUE(std::holds_alternative<Base::Color>(*result));
92 auto color = std::get<Base::Color>(*result);
93 EXPECT_EQ(color.r, 0);
94 EXPECT_EQ(color.g, 1);
95 EXPECT_EQ(color.b, 0);
96 }
97}
98
99// Test parameter references
100TEST_F(ParameterManagerTest, ParameterReferences)

Callers

nothing calls this directly

Calls 15

has_valueMethod · 0.80
addSourceMethod · 0.80
sourcesMethod · 0.80
replacePlaceholdersMethod · 0.80
moveFunction · 0.50
QColorClass · 0.50
resolveMethod · 0.45
reloadMethod · 0.45
getMethod · 0.45
push_backMethod · 0.45
parametersMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected