summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@mongodb.com>2014-08-19 13:17:29 -0400
committerSpencer T Brody <spencer@mongodb.com>2014-08-19 13:17:29 -0400
commitaa811c391648b83a338b7d86a961d1a72e70e86f (patch)
tree09d9447d94afd1ac37d386ae27ccaa3702ce0a8d
parent018b95b10a10cef1b2d1dc047a7b53282752a099 (diff)
downloadmongo-aa811c391648b83a338b7d86a961d1a72e70e86f.tar.gz
SERVER-14938 Remove string streaming operators from OpTime and Date_t
-rw-r--r--src/mongo/bson/optime.cpp3
-rw-r--r--src/mongo/bson/optime.h2
-rw-r--r--src/mongo/db/repl/repl_coordinator_impl_test.cpp12
-rw-r--r--src/mongo/db/repl/topology_coordinator_impl_test.cpp12
-rw-r--r--src/mongo/util/time_support.cpp4
-rw-r--r--src/mongo/util/time_support.h2
6 files changed, 24 insertions, 11 deletions
diff --git a/src/mongo/bson/optime.cpp b/src/mongo/bson/optime.cpp
index e81483acb88..b79750b5544 100644
--- a/src/mongo/bson/optime.cpp
+++ b/src/mongo/bson/optime.cpp
@@ -42,7 +42,4 @@ namespace mongo {
return OpTime(t, i);
}
- std::ostream& operator<<(std::ostream &s, const OpTime &ot) {
- return s << ot.toString();
- }
}
diff --git a/src/mongo/bson/optime.h b/src/mongo/bson/optime.h
index 015fedcc6a7..099520b6c41 100644
--- a/src/mongo/bson/optime.h
+++ b/src/mongo/bson/optime.h
@@ -144,6 +144,4 @@ namespace mongo {
};
#pragma pack()
- std::ostream& operator<<(std::ostream &s, const OpTime &ot);
-
} // namespace mongo
diff --git a/src/mongo/db/repl/repl_coordinator_impl_test.cpp b/src/mongo/db/repl/repl_coordinator_impl_test.cpp
index 2cd92d6493b..22635db16ca 100644
--- a/src/mongo/db/repl/repl_coordinator_impl_test.cpp
+++ b/src/mongo/db/repl/repl_coordinator_impl_test.cpp
@@ -50,6 +50,18 @@
#include "mongo/util/log.h"
namespace mongo {
+
+ // So that you can ASSERT_EQUALS two OpTimes
+ std::ostream& operator<<( std::ostream &s, const OpTime &ot ) {
+ s << ot.toString();
+ return s;
+ }
+ // So that you can ASSERT_EQUALS two Date_ts
+ std::ostream& operator<<( std::ostream &s, const Date_t &t ) {
+ s << t.toString();
+ return s;
+ }
+
namespace repl {
namespace {
diff --git a/src/mongo/db/repl/topology_coordinator_impl_test.cpp b/src/mongo/db/repl/topology_coordinator_impl_test.cpp
index a8ebb999163..b20bd59b595 100644
--- a/src/mongo/db/repl/topology_coordinator_impl_test.cpp
+++ b/src/mongo/db/repl/topology_coordinator_impl_test.cpp
@@ -36,6 +36,18 @@
#include "mongo/util/time_support.h"
namespace mongo {
+
+ // So that you can ASSERT_EQUALS two OpTimes
+ std::ostream& operator<<( std::ostream &s, const OpTime &ot ) {
+ s << ot.toString();
+ return s;
+ }
+ // So that you can ASSERT_EQUALS two Date_ts
+ std::ostream& operator<<( std::ostream &s, const Date_t &t ) {
+ s << t.toString();
+ return s;
+ }
+
namespace repl {
namespace {
diff --git a/src/mongo/util/time_support.cpp b/src/mongo/util/time_support.cpp
index 5f817414e0a..24686de267c 100644
--- a/src/mongo/util/time_support.cpp
+++ b/src/mongo/util/time_support.cpp
@@ -70,10 +70,6 @@ namespace mongo {
}
}
- std::ostream& operator<<(std::ostream &s, const Date_t &t) {
- return s << t.toString();
- }
-
// jsTime_virtual_skew is just for testing. a test command manipulates it.
long long jsTime_virtual_skew = 0;
boost::thread_specific_ptr<long long> jsTime_virtual_thread_skew;
diff --git a/src/mongo/util/time_support.h b/src/mongo/util/time_support.h
index c96a9793ac5..f7e62476eb8 100644
--- a/src/mongo/util/time_support.h
+++ b/src/mongo/util/time_support.h
@@ -64,8 +64,6 @@ namespace mongo {
bool isFormatable() const;
};
- std::ostream& operator<<(std::ostream &s, const Date_t &t);
-
// uses ISO 8601 dates without trailing Z
// colonsOk should be false when creating filenames
std::string terseCurrentTime(bool colonsOk=true);