From bc47e8418dc702a242dcc3b180ecfec69ac6556b Mon Sep 17 00:00:00 2001 From: Eric Milkie Date: Wed, 13 Mar 2013 07:58:07 -0400 Subject: SERVER-7772 move oplog into db/repl/ --- src/mongo/db/repl/optime.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/mongo/db/repl/optime.cpp') diff --git a/src/mongo/db/repl/optime.cpp b/src/mongo/db/repl/optime.cpp index 0f31d6c07b4..b993c62da9c 100644 --- a/src/mongo/db/repl/optime.cpp +++ b/src/mongo/db/repl/optime.cpp @@ -21,6 +21,7 @@ #include "mongo/bson/inline_decls.h" #include "mongo/util/debug_util.h" #include "mongo/util/log.h" +#include "mongo/util/startup_test.h" namespace mongo { @@ -80,4 +81,18 @@ namespace mongo { } } + struct TestOpTime : public StartupTest { + void run() { + OpTime t; + for ( int i = 0; i < 10; i++ ) { + OpTime s = OpTime::_now(); + verify( s != t ); + t = s; + } + OpTime q = t; + verify( q == t ); + verify( !(q != t) ); + } + } testoptime; + } -- cgit v1.2.1