[Pkg-bitcoin-commits] [libunivalue] 07/76: unitester: tabs to spaces

Jonas Smedegaard dr at jones.dk
Mon Apr 4 09:18:27 UTC 2016


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository libunivalue.

commit be8a65de905c1fd06d300d7a43db7e3d135ff705
Author: Jeff Garzik <jgarzik at bitpay.com>
Date:   Thu Jun 12 19:52:20 2014 -0400

    unitester: tabs to spaces
---
 unitester.cpp | 88 +++++++++++++++++++++++++++++------------------------------
 1 file changed, 44 insertions(+), 44 deletions(-)

diff --git a/unitester.cpp b/unitester.cpp
index fe6f9f6..8f0b719 100644
--- a/unitester.cpp
+++ b/unitester.cpp
@@ -18,59 +18,59 @@ string srcdir(JSON_TEST_SRC);
 
 static void runtest(string filename, const string& jdata)
 {
-	fprintf(stderr, "test %s\n", filename.c_str());
-
-	string prefix = filename.substr(0, 4);
-
-	bool wantPass = (prefix == "pass");
-	bool wantFail = (prefix == "fail");
-	assert(wantPass || wantFail);
-
-	bool testResult = true;
-	try {
-	    UniValue val;
-	    val.read(jdata);
-	}
-	catch (std::exception& e) {
-	    string strPrint = string("error: ") + e.what();
-	    fprintf(stderr, "%s\n", strPrint.c_str());
-	    testResult = false;
-	}
-	catch (...) {
-	    string strPrint = string("unknown exception");
-	    fprintf(stderr, "%s\n", strPrint.c_str());
-	    testResult = false;
-	}
-
-	if (wantPass) {
-	    assert(testResult == true);
-	} else {
-	    assert(testResult == false);
-	}
+        fprintf(stderr, "test %s\n", filename.c_str());
+
+        string prefix = filename.substr(0, 4);
+
+        bool wantPass = (prefix == "pass");
+        bool wantFail = (prefix == "fail");
+        assert(wantPass || wantFail);
+
+        bool testResult = true;
+        try {
+            UniValue val;
+            val.read(jdata);
+        }
+        catch (std::exception& e) {
+            string strPrint = string("error: ") + e.what();
+            fprintf(stderr, "%s\n", strPrint.c_str());
+            testResult = false;
+        }
+        catch (...) {
+            string strPrint = string("unknown exception");
+            fprintf(stderr, "%s\n", strPrint.c_str());
+            testResult = false;
+        }
+
+        if (wantPass) {
+            assert(testResult == true);
+        } else {
+            assert(testResult == false);
+        }
 }
 
 static void runtest_file(const char *filename_)
 {
-	string basename(filename_);
-	string filename = srcdir + "/" + basename;
-	FILE *f = fopen(filename.c_str(), "r");
-	assert(f != NULL);
+        string basename(filename_);
+        string filename = srcdir + "/" + basename;
+        FILE *f = fopen(filename.c_str(), "r");
+        assert(f != NULL);
 
-	string jdata;
+        string jdata;
 
-	char buf[4096];
-	while (!feof(f)) {
-		int bread = fread(buf, 1, sizeof(buf), f);
-		assert(!ferror(f));
+        char buf[4096];
+        while (!feof(f)) {
+                int bread = fread(buf, 1, sizeof(buf), f);
+                assert(!ferror(f));
 
-		string s(buf, bread);
-		jdata += s;
-	}
+                string s(buf, bread);
+                jdata += s;
+        }
 
-	assert(!ferror(f));
-	fclose(f);
+        assert(!ferror(f));
+        fclose(f);
 
-	runtest(basename, jdata);
+        runtest(basename, jdata);
 }
 
 static const char *filenames[] = {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-bitcoin/libunivalue.git



More information about the Pkg-bitcoin-commits mailing list