{
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;
highscores_push_record( &entry );
}
+
+ for( int i=0; i<800; i++ )
+ {
+ char rando[10];
+
+ int l=2+rand()%8;
+ for( int i=0; i<l; i++ )
+ rando[i] = 'a' + rand() % 10;
+ rando[l] = '\0';
+
+ highscore_set_user_nickname( rand() % 800, rando );
+ }
+
vg_log( "Done.\n" );
- highscores_print_track( 2, 10 );
+#if 0
+ int ln =0, err=0;
+ aatree_show_counts( &highscore_system.aainfo_playerinfo_playerid,
+ highscore_system.dbheader.playerinfo_root, 0,
+ &ln, &err, _highscore_showname, 1 );
+#endif
+
+ char testy[27*(10+3)];
+
+ for( int i=0; i<vg_list_size(track_infos); i++ )
+ {
+ highscores_board_generate( testy, i, 10 );
+ highscores_board_printf( stdout, testy, 10 );
+ }
+
+ highscores_serialize_all();
highscores_free();
return 0;
}