diff options
author | lloyd <[email protected]> | 2014-01-07 11:34:48 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2014-01-07 11:34:48 +0000 |
commit | 83f69bcad312352b9d20fbfda183ddba62ed861e (patch) | |
tree | abdbeee5674803d0ef17b8a1d37c8b0e69ae553e /src/tests | |
parent | df4c2511fcabb0a669c7a04ea50867a9fe41d863 (diff) |
Cleanups
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/kat_bigint.cpp | 26 | ||||
-rw-r--r-- | src/tests/tests.h | 2 |
2 files changed, 26 insertions, 2 deletions
diff --git a/src/tests/kat_bigint.cpp b/src/tests/kat_bigint.cpp index c19b6cc23..fe63f8b85 100644 --- a/src/tests/kat_bigint.cpp +++ b/src/tests/kat_bigint.cpp @@ -22,6 +22,32 @@ using namespace Botan; namespace { +void strip_comments(std::string& line) + { + if(line.find('#') != std::string::npos) + line = line.erase(line.find('#'), std::string::npos); + } + +void strip_newlines(std::string& line) + { + while(line.find('\n') != std::string::npos) + line = line.erase(line.find('\n'), 1); + } + +/* Strip comments, whitespace, etc */ +void strip(std::string& line) + { + strip_comments(line); + +#if 0 + while(line.find(' ') != std::string::npos) + line = line.erase(line.find(' '), 1); +#endif + + while(line.find('\t') != std::string::npos) + line = line.erase(line.find('\t'), 1); + } + std::vector<std::string> parse(const std::string& line) { const char DELIMITER = ':'; diff --git a/src/tests/tests.h b/src/tests/tests.h index 1dec5ff28..494ce72a5 100644 --- a/src/tests/tests.h +++ b/src/tests/tests.h @@ -8,8 +8,6 @@ #include <string> #include <vector> -#include "../common.h" - size_t run_tests_bb(std::istream& src, const std::string& name_key, const std::string& output_key, |