MCPcopy Create free account
hub / github.com/PDAL/PDAL / TEST

Function TEST

test/unit/ProgramArgsTest.cpp:78–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78TEST(ProgramArgsTest, t1)
79{
80 ProgramArgs args;
81
82 std::string m_foo;
83
84 args.add("foo,f", "Foo description", m_foo, "foo");
85 StringList s = toStringList("--foo");
86 EXPECT_THROW(args.parse(s), arg_error);
87
88 s = toStringList("--foo=TestFoo");
89 args.reset();
90 args.parse(s);
91 EXPECT_EQ(m_foo, "TestFoo");
92
93 s = toStringList("--foo TestBar");
94 args.reset();
95 args.parse(s);
96 EXPECT_EQ(m_foo, "TestBar");
97
98 s = toStringList("-f");
99 args.reset();
100 EXPECT_THROW(args.parse(s), arg_error);
101
102 s = toStringList("-f -g");
103 args.reset();
104 EXPECT_THROW(args.parse(s), arg_error);
105
106 s = toStringList("-f Gah");
107 args.reset();
108 args.parse(s);
109 EXPECT_EQ(m_foo, "Gah");
110
111 s = toStringList("--foo=-Foo");
112 args.reset();
113 args.parse(s);
114 EXPECT_EQ(m_foo, "-Foo");
115}
116
117TEST(ProgramArgsTest, t2)
118{

Callers

nothing calls this directly

Calls 9

toStringListFunction · 0.85
parseJsonFunction · 0.85
addSynonymMethod · 0.80
parseSimpleMethod · 0.80
parseFunction · 0.50
addMethod · 0.45
parseMethod · 0.45
resetMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected