MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / testFloatingWidthPolicy

Function testFloatingWidthPolicy

tests/container_widget_test.cpp:142–172  ·  view source on GitHub ↗

#3451: a width-capped applet (e.g. Antenna Genius, max 260) should have its cap lifted while floating so it fills the window instead of hugging the left edge, and have the cap restored when it docks back into the panel strip.

Source from the content-addressed store, hash-verified

140// cap lifted while floating so it fills the window instead of hugging the left
141// edge, and have the cap restored when it docks back into the panel strip.
142void testFloatingWidthPolicy()
143{
144 ContainerWidget c("id", "T");
145 auto* body = new QLabel("payload");
146 body->setMaximumWidth(260); // mimic a width-capped applet
147 c.setContent(body);
148
149 report("docked content keeps its width cap",
150 body->maximumWidth() == 260);
151
152 FloatingContainerWindow win;
153 win.takeContainer(&c);
154 report("floating content cap is lifted to fill the window",
155 body->maximumWidth() == QWIDGETSIZE_MAX);
156
157 win.releaseContainer();
158 report("docked-again content cap is restored",
159 body->maximumWidth() == 260);
160
161 // An uncapped applet (e.g. the Amplifier) stays uncapped throughout.
162 ContainerWidget c2("id2", "T2");
163 auto* body2 = new QLabel("uncapped");
164 c2.setContent(body2);
165 FloatingContainerWindow win2;
166 win2.takeContainer(&c2);
167 report("uncapped content stays uncapped while floating",
168 body2->maximumWidth() == QWIDGETSIZE_MAX);
169 win2.releaseContainer();
170 report("uncapped content stays uncapped after docking",
171 body2->maximumWidth() == QWIDGETSIZE_MAX);
172}
173
174void testCloseSignal()
175{

Callers 1

mainFunction · 0.85

Calls 4

setContentMethod · 0.80
takeContainerMethod · 0.80
releaseContainerMethod · 0.80
reportFunction · 0.70

Tested by

no test coverage detected