diff options
author | MarcoFalke <falke.marco@gmail.com> | 2018-09-07 08:22:00 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2018-09-07 08:21:14 -0400 |
commit | faad55a9a24601aac47b5e3bc44827ddb41d8f93 (patch) | |
tree | 2608058e723256ed51a68b3048af1ae61b03d8ea /src/univalue/test/unitester.cpp | |
parent | 4799b0932a10c5a48706700a07899b33ef9c8bae (diff) | |
parent | dc287c98f8b33576f3c71db02a232106ef0e57d9 (diff) |
Update univalue subtree
Diffstat (limited to 'src/univalue/test/unitester.cpp')
-rw-r--r-- | src/univalue/test/unitester.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/univalue/test/unitester.cpp b/src/univalue/test/unitester.cpp index 2c37794a4b..75c0dc225a 100644 --- a/src/univalue/test/unitester.cpp +++ b/src/univalue/test/unitester.cpp @@ -17,8 +17,7 @@ #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) #endif -using namespace std; -string srcdir(JSON_TEST_SRC); +std::string srcdir(JSON_TEST_SRC); static bool test_failed = false; #define d_assert(expr) { if (!(expr)) { test_failed = true; fprintf(stderr, "%s failed\n", filename.c_str()); } } @@ -30,9 +29,9 @@ static std::string rtrim(std::string s) return s; } -static void runtest(string filename, const string& jdata) +static void runtest(std::string filename, const std::string& jdata) { - string prefix = filename.substr(0, 4); + std::string prefix = filename.substr(0, 4); bool wantPass = (prefix == "pass") || (prefix == "roun"); bool wantFail = (prefix == "fail"); @@ -56,19 +55,19 @@ static void runtest(string filename, const string& jdata) static void runtest_file(const char *filename_) { - string basename(filename_); - string filename = srcdir + "/" + basename; + std::string basename(filename_); + std::string filename = srcdir + "/" + basename; FILE *f = fopen(filename.c_str(), "r"); assert(f != NULL); - string jdata; + std::string jdata; char buf[4096]; while (!feof(f)) { int bread = fread(buf, 1, sizeof(buf), f); assert(!ferror(f)); - string s(buf, bread); + std::string s(buf, bread); jdata += s; } |