MCPcopy Create free account
hub / github.com/AshampooSystems/boden / TEST

Function TEST

tests/boden/testContainerView.cpp:10–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8 using namespace bdn::ui;
9
10 TEST(ContainerView, childIndex)
11 {
12 bdn::App()->dispatchQueue()->dispatchSync([=]() {
13 const auto container = std::make_shared<ContainerView>();
14 const auto children = {std::make_shared<Button>(), std::make_shared<Button>(), std::make_shared<Button>()};
15
16 for (auto child : children) {
17 container->addChildView(child);
18 }
19
20 int i = 0;
21 for (auto it = children.begin(); it != children.end(); ++it, ++i) {
22 EXPECT_EQ(container->childIndex(*it), i);
23 }
24
25 container->removeAllChildViews();
26
27 for (auto it = children.begin(); it != children.end(); ++it) {
28 EXPECT_EQ(container->childIndex(*it), std::nullopt);
29 }
30 });
31 }
32}

Callers

nothing calls this directly

Calls 8

AppFunction · 0.85
dispatchSyncMethod · 0.80
dispatchQueueMethod · 0.80
childIndexMethod · 0.80
removeAllChildViewsMethod · 0.80
addChildViewMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected