X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=testaa.c;h=0f2bd3ba12a939b47c7d9ae7c823152dabc67823;hb=b4c9550f206c476bb38b0bb2855d35e6b31bee83;hp=aa1bf13b86f7cf6312c312aa618f8b295f2c0837;hpb=5ee174baa9b2c30e01dc0ca0dfa38f916f805636;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/testaa.c b/testaa.c index aa1bf13..0f2bd3b 100644 --- a/testaa.c +++ b/testaa.c @@ -17,14 +17,15 @@ int main(int argc, const char *argv[]) { vg_info( "Database test\n" ); - if( !highscores_init( 200000 ) ) + if( !highscores_init( 200000, 100000 ) ) return 0; - + + srand(time(0)); vg_log( "Inserting test records...\n" ); - for( int i=0; i<200000; i++ ) + for( int i=0; i<5000; i++ ) { highscore_record entry; - entry.trackid = vg_randf() * 129.0f; + entry.trackid = vg_randf() * 138.0f; entry.points = vg_randf() * 10000.0f; entry.time = vg_randf() * 20000.0f; entry.playerid = rand() % 800; @@ -32,9 +33,37 @@ int main(int argc, const char *argv[]) highscores_push_record( &entry ); } + + for( int i=0; i<800; i++ ) + { + char rando[10]; + + int l=2+rand()%8; + for( int i=0; i