MCPcopy Create free account
hub / github.com/Icinga/icinga2 / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

test/remote-configpackageutility.cpp:13–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11BOOST_AUTO_TEST_SUITE(remote_configpackageutility)
12
13BOOST_AUTO_TEST_CASE(ValidateName)
14{
15 std::vector<std::string> validNames {"foo", "foo-bar", "FooBar", "Foo123", "_Foo-", "123bar"};
16 for (const std::string& n : validNames) {
17 BOOST_CHECK_MESSAGE(ConfigPackageUtility::ValidatePackageName(n), "'" << n << "' should be valid");
18 }
19
20 std::vector<std::string> invalidNames {"", ".", "..", "foo.bar", "foo/../bar", "foo/bar", "foo:bar"};
21 for (const std::string& n : invalidNames) {
22 BOOST_CHECK_MESSAGE(!ConfigPackageUtility::ValidatePackageName(n), "'" << n << "' should not be valid");
23 }
24}
25
26BOOST_AUTO_TEST_SUITE_END()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected