]> git.saurik.com Git - apple/dyld.git/blob - unit-tests/test-cases/upward-dylib-init-order/common.c
dyld-733.6.tar.gz
[apple/dyld.git] / unit-tests / test-cases / upward-dylib-init-order / common.c
1 #include "common.h"
2 #include <stdio.h>
3
4 static bool b = false;
5 static bool u = false;
6 static bool u2 = false;
7 static bool isOk = true;
8
9 void setB()
10 {
11 if ( u || b || u2 )
12 isOk = false;
13 b = true;
14 }
15
16 void setU()
17 {
18 if ( u || u2 )
19 isOk = false;
20 u = true;
21 }
22
23 void setU2()
24 {
25 if ( u2 )
26 isOk = false;
27 u2 = true;
28 }
29
30 // return true iff
31 // setB() was called, then setU()
32 bool ok()
33 {
34 //fprintf(stderr, "isOk=%d, u=%d, b=%d\n", isOk, u, b);
35 return isOk && u && b && u2;
36 }
37