&sectionHeader('Gmap Unit Tests');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('001', 'gmap_get');
$subtotal += &runTest('002', 'gmap_size');
$subtotal += &runTest('003', 'gmap_contains_key');
$subtotal += &runTest('004', 'gmap_put copies key');
$subtotal += &runTest('005', 'gmap_put does not copy value');
$subtotal += &runTest('006', 'gmap_put multiple times same key');
$subtotal += &runTest('007', 'Large map');
$subtotal += &runTest('008', 'Large map with bad hash function');
$subtotal += &runTest('009', 'gmap_for_each');
$subtotal += &runTest('010', 'gmap_keys');
$subtotal += &runTest('011', 'gmap with alternative key and value types');
$subtotal += &runTest('012', 'gmap_remove');
$subtotal += &runTest('013', 'gmap_remove nonexistent key');
$subtotal += &runTest('014', 'gmap_remove after collisions');
$subtotal += &runTest('015', 'gmap_keys with intervening embiggen');
$total += floor($subtotal);
&sectionResults('Gmap Unit Tests', $subtotal, 15, $checkpoint );
$testCount += 15;

&sectionHeader('Gmap Unit Tests with Valgrind');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('016', 'gmap_get');
$subtotal += &runTest('017', 'gmap_put copies key');
$subtotal += &runTest('018', 'gmap_put does not copy value');
$subtotal += &runTest('019', 'gmap_put multiple times same key');
$subtotal += &runTest('020', 'Large map');
$subtotal += &runTest('021', 'gmap_for_each');
$subtotal += &runTest('022', 'gmap_keys');
$subtotal += &runTest('023', 'gmap with alternative key and value types');
$subtotal += &runTest('024', 'gmap_remove');
$subtotal += &runTest('025', 'gmap_remove nonexistent key');
$subtotal += &runTest('026', 'gmap_remove after collisions');
$subtotal += &runTest('027', 'gmap_keys with intervening embiggen');
$total += floor($subtotal);
&sectionResults('Gmap Unit Tests with Valgrind', $subtotal, 12, $checkpoint );
$testCount += 12;

&sectionHeader('Gmap Worst-case Running Times');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('028', 'gmap_for_each');
$subtotal += &runTest('029', 'gmap_put');
$subtotal += &runTest('030', 'gmap_get');
$total += floor($subtotal);
&sectionResults('Gmap Worst-case Running Times', $subtotal, 3, $checkpoint );
$testCount += 3;

&sectionHeader('Showstopper Circumvention Tests');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('031', 'Initial size is reasonable');
$subtotal += &runTest('032', 'Uses supplied hash function');
$subtotal += &runTest('033', 'gmap_put expected time');
$subtotal += &runTest('034', 'gmap_get expected time');
$total += floor($subtotal);
&sectionResults('Showstopper Circumvention Tests', $subtotal, 4, $checkpoint );
$testCount += 4;

&sectionHeader('Competitions');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('035', '2 Battlefields, 2 Entries');
$subtotal += &runTest('036', '2 Battlefields, 3 Entries');
$subtotal += &runTest('037', '4 Battlefields, 3 Entries');
$subtotal += &runTest('038', '4 Battlefields, 2 Entries, Tied Matchup');
$subtotal += &runTest('039', '4 Battlefields, 4 entries, not Round-Robin');
$subtotal += &runTest('040', '4 Battlefields, 3 Entries, Different Scoring');
$subtotal += &runTest('041', '4 Battlefields, 3 Entries, Double-digit Units');
$subtotal += &runTest('042', '5 Battlefields');
$subtotal += &runTest('043', 'Valgrind');
$total += floor($subtotal);
&sectionResults('Competitions', $subtotal, 9, $checkpoint );
$testCount += 9;

&sectionHeader('Invalid input');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('044', 'Long id in entries');
$subtotal += &runTest('045', 'Non-numeric unit count in entries');
$subtotal += &runTest('046', 'Inconsistent total units');
$subtotal += &runTest('047', 'Wrong number of battlefields');
$subtotal += &runTest('048', 'Matchup with invalid id');
$subtotal += &runTest('049', 'Missing entry id in matchup');
$total += floor($subtotal);
&sectionResults('Invalid input', $subtotal, 6, $checkpoint );
$testCount += 6;

&sectionHeader('Invalid input with Valgrind');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('050', 'Long id in entries');
$subtotal += &runTest('051', 'Non-numeric unit count in entries');
$subtotal += &runTest('052', 'Inconsistent total units');
$subtotal += &runTest('053', 'Wrong number of battlefields');
$subtotal += &runTest('054', 'Matchup with invalid id');
$subtotal += &runTest('055', 'Missing entry id in matchup');
$total += floor($subtotal);
&sectionResults('Invalid input with Valgrind', $subtotal, 6, $checkpoint );
$testCount += 6;

