-
Notifications
You must be signed in to change notification settings - Fork 3
/
sanity.php
47 lines (40 loc) · 1000 Bytes
/
sanity.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
require_once 'rebus.php';
require_once 'present_setup.php';
require_once 'db.php';
$db = getDb();
function filldb()
{
for ($team = 0; $team < count($GLOBALS['teams']); ++$team) {
for ($event = 0; $event < count($GLOBALS['events']); ++$event) {
$v = rand(-20, 20);
setPoints($team, $event, $v);
}
}
}
//filldb();
foreach ($actions as $a) {
if ($a->getTitle() == "Totalt") {
$data = array();
$all = array();
foreach ($a->sum as $e) {
if ($e != '*sum*') {
foreach (getPartEvents($e) as $e1) {
array_push($all, $e1);
updateEventPoints($data, getEventNumber($e1));
}
}
}
$diff = array_diff($all, array_keys($events));
if (count($diff) != 0) {
print "ERROR: Total does not match events\n";
var_dump($diff);
}
$diff = array_diff(array_keys($events), $all);
if (count($diff) != 0) {
print "ERROR: Total does not match events\n";
var_dump($diff);
}
}
}
?>