&sectionHeader('Command-line cities in strcmp order and no extra cities in location data file (20 points)');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('001', 'Cities given in strcmp order 6 cities');
$subtotal += &runTest('002', 'Insert Nearest 6 cities');
$subtotal += &runTest('003', 'Insert Farthest 6 cities');
$subtotal += &runTest('004', 'Insert Nearest 12 cities');
$subtotal = $subtotal * 20 / 4;
$total += floor($subtotal);
&sectionResults('Command-line cities in strcmp order and no extra cities in location data file (20 points)', $subtotal, 4, $checkpoint );
$testCount += 4;

&sectionHeader('Command-line cities not in order and no extra cities in location data file  (20 points)');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('005', 'Given order');
$subtotal += &runTest('006', 'Insert Nearest 6 cities');
$subtotal += &runTest('007', 'Insert Farthest 6 cities');
$subtotal += &runTest('008', 'Insert Nearest 12 cities');
$subtotal = $subtotal * 20 / 4;
$total += floor($subtotal);
&sectionResults('Command-line cities not in order and no extra cities in location data file  (20 points)', $subtotal, 4, $checkpoint );
$testCount += 4;

&sectionHeader('Command-line cities in strcmp order with extra cities in location data file  (30 points)');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('009', 'Given order 6 cities');
$subtotal += &runTest('010', 'Insert Nearest 6 cities');
$subtotal += &runTest('011', 'Insert Farthest 6 cities');
$subtotal += &runTest('012', 'Insert Farthest 12 cities');
$subtotal = $subtotal * 30 / 4;
$total += floor($subtotal);
&sectionResults('Command-line cities in strcmp order with extra cities in location data file  (30 points)', $subtotal, 4, $checkpoint );
$testCount += 4;

&sectionHeader('General Cases (30 points)');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('013', 'Given order 6 cities');
$subtotal += &runTest('014', 'Insert Nearest 6 cities');
$subtotal += &runTest('015', 'Insert Farthest 6 cities');
$subtotal += &runTest('016', 'Insert Farthest 12 cities');
$subtotal += &runTest('017', 'Insert Farthest 16 cities');
$subtotal += &runTest('018', 'Insert Farthest 16 cities');
$subtotal += &runTest('019', 'Insert Nearest Avelo eastern network');
$subtotal += &runTest('020', 'Insert Nearest 512 cities');
$subtotal += &runTest('021', 'Long city names');
$subtotal += &runTest('022', 'Whitespace in city names');
$subtotal += &runTest('023', 'Other nonalphabetic characters');
$subtotal = $subtotal * 30 / 11;
$total += floor($subtotal);
&sectionResults('General Cases (30 points)', $subtotal, 11, $checkpoint );
$testCount += 11;

&sectionHeader('Multiple Methods');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('024', 'Given + Insert Nearest; location data = command-line');
$subtotal += &runTest('025', 'Insert Farthest + Insert Nearest; location data = command-line');
$subtotal += &runTest('026', 'Insert Nearest + Given; command line ordered');
$subtotal += &runTest('027', 'All methods; command line not ordered');
$checkpoint = $total;
$total = 0;
$testCount = 0;
$total += floor($subtotal);
&sectionResults('Multiple Methods', $subtotal, 4, $checkpoint );
$testCount += 4;

&sectionHeader('Location edge cases');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('028', 'Nearest with ties');
$subtotal += &runTest('029', 'Insert farthest with poles');
$subtotal += &runTest('030', 'Two airports at same location');
$total += floor($subtotal);
&sectionResults('Location edge cases', $subtotal, 3, $checkpoint );
$testCount += 3;

&sectionHeader('Error messages');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('031', 'No arguments');
$subtotal += &runTest('032', 'File not found');
$subtotal += &runTest('033', 'No cities');
$subtotal += &runTest('034', 'Invalid method first');
$subtotal += &runTest('035', 'Invalid insert argument');
$subtotal += &runTest('036', 'Missing insert argument');
$subtotal += &runTest('037', 'Missing insert argument but interpreted as invalid criterion');
$subtotal += &runTest('038', 'Invalid insert argument last');
$subtotal += &runTest('039', 'Empty method name');
$subtotal += &runTest('040', 'Empty string for insert argument');
$subtotal += &runTest('041', 'Multiple invalid methods');
$subtotal += &runTest('042', 'Multiple invalid insert arguments');
$subtotal += &runTest('043', 'File not found and invalid method');
$total += floor($subtotal);
&sectionResults('Error messages', $subtotal, 13, $checkpoint );
$testCount += 13;

&sectionHeader('Invalid input');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('044', 'Empty city name out of order in location data file');
$subtotal += &runTest('045', 'Whitespace in latitude');
$subtotal += &runTest('046', 'Missing longitude');
$subtotal += &runTest('047', 'Empty latitude');
$subtotal += &runTest('048', 'Non-numeric latitude');
$subtotal += &runTest('049', 'Comma in city name in location data file');
$subtotal += &runTest('050', 'EOF in longitude');
$subtotal += &runTest('051', 'Blank line at end of location data file');
$total += floor($subtotal);
&sectionResults('Invalid input', $subtotal, 8, $checkpoint );
$testCount += 8;

&sectionHeader('Efficiency');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('052', 'O(n) space for -given');
$subtotal += &runTest('053', 'O(n log n) time for -given');
$subtotal += &runTest('054', 'Insert Farthest 1024 cities to check constant factors');
$total += floor($subtotal);
&sectionResults('Efficiency', $subtotal, 3, $checkpoint );
$testCount += 3;

&sectionHeader('Valgrind');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('055', 'Given order 12 cities');
$subtotal += &runTest('056', 'Insert Nearest 16 cities');
$subtotal += &runTest('057', 'Insert Farthest 16 cities');
$subtotal += &runTest('058', 'Cities given in strcmp order 6 cities');
$subtotal += &runTest('059', 'Insert Nearest 6 cities');
$subtotal += &runTest('060', 'Insert Farthest 6 cities');
$subtotal += &runTest('061', 'Invalid: Empty latitude');
$subtotal += &runTest('062', 'Invalid: Blank line at end of location data file');
$total += floor($subtotal);
&sectionResults('Valgrind', $subtotal, 8, $checkpoint );
$testCount += 8;

