diff options
author | Andrew Morrow <acm@mongodb.com> | 2017-02-14 15:33:01 -0500 |
---|---|---|
committer | Andrew Morrow <acm@mongodb.com> | 2017-02-27 23:42:02 -0500 |
commit | c780b434f538f72dab32a120a7950c1480a95d49 (patch) | |
tree | ac62ddbb3af1dc4d677b2211fa2eae541198d6e4 /src/mongo/db | |
parent | 9dfb28da2fbf9b1ba6b17ad873dde0db1863694f (diff) | |
download | mongo-c780b434f538f72dab32a120a7950c1480a95d49.tar.gz |
SERVER-27553 Remove print macro
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/commands/dbcommands.cpp | 7 | ||||
-rw-r--r-- | src/mongo/db/pipeline/document_value_test.cpp | 7 | ||||
-rw-r--r-- | src/mongo/db/sorter/sorter.cpp | 19 |
3 files changed, 8 insertions, 25 deletions
diff --git a/src/mongo/db/commands/dbcommands.cpp b/src/mongo/db/commands/dbcommands.cpp index b9e0fd07669..c536b367462 100644 --- a/src/mongo/db/commands/dbcommands.cpp +++ b/src/mongo/db/commands/dbcommands.cpp @@ -111,12 +111,10 @@ #include "mongo/util/fail_point_service.h" #include "mongo/util/log.h" #include "mongo/util/md5.hpp" -#include "mongo/util/print.h" #include "mongo/util/scopeguard.h" namespace mongo { -using std::endl; using std::ostringstream; using std::string; using std::stringstream; @@ -848,8 +846,9 @@ public: Query q(query); q.sort(sort); unique_ptr<DBClientCursor> c = client.query(ns, q); - while (c->more()) - PRINT(c->nextSafe()); + while (c->more()) { + log() << c->nextSafe(); + } } } cmdFileMD5; diff --git a/src/mongo/db/pipeline/document_value_test.cpp b/src/mongo/db/pipeline/document_value_test.cpp index bf6d3cca81d..92fd2f64067 100644 --- a/src/mongo/db/pipeline/document_value_test.cpp +++ b/src/mongo/db/pipeline/document_value_test.cpp @@ -39,11 +39,9 @@ #include "mongo/db/pipeline/value.h" #include "mongo/db/pipeline/value_comparator.h" #include "mongo/dbtests/dbtests.h" -#include "mongo/util/print.h" namespace DocumentTests { -using std::endl; using std::numeric_limits; using std::string; using std::vector; @@ -178,7 +176,7 @@ public: // Remove the second field. md.setField("b", Value()); - PRINT(md.peek().toString()); + log() << md.peek().toString(); ASSERT_EQUALS(2U, md.peek().size()); ASSERT(md.peek()["b"].missing()); ASSERT_EQUALS("a", getNthField(md.peek(), 0).first.toString()); @@ -1601,7 +1599,8 @@ private: assertComparison(expectedResult, fromBson(a), fromBson(b)); } void assertComparison(int expectedResult, const Value& a, const Value& b) { - mongo::unittest::log() << "testing " << a.toString() << " and " << b.toString() << endl; + mongo::unittest::log() << "testing " << a.toString() << " and " << b.toString(); + // reflexivity ASSERT_EQUALS(0, cmp(a, a)); ASSERT_EQUALS(0, cmp(b, b)); diff --git a/src/mongo/db/sorter/sorter.cpp b/src/mongo/db/sorter/sorter.cpp index 7f6e8866562..b15cb5cd980 100644 --- a/src/mongo/db/sorter/sorter.cpp +++ b/src/mongo/db/sorter/sorter.cpp @@ -63,7 +63,6 @@ #include "mongo/util/bufreader.h" #include "mongo/util/destructor_guard.h" #include "mongo/util/mongoutils/str.h" -#include "mongo/util/print.h" #include "mongo/util/unowned_ptr.h" namespace mongo { @@ -81,18 +80,6 @@ inline std::string myErrnoWithDescription() { } template <typename Data, typename Comparator> -void compIsntSane(const Comparator& comp, const Data& lhs, const Data& rhs) { - PRINT(typeid(comp).name()); - PRINT(lhs.first); - PRINT(lhs.second); - PRINT(rhs.first); - PRINT(rhs.second); - PRINT(comp(lhs, rhs)); - PRINT(comp(rhs, lhs)); - dassert(false); -} - -template <typename Data, typename Comparator> void dassertCompIsSane(const Comparator& comp, const Data& lhs, const Data& rhs) { #if defined(MONGO_CONFIG_DEBUG_BUILD) && !defined(_MSC_VER) // MSVC++ already does similar verification in debug mode in addition to using @@ -113,10 +100,8 @@ void dassertCompIsSane(const Comparator& comp, const Data& lhs, const Data& rhs) } // test reflexivity - if (!(comp(lhs, lhs) == 0)) - compIsntSane(comp, lhs, lhs); - if (!(comp(rhs, rhs) == 0)) - compIsntSane(comp, rhs, rhs); + invariant(comp(lhs, lhs) == 0); + invariant(comp(rhs, rhs) == 0); #endif } |