&sectionHeader('Core Unit Tests (56 points)');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('001', 'Create and destroy');
$subtotal += &runTest('002', 'Empty track');
$subtotal += &runTest('003', 'Add copies trackpoints');
$subtotal += &runTest('004', 'Single segment');
$subtotal += &runTest('005', 'Two segments');
$subtotal += &runTest('006', 'Counts');
$subtotal += &runTest('007', 'Heatmap');
$subtotal = $subtotal * 56 / 7;
$total += floor($subtotal);
&sectionResults('Core Unit Tests (56 points)', $subtotal, 7, $checkpoint );
$testCount += 7;

&sectionHeader('Unit Tests with Valgrind (14 points)');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('008', 'Create and destroy');
$subtotal += &runTest('009', 'Empty track');
$subtotal += &runTest('010', 'Add copies trackpoints');
$subtotal += &runTest('011', 'Single segment');
$subtotal += &runTest('012', 'Two segments');
$subtotal += &runTest('013', 'Counts');
$subtotal += &runTest('014', 'Heatmap');
$subtotal = $subtotal * 14 / 7;
$total += floor($subtotal);
&sectionResults('Unit Tests with Valgrind (14 points)', $subtotal, 7, $checkpoint );
$testCount += 7;

&sectionHeader('Merge (Checkpoint Option 1 - 24 points)');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('015', 'Merge');
$subtotal += &runTest('016', 'Merge including 1st segment');
$subtotal += &runTest('017', 'Merge one segment');
$subtotal = $subtotal * 24 / 3;
$core = $total;
$merge = $merge + $subtotal;
$total += floor($subtotal);
&sectionResults('Merge (Checkpoint Option 1 - 24 points)', $subtotal, 3, $checkpoint );
$testCount += 3;

&sectionHeader('Merge w/ Valgrind (Checkpoint Option 1 - 6 points)');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('018', 'Merge');
$subtotal += &runTest('019', 'Merge including 1st segment');
$subtotal += &runTest('020', 'Merge one segment');
$subtotal = $subtotal * 6 / 3;
$merge = $merge + $subtotal;
$total += floor($subtotal);
&sectionResults('Merge w/ Valgrind (Checkpoint Option 1 - 6 points)', $subtotal, 3, $checkpoint );
$testCount += 3;

&sectionHeader('Many Points and Segments (Checkpoint Option 2 - 24 points)');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('021', 'Memory usage for 1 segment, 1 track point is reasonable');
if ($subtotal >= 1) {
$subtotal += &runTest('022', 'Many track points, one segment');
}
else {
skipTest('022', 'Many track points, one segment');
}
$subtotal += &runTest('023', 'Many segments, one track point per');
$subtotal += 10 if ($subtotal >= 2);
$subtotal += 11 if ($subtotal >= 13);
$resize = $resize + $subtotal;
$total += floor($subtotal);
&sectionResults('Many Points and Segments (Checkpoint Option 2 - 24 points)', $subtotal, 3, $checkpoint );
$testCount += 3;

&sectionHeader('Many Points and Segments w/ Valgrind (Checkpoint Option 2 - 6 points)');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('024', 'Many track points, one segment');
$subtotal += &runTest('025', 'Many segments, one track point per');
$subtotal = $subtotal * 6 / 2;
$resize = $resize + $subtotal;
$total += floor($subtotal);
&sectionResults('Many Points and Segments w/ Valgrind (Checkpoint Option 2 - 6 points)', $subtotal, 2, $checkpoint );
$testCount += 2;

&sectionHeader('180/-180 Hemishpere Crossing');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('026', 'Hemisphere Crossing');
$checkpoint = $core + ($merge > $resize ? $merge : $resize);
$total = 0;
$testCount = 0;
$total += floor($subtotal);
&sectionResults('180/-180 Hemishpere Crossing', $subtotal, 1, $checkpoint );
$testCount += 1;

&sectionHeader('Heatmaps');
$subtotal = 0;
@SOURCE = ();
@LINK = ();
$subtotal = &runTest('027', '2-by-2');
$subtotal += &runTest('028', 'Walking a grid');
$subtotal += &runTest('029', 'Long circuit');
$subtotal += &runTest('030', 'Valgrind on long circuit');
$total += floor($subtotal);
&sectionResults('Heatmaps', $subtotal, 4, $checkpoint );
$testCount += 4;

