static int HostBitTest03 (void) { int ret = 0; HostInitConfig(TRUE); Host *h = HostAlloc(); if (h == NULL) goto end; HostBitAdd(h, 0, 30); XBit *fb = HostBitGet(h,0); if (fb == NULL) { printf("fb == NULL although it was just added: "); goto end; } HostBitRemove(h, 0); fb = HostBitGet(h,0); if (fb != NULL) { printf("fb != NULL although it was just removed: "); goto end; } else { ret = 1; } HostFree(h); end: HostCleanup(); return ret; }
static int HostBitTest11 (void) { int ret = 0; HostInitConfig(TRUE); Host *h = HostAlloc(); if (h == NULL) goto end; HostBitAdd(h, 0, 90); HostBitAdd(h, 1, 90); HostBitAdd(h, 2, 90); HostBitAdd(h, 3, 90); XBit *fb = HostBitGet(h,3); if (fb == NULL) goto end; HostBitRemove(h,3); fb = HostBitGet(h,3); if (fb != NULL) { printf("fb != NULL even though it was removed: "); goto end; } ret = 1; HostFree(h); end: HostCleanup(); return ret; }
static int HostBitTest02 (void) { int ret = 0; HostInitConfig(TRUE); Host *h = HostAlloc(); if (h == NULL) goto end; XBit *fb = HostBitGet(h,0); if (fb == NULL) ret = 1; HostFree(h); end: HostCleanup(); return ret; }
static void XBitsTestShutdown(void) { HostCleanup(); IPPairCleanup(); StorageCleanup(); }