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

Function testVectorFilter

Tests/CMakeLib/testJSONHelpers.cxx:346–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

344}
345
346bool testVectorFilter()
347{
348 Json::Value v(Json::arrayValue);
349 cmJSONState state;
350 v.append("Hello");
351 v.append("world!");
352 v.append("ignore");
353
354 std::vector<std::string> l{ "default" };
355 std::vector<std::string> expected{
356 "Hello",
357 "world!",
358 };
359 ASSERT_TRUE(StringVectorFilterHelper(l, &v, &state));
360 ASSERT_TRUE(l == expected);
361
362 v[1] = 2;
363 l = { "default" };
364 ASSERT_TRUE(!StringVectorFilterHelper(l, &v, &state));
365
366 v = "Hello";
367 l = { "default" };
368 ASSERT_TRUE(!StringVectorFilterHelper(l, &v, &state));
369
370 l = { "default" };
371 ASSERT_TRUE(StringVectorFilterHelper(l, nullptr, &state));
372 ASSERT_TRUE(l.empty());
373
374 return true;
375}
376
377bool testMap()
378{

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…