kfdtest: Consolidate logic for ASSERT vs EXPECT

ASSERT failures result in immediate termination of the test. EXPECT
returns a failure but continues execution. Reserve ASSERT for required
functionality (node initialization, queue creation, etc) where the rest
of the test cannot run if that call fails. Use EXPECT everywhere else

Change-Id: I1c11326fc3ae22b50fa83b07b3b49af1e1f4e69e


[ROCm/ROCR-Runtime commit: fe33461622]
This commit is contained in:
Kent Russell
2018-08-20 09:54:26 -04:00
szülő b86f145610
commit 52536ba23b
17 fájl változott, egészen pontosan 208 új sor hozzáadva és 209 régi sor törölve
@@ -99,9 +99,9 @@ TEST_F(KFDEventTest, SignalEvent) {
queue.Wait4PacketConsumption();
ASSERT_SUCCESS(hsaKmtWaitOnEvent(m_pHsaEvent, g_TestTimeOut));
EXPECT_SUCCESS(hsaKmtWaitOnEvent(m_pHsaEvent, g_TestTimeOut));
ASSERT_SUCCESS(queue.Destroy());
EXPECT_SUCCESS(queue.Destroy());
TEST_END;
}
@@ -184,8 +184,7 @@ exit:
uint64_t minTime = ULONG_MAX, maxTime = 0;
uint64_t minLat = ULONG_MAX, maxLat = 0;
r = queueAndSignalEvents(node, mNumEvents, time, latency);
ASSERT_EQ(r, HSAKMT_STATUS_SUCCESS);
ASSERT_EQ(queueAndSignalEvents(node, mNumEvents, time, latency), HSAKMT_STATUS_SUCCESS);
mTimeHistory[mHistorySlot%HISTORY_SIZE] = time;
mLatHistory[mHistorySlot%HISTORY_SIZE] = latency;
@@ -275,9 +274,9 @@ TEST_F(KFDEventTest, SignalMultipleEventsWaitForAll) {
Delay(WAIT_BETWEEN_SUBMISSIONS_MS);
}
ASSERT_SUCCESS(hsaKmtWaitOnMultipleEvents(pHsaEvent, EVENT_NUMBER, true, g_TestTimeOut));
EXPECT_SUCCESS(hsaKmtWaitOnMultipleEvents(pHsaEvent, EVENT_NUMBER, true, g_TestTimeOut));
ASSERT_SUCCESS(queue.Destroy());
EXPECT_SUCCESS(queue.Destroy());
for (i = 0; i < EVENT_NUMBER; i++)
EXPECT_SUCCESS(hsaKmtDestroyEvent(pHsaEvent[i]));