From b0a180255d33c4f4b1158e03788411e905ed36b4 Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Mon, 7 Jun 2010 21:18:54 +0200 Subject: [PATCH] gesamt: keine auswertungsreihenfolge ftw, seiteneffekte ade laut LVA-leitung werden solche testfaelle nicht vorkommen. --- gesamt/georg_fib_102.instr | 2 +- gesamt/georg_fib_122.instr | 2 +- gesamt/intelli_02.instr | 2 +- gesamt/intelli_03.0 | 2 +- gesamt/intelli_03.call | 5 ++++- gesamt/intelli_03.instr | 2 +- gesamt/lewurm_00.instr | 2 +- gesamt/lewurm_02.instr | 2 +- gesamt/lewurm_07.0 | 8 ++++++++ gesamt/lewurm_07.call | 7 +++++++ gesamt/lewurm_07.instr | 1 + gesamt/lewurm_08.instr | 2 +- 12 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 gesamt/lewurm_07.0 create mode 100644 gesamt/lewurm_07.call create mode 100644 gesamt/lewurm_07.instr diff --git a/gesamt/georg_fib_102.instr b/gesamt/georg_fib_102.instr index 0cfdca4..328e4ce 100644 --- a/gesamt/georg_fib_102.instr +++ b/gesamt/georg_fib_102.instr @@ -1 +1 @@ -4606 +3694 diff --git a/gesamt/georg_fib_122.instr b/gesamt/georg_fib_122.instr index b80c99c..d80cdf9 100644 --- a/gesamt/georg_fib_122.instr +++ b/gesamt/georg_fib_122.instr @@ -1 +1 @@ -5046 +4354 diff --git a/gesamt/intelli_02.instr b/gesamt/intelli_02.instr index a8fa06e..82cced2 100644 --- a/gesamt/intelli_02.instr +++ b/gesamt/intelli_02.instr @@ -1 +1 @@ -62 +51 diff --git a/gesamt/intelli_03.0 b/gesamt/intelli_03.0 index 048e5b3..a3303bf 100644 --- a/gesamt/intelli_03.0 +++ b/gesamt/intelli_03.0 @@ -12,4 +12,4 @@ method inc() this.c := this.c - -1; this.d := this.d - -1; return this.a; -end; \ No newline at end of file +end; diff --git a/gesamt/intelli_03.call b/gesamt/intelli_03.call index e18ae40..10c4387 100644 --- a/gesamt/intelli_03.call +++ b/gesamt/intelli_03.call @@ -14,5 +14,8 @@ printf("ret: %ld\n", ret); for(i=0; i < sizeof z1/sizeof z1[0]; i++) { printf("z1[%i]: %ld, z2[%i]: %ld\n", i, z1[i], i, z2[i]); } +printf("anmerkung: dieser testfall ist von seiteneffekten gepraegt\n" + "es *koennte* passieren, dass der testfall richtig ist obwohl er\n" + "fehlschlaegt, da die auswertungsreihenfolge nicht vorgegeben ist\n\n"); -RET(ret == -16 && z1[0] == 0 && z2[0] == 10 && z1[1] == 4 && z1[2] == 6 && z1[3] == 8 && z1[4] == 10 && z1[5] == 10 && z1[6] == 12 && z2[1] == 23 && z2[2] == 43 && z2[3] == 63 && z2[4] == 83 && z2[5] == 100 && z2[6] == 120); \ No newline at end of file +RET((ret == -16 || ret == -14) && z1[0] == 0 && z2[0] == 10 && z1[1] == 4 && z1[2] == 6 && z1[3] == 8 && z1[4] == 10 && z1[5] == 10 && z1[6] == 12 && z2[1] == 23 && z2[2] == 43 && z2[3] == 63 && z2[4] == 83 && z2[5] == 100 && z2[6] == 120); diff --git a/gesamt/intelli_03.instr b/gesamt/intelli_03.instr index cf7ff50..3ad5abd 100644 --- a/gesamt/intelli_03.instr +++ b/gesamt/intelli_03.instr @@ -1 +1 @@ -359 +99 diff --git a/gesamt/lewurm_00.instr b/gesamt/lewurm_00.instr index 8351c19..b1bd38b 100644 --- a/gesamt/lewurm_00.instr +++ b/gesamt/lewurm_00.instr @@ -1 +1 @@ -14 +13 diff --git a/gesamt/lewurm_02.instr b/gesamt/lewurm_02.instr index 04f9fe4..425151f 100644 --- a/gesamt/lewurm_02.instr +++ b/gesamt/lewurm_02.instr @@ -1 +1 @@ -59 +40 diff --git a/gesamt/lewurm_07.0 b/gesamt/lewurm_07.0 new file mode 100644 index 0000000..b47f691 --- /dev/null +++ b/gesamt/lewurm_07.0 @@ -0,0 +1,8 @@ +struct a end; +method f() + return this.a - inc(); +end; +method inc() + this.a := this.a--1; + return this.a; +end; diff --git a/gesamt/lewurm_07.call b/gesamt/lewurm_07.call new file mode 100644 index 0000000..2ba88c6 --- /dev/null +++ b/gesamt/lewurm_07.call @@ -0,0 +1,7 @@ +long f(long[]); +long ar[] = {100}; +int ret = f(ar); +#define ERG1 (100 - 101) +#define ERG2 (101 - 101) +printf("ret ist %2i (sollte %2i ODER %2i sein)\n", ret, ERG1, ERG2); +RET(ret == ERG1 || ret == ERG2); diff --git a/gesamt/lewurm_07.instr b/gesamt/lewurm_07.instr new file mode 100644 index 0000000..60d3b2f --- /dev/null +++ b/gesamt/lewurm_07.instr @@ -0,0 +1 @@ +15 diff --git a/gesamt/lewurm_08.instr b/gesamt/lewurm_08.instr index 9e5feb5..d81cc07 100644 --- a/gesamt/lewurm_08.instr +++ b/gesamt/lewurm_08.instr @@ -1 +1 @@ -46 +42 -- 2.25.1