Skip to content

Commit 46ecf2a

Browse files
committed
some more assertions and printfs
1 parent 880739b commit 46ecf2a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

c/shlib/main.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ fn(const char *caller)
7474
abort();
7575
}
7676

77-
//#define USE_MAIN_VOID
77+
// #define USE_MAIN_VOID
7878
#undef USE_MAIN_VOID
7979

8080
#if defined(USE_MAIN_VOID)
@@ -96,14 +96,22 @@ main(int argc, char **argv)
9696
}
9797
#endif
9898

99+
printf("calling get_foo_set_ptr()...\n");
99100
printf("get_foo_set_ptr() = %p\n", get_foo_set_ptr());
100101
printf("foo_set = %p\n", foo_set);
101102
printf("foo_set_p = %p\n", foo_set_p);
103+
printf("calling get_foo_set_ptr()...\n");
102104
assert(get_foo_set_ptr() == foo_set);
103105

106+
printf("foo_set = %p\n", foo_set);
107+
printf("foo_set_p = %p\n", foo_set_p);
108+
assert(foo_set == foo_set_p);
109+
printf("calling foo_set()...\n");
104110
foo_set(200);
111+
printf("calling foo_set_p()...\n");
105112
foo_set_p(100);
106113
// return foo_get();
114+
printf("foo_get foo_set_p()...\n");
107115
printf("%d (expected 100)\n", foo_get());
108116
assert(foo_get() == 100);
109117

@@ -133,6 +141,7 @@ main(int argc, char **argv)
133141

134142
typedef const char *(*fn_t)();
135143
extern fn_t return_weak_func2();
144+
printf("calling return_weak_func2()...\n");
136145
printf("return_weak_func2() = %p\n", return_weak_func2());
137146
assert(return_weak_func2() == NULL);
138147

@@ -146,6 +155,7 @@ main(int argc, char **argv)
146155
printf("var_in_main2: %u\n", var_in_main2);
147156
assert(var_in_main2 == 321);
148157
printf("&var_in_main2: %p\n", (void *)&var_in_main2);
158+
printf("calling get_ptr_of_var_in_main2()...\n");
149159
printf("get_ptr_of_var_in_main2(): %p\n",
150160
(void *)get_ptr_of_var_in_main2());
151161
assert(get_ptr_of_var_in_main2() == &var_in_main2);

0 commit comments

Comments
 (0)