| 67 | } |
| 68 | |
| 69 | int main(int argc, char** argv) { |
| 70 | cpg_handle_t handle=0; |
| 71 | cpg_callbacks_t cb={&deliver,&confch}; |
| 72 | unsigned int nodeid=0; |
| 73 | struct cpg_name group={3,"foo"}; |
| 74 | struct iovec msg={(void *)"hello", 5}; /* discard const */ |
| 75 | |
| 76 | struct pollfd pfd; |
| 77 | int fd; |
| 78 | |
| 79 | printf ("All of the nodeids should match on a single node configuration\n for the test to pass."); |
| 80 | assert(CS_OK==cpg_initialize(&handle, &cb)); |
| 81 | assert(CS_OK==cpg_local_get(handle,&nodeid)); |
| 82 | printf("local_get: " CS_PRI_NODE_ID "\n", nodeid); |
| 83 | assert(CS_OK==cpg_join(handle, &group)); |
| 84 | assert(CS_OK==cpg_mcast_joined(handle,CPG_TYPE_AGREED,&msg,1)); |
| 85 | cpg_fd_get (handle, &fd); |
| 86 | pfd.fd = fd; |
| 87 | pfd.events = POLLIN; |
| 88 | |
| 89 | assert(poll (&pfd, 1, 1000) == 1); |
| 90 | assert(cpg_dispatch(handle, CS_DISPATCH_ALL) == CS_OK); |
| 91 | return (0); |
| 92 | } |
nothing calls this directly
no test coverage detected