diff options
| author | Julio Merino <jmmv@FreeBSD.org> | 2013-11-15 21:28:06 +0000 |
|---|---|---|
| committer | Julio Merino <jmmv@FreeBSD.org> | 2013-11-15 21:28:06 +0000 |
| commit | b2b6e97c465e6ea7f9e9e631898d5ec26c65daa1 (patch) | |
| tree | e48e3dcbeca816c29ca712eac6c8f5b0e8bc07f0 /atf-c++/detail/test_helpers.cpp | |
| parent | f1e38e2131a6c87bafd2199650db07955c0386e0 (diff) | |
Diffstat (limited to 'atf-c++/detail/test_helpers.cpp')
| -rw-r--r-- | atf-c++/detail/test_helpers.cpp | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/atf-c++/detail/test_helpers.cpp b/atf-c++/detail/test_helpers.cpp index 42bd711dc7d6..191649d03d59 100644 --- a/atf-c++/detail/test_helpers.cpp +++ b/atf-c++/detail/test_helpers.cpp @@ -27,10 +27,6 @@ // IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -extern "C" { -#include <regex.h> -} - #include <fstream> #include <iostream> #include <string> @@ -88,43 +84,6 @@ get_process_helpers_path(const atf::tests::tc& tc) ".." / "atf-c" / "detail" / "process_helpers"; } -bool -grep_file(const char* name, const char* regex) -{ - std::ifstream is(name); - ATF_REQUIRE(is); - - bool found = false; - - std::string line; - std::getline(is, line); - while (!found && is.good()) { - if (grep_string(line, regex)) - found = true; - else - std::getline(is, line); - } - - return found; -} - -bool -grep_string(const std::string& str, const char* regex) -{ - int res; - regex_t preg; - - std::cout << "Looking for '" << regex << "' in '" << str << "'\n"; - ATF_REQUIRE(::regcomp(&preg, regex, REG_EXTENDED) == 0); - - res = ::regexec(&preg, str.c_str(), 0, NULL, 0); - ATF_REQUIRE(res == 0 || res == REG_NOMATCH); - - ::regfree(&preg); - - return res == 0; -} - void test_helpers_detail::check_equal(const char* expected[], const string_vector& actual) |
