MCPcopy Create free account
hub / github.com/baidu/babylon / SetUp

Method SetUp

test/anyflow/test_data.cpp:28–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26
27struct DataTest : public ::testing::Test {
28 virtual void SetUp() override {
29 auto creator = [] {
30 return ::std::unique_ptr<GraphProcessor>(new MockProcessor);
31 };
32 {
33 auto& vertex = builder.add_vertex(creator);
34 vertex.option(&mx);
35 vertex.named_depend("a").to("A");
36 vertex.named_emit("x").to("B");
37 }
38 {
39 auto& vertex = builder.add_vertex(creator);
40 vertex.option(&my);
41 vertex.named_depend("a").to("B");
42 vertex.named_emit("x").to("C");
43 }
44 {
45 auto& vertex = builder.add_vertex([] {
46 return ::std::unique_ptr<GraphProcessor>(new GraphProcessor);
47 });
48 vertex.anonymous_emit().to("D");
49 }
50 executor.initialize(4, 128);
51 builder.set_executor(executor);
52 ASSERT_EQ(0, builder.finish());
53 graph = builder.build();
54 ASSERT_TRUE(graph);
55
56 a = graph->find_data("A");
57 b = graph->find_data("B");
58 c = graph->find_data("C");
59 d = graph->find_data("D");
60 }
61
62 ThreadPoolGraphExecutor executor;
63 GraphBuilder builder;

Callers

nothing calls this directly

Calls 8

find_dataMethod · 0.80
optionMethod · 0.45
named_emitMethod · 0.45
anonymous_emitMethod · 0.45
initializeMethod · 0.45
set_executorMethod · 0.45
finishMethod · 0.45
buildMethod · 0.45

Tested by

no test coverage detected