Skip to content

Commit

Permalink
Merge pull request #144 from newkedison/master
Browse files Browse the repository at this point in the history
Update benchmark_test.c for new function interface
  • Loading branch information
gjmurakami-10gen committed Jul 1, 2013
2 parents 0e9886c + a98aeca commit 8cc3df7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/benchmark_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,15 @@ static void index_insert_large_test( void ) {
static void batch_insert_small_test( void ) {
int i, j;
bson b[BATCH_SIZE];
bson *bp[BATCH_SIZE];
const bson *bp[BATCH_SIZE];
for ( j=0; j < BATCH_SIZE; j++ )
bp[j] = &b[j];

for ( i=0; i < ( PER_TRIAL / BATCH_SIZE ); i++ ) {
for ( j=0; j < BATCH_SIZE; j++ )
make_small( &b[j], i );

mongo_insert_batch( conn, DB ".batch.small", bp, BATCH_SIZE, NULL );
mongo_insert_batch( conn, DB ".batch.small", bp, BATCH_SIZE, NULL, 0 );

for ( j=0; j < BATCH_SIZE; j++ )
bson_destroy( &b[j] );
Expand All @@ -196,15 +196,15 @@ static void batch_insert_small_test( void ) {
static void batch_insert_medium_test( void ) {
int i, j;
bson b[BATCH_SIZE];
bson *bp[BATCH_SIZE];
const bson *bp[BATCH_SIZE];
for ( j=0; j < BATCH_SIZE; j++ )
bp[j] = &b[j];

for ( i=0; i < ( PER_TRIAL / BATCH_SIZE ); i++ ) {
for ( j=0; j < BATCH_SIZE; j++ )
make_medium( &b[j], i );

mongo_insert_batch( conn, DB ".batch.medium", bp, BATCH_SIZE, NULL );
mongo_insert_batch( conn, DB ".batch.medium", bp, BATCH_SIZE, NULL, 0 );

for ( j=0; j < BATCH_SIZE; j++ )
bson_destroy( &b[j] );
Expand All @@ -214,15 +214,15 @@ static void batch_insert_medium_test( void ) {
static void batch_insert_large_test( void ) {
int i, j;
bson b[BATCH_SIZE];
bson *bp[BATCH_SIZE];
const bson *bp[BATCH_SIZE];
for ( j=0; j < BATCH_SIZE; j++ )
bp[j] = &b[j];

for ( i=0; i < ( PER_TRIAL / BATCH_SIZE ); i++ ) {
for ( j=0; j < BATCH_SIZE; j++ )
make_large( &b[j], i );

mongo_insert_batch( conn, DB ".batch.large", bp, BATCH_SIZE, NULL );
mongo_insert_batch( conn, DB ".batch.large", bp, BATCH_SIZE, NULL, 0 );

for ( j=0; j < BATCH_SIZE; j++ )
bson_destroy( &b[j] );
Expand Down Expand Up @@ -384,13 +384,13 @@ static void clean( void ) {
}

/* create the db */
mongo_insert( conn, DB ".creation", bson_empty( &b ), NULL );
mongo_insert( conn, DB ".creation", bson_shared_empty(), NULL );
ASSERT( !mongo_cmd_get_last_error( conn, DB, NULL ) );
}

int main() {
INIT_SOCKETS_FOR_WINDOWS;
CONN_CONNECT_TEST;
CONN_CLIENT_TEST;

clean();

Expand Down

0 comments on commit 8cc3df7

Please sign in to comment.