diff options
author | Giovanni Conte <gconte@cisco.com> | 2019-01-16 12:09:43 +0100 |
---|---|---|
committer | Giovanni Conte <gconte@cisco.com> | 2019-01-16 18:15:26 +0100 |
commit | 33b53c7f5cef4cf19770a38baa4b627f234322cf (patch) | |
tree | 619dc322af2616fea2c97d812b69131aa26f45a8 /libparc/parc/concurrent/test | |
parent | db496684a300b2d65ae7739c918177111d5a3500 (diff) |
removed longbow dependency
Change-Id: I0c224b26261c7b24699410fc5e41ed6f3fab9815
Signed-off-by: Giovanni Conte <gconte@cisco.com>
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); |