16 #include <my_global.h>
17 #include <my_pthread.h>
26 #include "stub_server_misc.h"
28 void test_no_instruments()
33 memset(& param, 0xFF,
sizeof(param));
66 init_event_name_sizing(& param);
68 ok(rc == 0,
"zero init");
73 void test_no_instances()
92 memset(& param, 0xFF,
sizeof(param));
125 init_event_name_sizing(& param);
127 ok(rc == 0,
"no instances init");
130 ok(mutex == NULL,
"no mutex");
133 ok(mutex == NULL,
"no mutex");
137 ok(rwlock == NULL,
"no rwlock");
140 ok(rwlock == NULL,
"no rwlock");
144 ok(cond == NULL,
"no cond");
147 ok(cond == NULL,
"no cond");
151 ok(thread == NULL,
"no thread");
154 ok(thread == NULL,
"no thread");
161 ok(file == NULL,
"no file");
164 ok(file == NULL,
"no file");
170 ok(file == NULL,
"no file");
173 ok(file == NULL,
"no file");
176 char long_file_name[10000];
177 int size=
sizeof(long_file_name);
178 memset(long_file_name,
'X', size);
181 ok(file == NULL,
"no file");
184 table=
create_table(& dummy_table_share, & fake_thread, NULL);
185 ok(table == NULL,
"no table");
187 table=
create_table(& dummy_table_share, & fake_thread, NULL);
188 ok(table == NULL,
"no table");
192 ok(socket == NULL,
"no socket");
195 ok(socket == NULL,
"no socket");
206 void test_with_instances()
232 memset(& param, 0xFF,
sizeof(param));
265 init_event_name_sizing(& param);
267 ok(rc == 0,
"instances init");
276 ok(mutex_1 != NULL,
"mutex");
279 ok(mutex_2 != NULL,
"mutex");
282 ok(mutex_2 == NULL,
"no mutex");
286 ok(mutex_2 != NULL,
"mutex");
290 ok(rwlock_1 != NULL,
"rwlock");
293 ok(rwlock_2 != NULL,
"rwlock");
296 ok(rwlock_2 == NULL,
"no rwlock");
300 ok(rwlock_2 != NULL,
"rwlock");
304 ok(cond_1 != NULL,
"cond");
307 ok(cond_2 != NULL,
"cond");
310 ok(cond_2 == NULL,
"no cond");
314 ok(cond_2 != NULL,
"cond");
318 ok(thread_1 != NULL,
"thread");
321 ok(thread_2 != NULL,
"thread");
324 ok(thread_2 == NULL,
"no thread");
328 ok(thread_2 != NULL,
"thread");
335 ok(file_1 == NULL,
"no file");
338 ok(file_1 == NULL,
"no file");
345 ok(file_1 != NULL,
"file");
349 ok(file_1 == file_2,
"same file");
355 ok(file_2 != NULL,
"file");
358 ok(file_2 == NULL,
"no file");
364 ok(file_2 == NULL,
"no file");
367 socket_1=
create_socket(& dummy_socket_class, NULL, NULL, 0);
368 ok(socket_1 != NULL,
"socket");
370 socket_2=
create_socket(& dummy_socket_class, NULL, NULL, 0);
371 ok(socket_2 != NULL,
"socket");
373 socket_2=
create_socket(& dummy_socket_class, NULL, NULL, 0);
374 ok(socket_2 == NULL,
"no socket");
377 socket_2=
create_socket(& dummy_socket_class, NULL, NULL, 0);
378 ok(socket_2 != NULL,
"socket");
381 table_1=
create_table(& dummy_table_share, & fake_thread, NULL);
382 ok(table_1 != NULL,
"table");
384 table_2=
create_table(& dummy_table_share, & fake_thread, NULL);
385 ok(table_2 != NULL,
"table");
387 table_2=
create_table(& dummy_table_share, & fake_thread, NULL);
388 ok(table_2 == NULL,
"no table");
391 table_2=
create_table(& dummy_table_share, & fake_thread, NULL);
392 ok(table_2 != NULL,
"table");
407 test_no_instruments();
409 test_with_instances();
414 int main(
int,
char **)
417 MY_INIT(
"pfs_instr-t");