Exemplo n.º 1
0
int
main(int argc, char *argv[argc])
{
    LongBowTestRunner *testRunner = LONGBOW_TEST_RUNNER_CREATE(test_MemoryLeaks);
    int exitStatus = longBowMain(argc, argv, testRunner, NULL);
    longBowTestRunner_Destroy(&testRunner);
    assertTrue(longBowMemory_OutstandingAllocations() == 0, "Memory leaks %" PRId64, longBowMemory_OutstandingAllocations());

    exit(exitStatus);
}
Exemplo n.º 2
0
int
main(int argc, char *argv[])
{
    LongBowTestRunner *testRunner = LONGBOW_TEST_RUNNER_CREATE(longBow_Config);
    int exitStatus = LONGBOW_TEST_MAIN(argc, argv, testRunner);
    longBowTestRunner_Destroy(&testRunner);
    if (longBowMemory_OutstandingAllocations() != 0) {
        printf("%" PRId64 " allocation leaks.", longBowMemory_OutstandingAllocations());
    }
    exit(exitStatus);
}
Exemplo n.º 3
0
LONGBOW_TEST_CASE(Global, longBowTestCaseClipBoard_CreateDestroy)
{
    uint64_t allocations = longBowMemory_OutstandingAllocations();
    char *shared = longBowMemory_StringCopy("shared data");

    LongBowTestCaseClipBoard *clipboard = longBowTestCaseClipBoard_Create(shared);
    assertNotNull(clipboard, "Expected non-null result from longBowTestCaseClipBoard_Create");

    longBowTestCaseClipBoard_Destroy(&clipboard);
    longBowMemory_Deallocate((void **) &shared);

    assertTrue(longBowMemory_OutstandingAllocations() == allocations,
               "Memory leaks %" PRId64, longBowMemory_OutstandingAllocations());
}