tests/actofgod: Test integer values more thoroughly

For integer values, we test lower bound - 1, lower bound, upper bound,
upper bound + 1.  Additionally test lower bound + 1, upper bound -1.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2017-08-27 14:42:47 +02:00
parent 5363ef85d4
commit 4746d22c3e
3 changed files with 526 additions and 127 deletions

View file

@ -215,18 +215,19 @@ uid owner xloc yloc type effic mobil off tech opx opy mission radius stockpile p
/config /config
config news config news
actor action victim times duration time actor action victim times duration time
0 44 1 32 0 0 0 44 1 47 0 0
0 43 2 6 0 0 0 43 2 7 0 0
0 44 3 28 0 0 0 44 3 28 0 0
0 43 1 76 0 0 0 43 1 105 0 0
0 42 1 20 0 0 0 42 1 20 0 0
1 45 0 3 0 0 1 45 0 3 0 0
0 43 3 38 0 0 0 43 3 53 0 0
0 44 2 7 0 0 0 44 2 14 0 0
0 42 3 4 0 0 0 42 2 20 0 0
0 42 2 18 0 0 2 45 0 2 0 0
0 42 3 6 0 0
0 44 1 5 0 0
0 43 4 2 0 0 0 43 4 2 0 0
0 44 1 1 0 0
0 43 2 4 0 0 0 43 2 4 0 0
0 43 1 3 0 0 0 43 1 3 0 0
0 33 0 2 0 0 0 33 0 2 0 0

View file

@ -69,15 +69,19 @@ sub next_id {
sub edit_int1 { sub edit_int1 {
my ($ef, $id, $key, $lob, $upb) = @_; my ($ef, $id, $key, $lob, $upb) = @_;
edit($ef, $id, $key, $lob + 1)
if $lob + 1 < $upb;
edit($ef, $id, $key, $lob); edit($ef, $id, $key, $lob);
$id = next_id($ef, $id); $id = next_id($ef, $id);
edit($ef, $id, $key, $lob - 1) edit($ef, $id, $key, $lob - 1)
if ($lob > $INT_MIN); if $lob > $INT_MIN;
$id = next_id($ef, $id); $id = next_id($ef, $id);
edit($ef, $id, $key, $upb - 1)
if $upb - 1 > $lob + 1;
edit($ef, $id, $key, $upb); edit($ef, $id, $key, $upb);
$id = next_id($ef, $id); $id = next_id($ef, $id);
edit($ef, $id, $key, $upb + 1) edit($ef, $id, $key, $upb + 1)
if ($upb < $INT_MAX); if $upb < $INT_MAX;
} }
sub edit_int { sub edit_int {

File diff suppressed because it is too large Load diff