gesamt: keine auswertungsreihenfolge ftw, seiteneffekte ade
authorBernhard Urban <lewurm@gmail.com>
Mon, 7 Jun 2010 19:18:54 +0000 (21:18 +0200)
committerBernhard Urban <lewurm@gmail.com>
Mon, 7 Jun 2010 19:18:54 +0000 (21:18 +0200)
laut LVA-leitung werden solche testfaelle nicht vorkommen.

12 files changed:
gesamt/georg_fib_102.instr
gesamt/georg_fib_122.instr
gesamt/intelli_02.instr
gesamt/intelli_03.0
gesamt/intelli_03.call
gesamt/intelli_03.instr
gesamt/lewurm_00.instr
gesamt/lewurm_02.instr
gesamt/lewurm_07.0 [new file with mode: 0644]
gesamt/lewurm_07.call [new file with mode: 0644]
gesamt/lewurm_07.instr [new file with mode: 0644]
gesamt/lewurm_08.instr

index 0cfdca4ca2c793ceea0e49719605309409baf3f9..328e4ce676d2b89277cf2e33784d93bc09ee8c35 100644 (file)
@@ -1 +1 @@
-4606
+3694
index b80c99c6b45df5634f8354f308bf71b35f017505..d80cdf9b8833018082affeededf134a3360f34b0 100644 (file)
@@ -1 +1 @@
-5046
+4354
index a8fa06e1be7da01425d2be19da24595de2fa02c2..82cced27d7be32719d009707139bd949ad6263c9 100644 (file)
@@ -1 +1 @@
-62
+51
index 048e5b308523039e4bf41091a014eb8d9769b2ae..a3303bfea288ddf012efc3e54a8e4b0812ced959 100644 (file)
@@ -12,4 +12,4 @@ method inc()
        this.c := this.c - -1;
        this.d := this.d - -1;
        return this.a;
        this.c := this.c - -1;
        this.d := this.d - -1;
        return this.a;
-end;
\ No newline at end of file
+end;
index e18ae409a4a7e23346964608b72c1cdf4d32b65d..10c438748a906a7f3141a345ea434397c14f16f5 100644 (file)
@@ -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]);
 }
 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);
index cf7ff50f7096c769562fad5129339959761946c2..3ad5abd03aea89f7de126c4861363e4f64355973 100644 (file)
@@ -1 +1 @@
-359
+99
index 8351c19397f4fcd5238d10034fa7fa384f14d580..b1bd38b62a0800a4f6a80c34e21c5acffae52c7e 100644 (file)
@@ -1 +1 @@
-14
+13
index 04f9fe46068b397a6fc24d647b7e3ec4315c15e7..425151f3a411f5e088d7753e7c8d016303b1b9d1 100644 (file)
@@ -1 +1 @@
-59
+40
diff --git a/gesamt/lewurm_07.0 b/gesamt/lewurm_07.0
new file mode 100644 (file)
index 0000000..b47f691
--- /dev/null
@@ -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 (file)
index 0000000..2ba88c6
--- /dev/null
@@ -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 (file)
index 0000000..60d3b2f
--- /dev/null
@@ -0,0 +1 @@
+15
index 9e5feb5256930f3cae636754eef8a244ede164eb..d81cc0710eb6cf9efd5b920a8453e1e07157b6cd 100644 (file)
@@ -1 +1 @@
-46
+42