summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndres Noetzli <andres.noetzli@gmail.com>2018-03-06 10:18:54 -0800
committerMathias Preiner <mathias.preiner@gmail.com>2018-03-06 10:18:54 -0800
commit3de3716f7196a5f34963d85c882837c449ecf676 (patch)
treeec265cc8ff82df819d8c6acf49902f2be9317b1b /test
parente2d714a0839fb80d9a40e9b6fdd8a6fe325a1664 (diff)
Remove printf from output utilities (#1629)
This commit removes the unused printf functions from the output utilities. It also adds `const` keywords where possible. Finally, it removes overloaded `const char*` functions if the same function existed for `const std::string&` and the `const char*` version was only casting the `const char*` to an `std::string`. This conversion happens implicitly, so the `const char*` version is not needed.
Diffstat (limited to 'test')
-rw-r--r--test/unit/util/output_black.h129
1 files changed, 0 insertions, 129 deletions
diff --git a/test/unit/util/output_black.h b/test/unit/util/output_black.h
index 95075d725..64d648bcd 100644
--- a/test/unit/util/output_black.h
+++ b/test/unit/util/output_black.h
@@ -105,118 +105,6 @@ public:
#endif /* CVC4_MUZZLE */
}
- void testPrintf() {
-
-#ifdef CVC4_MUZZLE
-
- Debug.off("yo");
- Debug.printf("yo", "hello %s", "world");
- TS_ASSERT_EQUALS(d_debugStream.str(), string());
- d_debugStream.str("");
- Debug.printf(string("yo"), "hello %s", "world");
- TS_ASSERT_EQUALS(d_debugStream.str(), string());
- d_debugStream.str("");
-
- Debug.on("yo");
- Debug.printf("yo", "hello %s", "world");
- TS_ASSERT_EQUALS(d_debugStream.str(), string());
- d_debugStream.str("");
- Debug.printf(string("yo"), "hello %s", "world");
- TS_ASSERT_EQUALS(d_debugStream.str(), string());
- d_debugStream.str("");
-
- Trace.off("yo");
- Trace.printf("yo", "hello %s", "world");
- TS_ASSERT_EQUALS(d_traceStream.str(), string());
- d_traceStream.str("");
- Trace.printf(string("yo"), "hello %s", "world");
- TS_ASSERT_EQUALS(d_traceStream.str(), string());
- d_traceStream.str("");
-
- Trace.on("yo");
- Trace.printf("yo", "hello %s", "world");
- TS_ASSERT_EQUALS(d_traceStream.str(), string());
- d_traceStream.str("");
- Trace.printf(string("yo"), "hello %s", "world");
- TS_ASSERT_EQUALS(d_traceStream.str(), string());
-
- Warning.printf("hello %s", "world");
- TS_ASSERT_EQUALS(d_warningStream.str(), string());
-
- Chat.printf("hello %s", "world");
- TS_ASSERT_EQUALS(d_chatStream.str(), string());
-
- Message.printf("hello %s", "world");
- TS_ASSERT_EQUALS(d_messageStream.str(), string());
-
- Notice.printf("hello %s", "world");
- TS_ASSERT_EQUALS(d_noticeStream.str(), string());
-
-#else /* CVC4_MUZZLE */
-
- Debug.off("yo");
- Debug.printf("yo", "hello %s", "world");
- TS_ASSERT_EQUALS(d_debugStream.str(), string());
- d_debugStream.str("");
- Debug.printf(string("yo"), "hello %s", "world");
- TS_ASSERT_EQUALS(d_debugStream.str(), string());
- d_debugStream.str("");
-
- Debug.on("yo");
- Debug.printf("yo", "hello %s", "world");
-#ifdef CVC4_DEBUG
- TS_ASSERT_EQUALS(d_debugStream.str(), string("hello world"));
-#else /* CVC4_DEBUG */
- TS_ASSERT_EQUALS(d_debugStream.str(), string());
-#endif /* CVC4_DEBUG */
- d_debugStream.str("");
- Debug.printf(string("yo"), "hello %s", "world");
-#ifdef CVC4_DEBUG
- TS_ASSERT_EQUALS(d_debugStream.str(), string("hello world"));
-#else /* CVC4_DEBUG */
- TS_ASSERT_EQUALS(d_debugStream.str(), string());
-#endif /* CVC4_DEBUG */
- d_debugStream.str("");
-
- Trace.off("yo");
- Trace.printf("yo", "hello %s", "world");
- TS_ASSERT_EQUALS(d_traceStream.str(), string());
- d_traceStream.str("");
- Trace.printf(string("yo"), "hello %s", "world");
- TS_ASSERT_EQUALS(d_traceStream.str(), string());
- d_traceStream.str("");
-
- Trace.on("yo");
- Trace.printf("yo", "hello %s", "world");
-#ifdef CVC4_TRACING
- TS_ASSERT_EQUALS(d_traceStream.str(), string("hello world"));
-#else /* CVC4_TRACING */
- TS_ASSERT_EQUALS(d_traceStream.str(), string());
-#endif /* CVC4_TRACING */
- d_traceStream.str("");
- Trace.printf(string("yo"), "hello %s", "world");
-#ifdef CVC4_TRACING
- TS_ASSERT_EQUALS(d_traceStream.str(), string("hello world"));
-#else /* CVC4_TRACING */
- TS_ASSERT_EQUALS(d_traceStream.str(), string());
-#endif /* CVC4_TRACING */
-
- Warning.printf("hello %s", "world");
- TS_ASSERT_EQUALS(d_warningStream.str(), string("hello world"));
-
- Chat.printf("hello %s", "world");
- TS_ASSERT_EQUALS(d_chatStream.str(), string("hello world"));
-
- Message.printf("hello %s", "world");
- TS_ASSERT_EQUALS(d_messageStream.str(), string("hello world"));
-
- Notice.printf("hello %s", "world");
- TS_ASSERT_EQUALS(d_noticeStream.str(), string("hello world"));
-
-#endif /* CVC4_MUZZLE */
-
- }
-
static int failure() {
// this represents an expensive function that should NOT be called
// when debugging/tracing is turned off
@@ -229,25 +117,21 @@ public:
#ifndef CVC4_DEBUG
TS_ASSERT( !( Debug.isOn("foo") ) );
Debug("foo") << failure() << endl;
- Debug.printf("foo", "%d\n", failure());
#else /* ! CVC4_DEBUG */
TS_ASSERT( Debug.isOn("foo") );
#endif /* ! CVC4_DEBUG */
Debug.off("foo");
//Debug("foo") << failure() << endl;
- //Debug.printf("foo", "%d\n", failure());
Trace.on("foo");
#ifndef CVC4_TRACING
TS_ASSERT( !( Trace.isOn("foo") ) );
Trace("foo") << failure() << endl;
- Trace.printf("foo", "%d\n", failure());
#else /* ! CVC4_TRACING */
TS_ASSERT( Trace.isOn("foo") );
#endif /* ! CVC4_TRACING */
Trace.off("foo");
//Trace("foo") << failure() << endl;
- //Trace.printf("foo", "%d\n", failure());
#ifdef CVC4_MUZZLE
TS_ASSERT( !( Debug.isOn("foo") ) );
@@ -269,19 +153,6 @@ public:
Notice() << failure() << endl;
cout << "chat" << std::endl;
Chat() << failure() << endl;
-
- cout << "debug:printf" << std::endl;
- Debug.printf("foo", "%d\n", failure());
- cout << "trace:printf" << std::endl;
- Trace.printf("foo", "%d\n", failure());
- cout << "warning:printf" << std::endl;
- Warning.printf("%d\n", failure());
- cout << "message:printf" << std::endl;
- Message.printf("%d\n", failure());
- cout << "notice:printf" << std::endl;
- Notice.printf("%d\n", failure());
- cout << "chat:printf" << std::endl;
- Chat.printf("%d\n", failure());
#endif /* CVC4_MUZZLE */
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback