// test_layout.cpp - ยง13.3.5 layout responsive #include "../tttest.hpp" #include "../ttgui.hpp" using namespace ttgui; static void checkNonNeg(Widget& w){ CHECK_GE(w.bounds.w,0); CHECK_GE(w.bounds.h,0); for(auto&c:w.children()) checkNonNeg(*c); } TEST_CASE("layout: HBox/VBox flex weights", "[layout][unit]"){ HBox h; h.bounds={0,0,40,3}; auto* a=h.emplace("A"); auto* b=h.emplace(1); b->flex=1; auto* c=h.emplace("C"); (void)a;(void)c; h.layout(); checkNonNeg(h); CHECK_GT(b->bounds.w,0); CHECK_GE(a->bounds.w,1); VBox v; v.bounds={0,0,20,10}; auto* x=v.emplace