static void serialize_medium_test( void ) {
    int i;
    bson b;
    for ( i=0; i<PER_TRIAL; i++ ) {
        make_medium( &b, i );
        bson_destroy( &b );
    }
}
static void single_insert_medium_test( void ) {
    int i;
    bson b;
    for ( i=0; i<PER_TRIAL; i++ ) {
        make_medium( &b, i );
        mongo_insert( conn, DB ".single.medium", &b, NULL );
        bson_destroy( &b );
    }
}
static void index_insert_medium_test( void ) {
    int i;
    bson b;
    ASSERT( mongo_create_simple_index( conn, DB ".index.medium", "x", 0, NULL ) == MONGO_OK );
    for ( i=0; i<PER_TRIAL; i++ ) {
        make_medium( &b, i );
        mongo_insert( conn, DB ".index.medium", &b, NULL );
        bson_destroy( &b );
    }
}
static void batch_insert_medium_test( void ) {
    int i, j;
    bson b[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, 0 );

        for ( j=0; j < BATCH_SIZE; j++ )
            bson_destroy( &b[j] );
    }
}
Exemple #5
0
static material_type make_mu(double mu)
{
    return make_medium(1.0, mu);
}
Exemple #6
0
static material_type make_epsilon(double epsilon)
{
    return make_medium(epsilon, 1.0);
}