summaryrefslogtreecommitdiff
path: root/net/xmlrpc-c-devel/files/patch-src::cpptest.cc
blob: 67395f125644c8e8b14dbf08cdffdf9b01e7874e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
--- src/cpptest.cc.orig	Wed May  2 00:26:13 2001
+++ src/cpptest.cc	Tue Mar  2 23:39:39 2004
@@ -28,15 +28,15 @@
 void test_failure (char* file, int line, char* statement)
 {
     total_failures++;
-    cout << endl
-	 << file << ":" << line << ": expected (" << statement << ")" << endl;
+    std::cout << std::endl
+	 << file << ":" << line << ": expected (" << statement << ")" << std::endl;
 }
 
 #define TEST(statement) \
     do { \
         total_tests++; \
         if ((statement)) { \
-            cout << "."; \
+            std::cout << "."; \
 	} else { \
             test_failure(__FILE__, __LINE__, #statement); \
         } \
@@ -45,7 +45,7 @@
 #define TEST_PASSED() \
     do { \
         total_tests++; \
-        cout << "."; \
+        std::cout << "."; \
     } while (0)
 
 #define TEST_FAILED(reason) \
@@ -187,7 +187,7 @@
     TEST(XmlRpcValue::makeString("foo").getString() == "foo");
     TEST(XmlRpcValue::makeString("bar", 3).getString() == "bar");
     TEST(XmlRpcValue::makeString("bar", 3).getString() == "bar");
-    TEST(XmlRpcValue::makeString("a\0b").getString() == string("a\0b"));
+    TEST(XmlRpcValue::makeString("a\0b").getString() == std::string("a\0b"));
     XmlRpcValue::makeArray().getArray();
     XmlRpcValue::makeStruct().getStruct();
 
@@ -219,7 +219,7 @@
     TEST(strct.structHasKey("bar"));
     TEST(!strct.structHasKey("nosuch"));
     for (size_t i = 0; i < strct.structSize(); i++) {
-	string key;
+	std::string key;
 	XmlRpcValue value;
 	strct.structGetKeyAndValue(i, key, value);
 	TEST(key + "val" == value.getString());
@@ -248,30 +248,30 @@
 	test_errors();
 
     } catch (XmlRpcFault& fault) {
-	cout << "Unexpected XML-RPC fault when running test suites." << endl
+	std::cout << "Unexpected XML-RPC fault when running test suites." << std::endl
 	     << "Fault #" << fault.getFaultCode()
-	     << ": " << fault.getFaultString() << endl
-	     << "FAILED" << endl;
+	     << ": " << fault.getFaultString() << std::endl
+	     << "FAILED" << std::endl;
 	exit(1);
     } catch (...) {
-	cout << "Unexpected exception when running test suites." << endl
-	     << "FAILED" << endl;
+	std::cout << "Unexpected exception when running test suites." << std::endl
+	     << "FAILED" << std::endl;
 	exit(1);
     }
 
     // Summarize our test run.
-    cout << endl << "Ran " << total_tests << " tests, "
+    std::cout << std::endl << "Ran " << total_tests << " tests, "
 	 << total_failures << " failed, "
-	 << setprecision(4)
+	 << std::setprecision(4)
 	 << (100.0 - (100.0 * total_failures) / total_tests)
-	 << "% passed" << endl;
+	 << "% passed" << std::endl;
 
     // Print the final result.
     if (total_failures == 0) {
-	cout << "OK" << endl;
+	std::cout << "OK" << std::endl;
 	return 0;
     }
 
-    cout << "FAILED" << endl;
+    std::cout << "FAILED" << std::endl;
     return 1;
 }