MCPcopy Create free account
hub / github.com/Kitware/CMake / testVector

Function testVector

Tests/CMakeLib/testJSONHelpers.cxx:318–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

316}
317
318bool testVector()
319{
320 Json::Value v(Json::arrayValue);
321 cmJSONState state;
322 v.append("Hello");
323 v.append("world!");
324 v.append("ignore");
325
326 std::vector<std::string> l{ "default" };
327 std::vector<std::string> expected{ "Hello", "world!", "ignore" };
328 ASSERT_TRUE(StringVectorHelper(l, &v, &state));
329 ASSERT_TRUE(l == expected);
330
331 v[1] = 2;
332 l = { "default" };
333 ASSERT_TRUE(!StringVectorHelper(l, &v, &state));
334
335 v = "Hello";
336 l = { "default" };
337 ASSERT_TRUE(!StringVectorHelper(l, &v, &state));
338
339 l = { "default" };
340 ASSERT_TRUE(StringVectorHelper(l, nullptr, &state));
341 ASSERT_TRUE(l.empty());
342
343 return true;
344}
345
346bool testVectorFilter()
347{

Callers

nothing calls this directly

Calls 2

appendMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…