mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
Squashed 'src/univalue/' changes from 51d3ab34ba..7890db99d6
7890db99d6 Merge #11: Remove deprecated std pair wrappers 40e34852ac Merge #14: Cleaned up namespace imports to reduce symbol collisions 85052a4819 Remove deprecated std::pair wrappers d208f986dd Cleaned up namespace imports to reduce symbol collisions git-subtree-dir: src/univalue git-subtree-split: 7890db99d693572d27ade3e14268bd7236134529
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user