From 06ec5ef5939ead876c0056e76fbbeebeb4878029 Mon Sep 17 00:00:00 2001 From: Joao Eduardo Luis Date: Tue, 26 Aug 2014 21:20:51 +0100 Subject: [PATCH] test: common: test_config: whitelist '$channel' meta-variable Signed-off-by: Joao Eduardo Luis --- src/test/common/test_config.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/test/common/test_config.cc b/src/test/common/test_config.cc index cffdc763d711..5f3bc3f3674e 100644 --- a/src/test/common/test_config.cc +++ b/src/test/common/test_config.cc @@ -131,8 +131,16 @@ public: config_option *opt = config_optionsp + i; if (opt->type == OPT_STR) { std::string *str = (std::string *)opt->conf_ptr(this); - if (str->find("$") != string::npos) - after_count++; + + size_t pos = 0; + while ((pos = str->find("$", pos)) != string::npos) { + if (str->substr(pos, 8) != "$channel") { + std::cout << "unexpected meta-variable found at pos " << pos + << " of '" << *str << "'" << std::endl; + after_count++; + } + pos++; + } } } ASSERT_EQ(0, after_count); -- 2.47.3