aboutsummaryrefslogtreecommitdiff
path: root/src/univalue/test/unitester.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/univalue/test/unitester.cpp')
-rw-r--r--src/univalue/test/unitester.cpp15
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;
}