diff options
author | Luca Muscariello <lumuscar+fdio@cisco.com> | 2019-01-24 16:32:25 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2019-01-24 16:32:25 +0000 |
commit | 9fc2b9ec49c54ec2d5f0164bbedc1c78732c464c (patch) | |
tree | c7ebcf4c83b5c2f71318bc69c6f6915aaac7ae2a /libparc/parc/concurrent/test | |
parent | cada1143501a48effc483e3873596c22849926b5 (diff) | |
parent | 097e69e6daeefc84fd271babbdc1b47dfe4c01e5 (diff) |
Merge "Add support for ubuntu18.04 packages."
Diffstat (limited to 'libparc/parc/concurrent/test')
-rw-r--r-- | libparc/parc/concurrent/test/test_parc_ScheduledThreadPool.c | 4 | ||||
-rw-r--r-- | libparc/parc/concurrent/test/test_parc_Thread.c | 15 | ||||
-rw-r--r-- | libparc/parc/concurrent/test/test_parc_ThreadPool.c | 2 |
3 files changed, 18 insertions, 3 deletions
diff --git a/libparc/parc/concurrent/test/test_parc_ScheduledThreadPool.c b/libparc/parc/concurrent/test/test_parc_ScheduledThreadPool.c index f466d72a..e2e2473c 100644 --- a/libparc/parc/concurrent/test/test_parc_ScheduledThreadPool.c +++ b/libparc/parc/concurrent/test/test_parc_ScheduledThreadPool.c @@ -80,7 +80,7 @@ LONGBOW_TEST_CASE(CreateAcquireRelease, CreateRelease) parcObjectTesting_AssertAcquireReleaseContract(parcScheduledThreadPool_Acquire, instance); parcScheduledThreadPool_ShutdownNow(instance); - assertTrue(parcObject_GetReferenceCount(instance) == 1, "Expected 1 reference count. Actual %llu", parcObject_GetReferenceCount(instance)); + assertTrue(parcObject_GetReferenceCount(instance) == 1, "Expected 1 reference count. Actual %lu", parcObject_GetReferenceCount(instance)); parcScheduledThreadPool_Release(&instance); assertNull(instance, "Expected null result from parcScheduledThreadPool_Release();"); @@ -260,7 +260,7 @@ LONGBOW_TEST_CASE(Specialization, OneJob) PARCFutureTask *task = parcFutureTask_Create(_function, _function); parcScheduledThreadPool_Schedule(pool, task, parcTimeout_MilliSeconds(2000)); - printf("references %lld\n", parcObject_GetReferenceCount(task)); + printf("references %lu\n", parcObject_GetReferenceCount(task)); parcFutureTask_Release(&task); sleep(5); diff --git a/libparc/parc/concurrent/test/test_parc_Thread.c b/libparc/parc/concurrent/test/test_parc_Thread.c index 22ca31bf..679f58d0 100644 --- a/libparc/parc/concurrent/test/test_parc_Thread.c +++ b/libparc/parc/concurrent/test/test_parc_Thread.c @@ -72,7 +72,12 @@ LONGBOW_TEST_FIXTURE_TEARDOWN(CreateAcquireRelease) PARCBuffer *buffer = longBowTestCase_Get(testCase, "object"); parcBuffer_Release(&buffer); +#if INTPTR_MAX == INT32_MAX uint32_t initialAllocations = (uint32_t) longBowTestCase_Get(testCase, "initialAllocations"); +#else + uint64_t initialAllocations = (uint64_t) longBowTestCase_Get(testCase, "initialAllocations"); +#endif + if (!parcMemoryTesting_ExpectedOutstanding(initialAllocations, "%s leaked memory.", longBowTestCase_GetFullName(testCase))) { parcSafeMemory_ReportAllocation(1); return LONGBOW_STATUS_MEMORYLEAK; @@ -126,7 +131,12 @@ LONGBOW_TEST_FIXTURE_TEARDOWN(Object) PARCBuffer *buffer = longBowTestCase_Get(testCase, "object"); parcBuffer_Release(&buffer); +#if INTPTR_MAX == INT32_MAX uint32_t initialAllocations = (uint32_t) longBowTestCase_Get(testCase, "initialAllocations"); +#else + uint64_t initialAllocations = (uint64_t) longBowTestCase_Get(testCase, "initialAllocations"); +#endif + if (!parcMemoryTesting_ExpectedOutstanding(initialAllocations, "%s leaked memory.", longBowTestCase_GetFullName(testCase))) { parcSafeMemory_ReportAllocation(1); return LONGBOW_STATUS_MEMORYLEAK; @@ -239,7 +249,12 @@ LONGBOW_TEST_FIXTURE_SETUP(Specialization) LONGBOW_TEST_FIXTURE_TEARDOWN(Specialization) { +#if INTPTR_MAX == INT32_MAX uint32_t initialAllocations = (uint32_t) longBowTestCase_Get(testCase, "initialAllocations"); +#else + uint64_t initialAllocations = (uint64_t) longBowTestCase_Get(testCase, "initialAllocations"); +#endif + if (!parcMemoryTesting_ExpectedOutstanding(initialAllocations, "%s leaked memory.", longBowTestCase_GetFullName(testCase))) { parcSafeMemory_ReportAllocation(1); return LONGBOW_STATUS_MEMORYLEAK; diff --git a/libparc/parc/concurrent/test/test_parc_ThreadPool.c b/libparc/parc/concurrent/test/test_parc_ThreadPool.c index 6ed6e4d3..5ec60fa5 100644 --- a/libparc/parc/concurrent/test/test_parc_ThreadPool.c +++ b/libparc/parc/concurrent/test/test_parc_ThreadPool.c @@ -255,7 +255,7 @@ LONGBOW_TEST_CASE(Object, parcThreadPool_Execute) assertTrue(shutdownSuccess, "parcThreadPool_AwaitTermination timed-out"); uint64_t count = parcThreadPool_GetCompletedTaskCount(pool); - assertTrue(count == 5, "Expected 5, actual %lld", count); + assertTrue(count == 5, "Expected 5, actual %lu", count); parcThreadPool_Release(&pool); |