From 33b53c7f5cef4cf19770a38baa4b627f234322cf Mon Sep 17 00:00:00 2001 From: Giovanni Conte Date: Wed, 16 Jan 2019 12:09:43 +0100 Subject: removed longbow dependency Change-Id: I0c224b26261c7b24699410fc5e41ed6f3fab9815 Signed-off-by: Giovanni Conte --- .../parc/concurrent/test/test_parc_ScheduledThreadPool.c | 4 ++-- libparc/parc/concurrent/test/test_parc_Thread.c | 15 +++++++++++++++ libparc/parc/concurrent/test/test_parc_ThreadPool.c | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) (limited to 'libparc/parc/concurrent/test') 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); -- cgit 1.2.3-korg