mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 00:56:44 +01:00
Change arg ordering for ASSERT_EQUALS to match current unittest library spec (an earlier version of the library used the reverse arg order)
This commit is contained in:
parent
3ec2ba4d9d
commit
7bb4001e9a
@ -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_;
|
||||
|
@ -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:
|
||||
|
@ -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 );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user