source: CIVL/examples/translation/pthread/PthreadTest.java@ 764d472

1.23 2.0 main test-branch
Last change on this file since 764d472 was 16d81051, checked in by John Edenhofner <johneden@…>, 12 years ago

Added more tests to PthreadTests, modified transformer to only add pthread_exit(NULL) to void pointer methods that will be called as a thread. Transforms each main to have a return(0) call at its end so that the thread pool is freed each time (frees upon return)

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@1236 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 4.5 KB
RevLine 
[16d81051]1package edu.udel.cis.vsl.civl;
2
3import static org.junit.Assert.assertFalse;
4import static org.junit.Assert.assertTrue;
5
6import java.io.File;
7
8import org.junit.Ignore;
9import org.junit.Test;
10
11import edu.udel.cis.vsl.abc.err.IF.ABCException;
12import edu.udel.cis.vsl.civl.run.IF.UserInterface;
13
14public class PthreadTransformerTest {
15 /* *************************** Static Fields *************************** */
16
17 private static File rootDir = new File(new File("examples"),
18 "translation/pthread");
19
20 private static UserInterface ui = new UserInterface();
21
22 /* *************************** Helper Methods *************************** */
23
24 private static String filename(String name) {
25 return new File(rootDir, name).getPath();
26 }
27
28 /* **************************** Test Methods *************************** */
29
30 @Test
31 public void bigshot_p_false() throws ABCException {
32 assertFalse(ui.run("verify", filename("bigshot_s_false.c"), "-enablePrintf=false", "-svcomp"));
33 }
34
35 @Test
36 public void bigshot_s_false() throws ABCException {
37 assertFalse(ui.run("verify", filename("bigshot_s_false.c"), "-enablePrintf=false", "-svcomp"));
38 }
39
40 @Test
41 public void bigshot_s_true() throws ABCException {
42 assertTrue(ui.run("verify", filename("bigshot_s_true.c"), "-enablePrintf=false", "-svcomp"));
43 }
44
45 @Test
46 public void fib_bench_false() throws ABCException {
47 assertFalse(ui.run("verify", filename("fib_bench_false.c"), "-svcomp", "-inputNUM=5"));
48 }
49
50 @Test
51 public void fib_bench_longer_false() throws ABCException {
52 assertFalse(ui.run("verify", filename("fib_bench_longer_false.c"), "-svcomp", "-inputNUM=6"));
53 }
54
55 @Test
56 public void fib_bench_longer_true() throws ABCException {
57 assertTrue(ui.run("verify", filename("fib_bench_longer_true.c"), "-svcomp", "-inputNUM=6"));
58 }
59
60 @Test
61 public void fib_bench_longest_false() throws ABCException {
62 assertFalse(ui.run("verify", filename("fib_bench_longest_false.c"), "-svcomp", "-inputNUM=11"));
63 }
64
65 @Test
66 public void fib_bench_longest_true() throws ABCException {
67 assertTrue(ui.run("verify", filename("fib_bench_longer_true.c"), "-svcomp", "-inputNUM=11"));
68 }
69
70 @Test
71 public void fib_bench_true() throws ABCException {
72 assertTrue(ui.run("verify", filename("fib_bench_true.c"), "-svcomp", "-inputNUM=5"));
73 }
74
75 @Test
76 public void indexer_true() throws ABCException {
77 assertTrue(ui.run("verify", filename("indexer_true.c"), "-svcomp", "-inputSIZE=128", "-inputMAX=4", "-inputNUM_THREADS=13"));
78 }
79
80 @Test
81 public void lazy01_false() throws ABCException {
82 assertFalse(ui.run("verify", filename("lazy01_false.c"), "-svcomp"));
83 }
84
85 @Test
86 public void queue_false() throws ABCException {
87 assertFalse(ui.run("verify", filename("queue_false.c"), "-svcomp", "inputSIZE=5", "inputEMPTY=-1", "inputFULL=-2"));
88 }
89
90 @Test
91 public void queue_ok_true() throws ABCException {
92 assertTrue(ui.run("verify", filename("queue_ok_true.c"), "-svcomp", "inputSIZE=5", "inputEMPTY=-1", "inputFULL=-2"));
93 }
94 /*
95 @Test
96 public void reorder_2_false() throws ABCException {
97 assertFalse(ui.run("verify", filename("reorder_2_false.c"), "-svcomp"));
98 }
99
100 @Test
101 public void reorder_5_false() throws ABCException {
102 assertFalse(ui.run("verify", filename("reorder_5_false.c"), "-svcomp"));
103 }
104 */
105 @Test
106 public void sigma_false() throws ABCException {
107 assertFalse(ui.run("verify", filename("sigma_false.c"), "-svcomp"));
108 }
109
110 @Test
111 public void singleton_false() throws ABCException {
112 assertFalse(ui.run("verify", filename("singleton_false.c"), "-svcomp"));
113 }
114
115 @Test
116 public void singleton_with_uninit_problems_true() throws ABCException {
117 assertTrue(ui.run("verify", filename("singleton_with-uninit-problems-true.c"), "-enablePrintf=false", "-svcomp"));
118 }
119
120 @Test
121 public void stack_false() throws ABCException {
122 assertFalse(ui.run("verify", filename("stack_false.c"), "-svcomp", "-inputSIZE=5", "-inputOVERFLOW=-1", "-inputUNDERFLOW=-2"));
123 }
124
125 @Test
126 public void stack_true() throws ABCException {
127 assertTrue(ui.run("verify", filename("stack_true.c"), "-svcomp", "-inputSIZE=5", "-inputOVERFLOW=-1", "-inputUNDERFLOW=-2"));
128 }
129
130 @Test
131 public void stateful01_false() throws ABCException {
132 assertFalse(ui.run("verify", filename("stateful01_false.c"), "-svcomp"));
133 }
134
135 @Test
136 public void stateful01_true() throws ABCException {
137 assertTrue(ui.run("verify", filename("stateful01_true.c"), "-svcomp"));
138 }
139
140 @Test
141 public void sync01_true() throws ABCException {
142 assertTrue(ui.run("verify", filename("sync01_true.c"), "-svcomp"));
143 }
144 /*
145 @Test
146 public void twostage_3_false() throws ABCException {
147 assertFalse(ui.run("verify", filename("twostage_3_false.c"), "-svcomp"));
148 }
149 */
150}
Note: See TracBrowser for help on using the repository browser.