From 7bb4001e9a74ae057bc9ccba1db7a7cf5583730f Mon Sep 17 00:00:00 2001 From: Aaron Date: Thu, 11 Dec 2008 15:27:51 -0500 Subject: [PATCH] Change arg ordering for ASSERT_EQUALS to match current unittest library spec (an earlier version of the library used the reverse arg order) --- dbtests/btreetests.cpp | 6 +++--- dbtests/indexdetailstests.cpp | 28 ++++++++++++++-------------- dbtests/pairingtests.cpp | 10 +++++----- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/dbtests/btreetests.cpp b/dbtests/btreetests.cpp index 214e3a059a0..e2a71b38db2 100644 --- a/dbtests/btreetests.cpp +++ b/dbtests/btreetests.cpp @@ -55,7 +55,7 @@ namespace BtreeTests { ASSERT( bt() ); ASSERT( bt()->isHead() ); bt()->assertValid( true ); - ASSERT_EQUALS( bt()->fullValidate( dl() ), nKeys ); + ASSERT_EQUALS( nKeys, bt()->fullValidate( dl() ) ); } void insert( BSONObj &key ) { bt()->insert( dl(), recordLoc(), key, true, id(), true ); @@ -76,9 +76,9 @@ namespace BtreeTests { bool found; DiskLoc location = bt()->locate( dl(), key, pos, found, recordLoc(), direction ); - ASSERT_EQUALS( found, expectedFound ); + ASSERT_EQUALS( expectedFound, found ); ASSERT( location == expectedLocation ); - ASSERT_EQUALS( pos, expectedPos ); + ASSERT_EQUALS( expectedPos, pos ); } private: IndexDetails idx_; diff --git a/dbtests/indexdetailstests.cpp b/dbtests/indexdetailstests.cpp index 0f3436acd40..00218e78c68 100644 --- a/dbtests/indexdetailstests.cpp +++ b/dbtests/indexdetailstests.cpp @@ -68,8 +68,8 @@ namespace NamespaceTests { class Create : public Base { public: void run() { - ASSERT_EQUALS( id().indexName(), "testIndex" ); - ASSERT_EQUALS( id().parentNS(), ns() ); + ASSERT_EQUALS( "testIndex", id().indexName() ); + ASSERT_EQUALS( ns(), id().parentNS() ); // check equal ASSERT( !id().keyPattern().woCompare( key() ) ); } @@ -84,7 +84,7 @@ namespace NamespaceTests { e.append( "a", 5 ); set< BSONObj > keys; id().getKeysFromObject( b.done(), keys ); - ASSERT_EQUALS( keys.size(), 1 ); + ASSERT_EQUALS( 1, keys.size() ); ASSERT( !keys.begin()->woCompare( e.done() ) ); } }; @@ -99,12 +99,12 @@ namespace NamespaceTests { a.append( "c", "foo" ); set< BSONObj > keys; id().getKeysFromObject( a.done(), keys ); - ASSERT_EQUALS( keys.size(), 1 ); + ASSERT_EQUALS( 1, keys.size() ); // FIXME Why doesn't woCompare expand sub elements? // ASSERT( !keys.begin()->woCompare( e.done() ) ); - ASSERT_EQUALS( keys.begin()->firstElement().fieldName(), string( "a" ) ); - ASSERT_EQUALS( keys.begin()->firstElement().embeddedObject().firstElement().fieldName(), string( "b" ) ); - ASSERT_EQUALS( keys.begin()->firstElement().embeddedObject().firstElement().number(), 4 ); + ASSERT_EQUALS( string( "a" ), keys.begin()->firstElement().fieldName() ); + ASSERT_EQUALS( string( "b" ), keys.begin()->firstElement().embeddedObject().firstElement().fieldName() ); + ASSERT_EQUALS( 4, keys.begin()->firstElement().embeddedObject().firstElement().number() ); } private: virtual BSONObj key() const { return aDotB(); } @@ -122,11 +122,11 @@ namespace NamespaceTests { set< BSONObj > keys; id().getKeysFromObject( b.done(), keys ); - ASSERT_EQUALS( keys.size(), 3 ); + ASSERT_EQUALS( 3, keys.size() ); int j = 1; for( set< BSONObj >::iterator i = keys.begin(); i != keys.end(); ++i, ++j ) { - ASSERT_EQUALS( i->firstElement().fieldName(), string( "a" ) ); - ASSERT_EQUALS( i->firstElement().number(), j ); + ASSERT_EQUALS( string( "a" ), i->firstElement().fieldName() ); + ASSERT_EQUALS( j, i->firstElement().number() ); } } }; @@ -145,12 +145,12 @@ namespace NamespaceTests { set< BSONObj > keys; id().getKeysFromObject( c.done(), keys ); - ASSERT_EQUALS( keys.size(), 3 ); + ASSERT_EQUALS( 3, keys.size() ); int j = 1; for( set< BSONObj >::iterator i = keys.begin(); i != keys.end(); ++i, ++j ) { - ASSERT_EQUALS( i->firstElement().fieldName(), string( "a" ) ); - ASSERT_EQUALS( i->firstElement().embeddedObject().firstElement().fieldName(), string( "a" ) ); - ASSERT_EQUALS( i->firstElement().embeddedObject().firstElement().number(), j ); + ASSERT_EQUALS( string( "a" ), i->firstElement().fieldName() ); + ASSERT_EQUALS( string( "a" ), i->firstElement().embeddedObject().firstElement().fieldName() ); + ASSERT_EQUALS( j, i->firstElement().embeddedObject().firstElement().number() ); } } private: diff --git a/dbtests/pairingtests.cpp b/dbtests/pairingtests.cpp index 69d62be31fa..557115c4614 100644 --- a/dbtests/pairingtests.cpp +++ b/dbtests/pairingtests.cpp @@ -56,10 +56,10 @@ namespace PairingTests { int remotePort, const string &arbHost ) { ASSERT( rp.state == ReplPair::State_Negotiating ); - ASSERT_EQUALS( rp.remote, remote ); - ASSERT_EQUALS( rp.remoteHost, remoteHost ); - ASSERT_EQUALS( rp.remotePort, remotePort ); - ASSERT_EQUALS( rp.arbHost, arbHost ); + ASSERT_EQUALS( remote, rp.remote ); + ASSERT_EQUALS( remoteHost, rp.remoteHost ); + ASSERT_EQUALS( remotePort, rp.remotePort ); + ASSERT_EQUALS( arbHost, rp.arbHost ); } }; @@ -87,7 +87,7 @@ namespace PairingTests { ReplPair rp( "a", "b" ); rp.setMaster( ReplPair::State_CantArb, "foo" ); ASSERT( rp.state == ReplPair::State_CantArb ); - ASSERT_EQUALS( rp.info, "foo" ); + ASSERT_EQUALS( "foo", rp.info ); rp.setMaster( ReplPair::State_Confused, "foo" ); ASSERT( rp.state == ReplPair::State_Confused ); }