MCPcopy Create free account
hub / github.com/corosync/corosync / main

Function main

test/stress_cpgfdget.c:86–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84#define ITERATIONS (1000*2000)
85
86int main (void)
87{
88 cpg_handle_t handle;
89 cs_error_t res;
90 int original_fd;
91 int i;
92 int fd;
93
94 signal (SIGINT, sigintr_handler);
95 res = cpg_initialize (&handle, &callbacks);
96 if (res != CS_OK) {
97 printf ("FAIL %d\n", res);
98 exit (-1);
99 }
100
101 res = cpg_fd_get (handle, &original_fd);
102 if (res != CS_OK) {
103 printf ("FAIL %d\n", res);
104 }
105 for (i = 0; i < ITERATIONS; i++) {
106 res = cpg_fd_get (handle, &fd);
107 if (original_fd != fd) {
108 printf ("FAIL\n");
109 exit (-1);
110 }
111 }
112
113 cpg_finalize (handle);
114
115 printf ("PASS\n");
116 return (0);
117}

Callers

nothing calls this directly

Calls 3

cpg_initializeFunction · 0.85
cpg_fd_getFunction · 0.85
cpg_finalizeFunction · 0.85

Tested by

no test coverage detected