1 // 2 // Copyright © 2017 Arm Ltd. All rights reserved. 3 // SPDX-License-Identifier: MIT 4 // 5 6 #include <doctest/doctest.h> 7 8 #include <ExecutionFrame.hpp> 9 10 // Test that the values set in m_NextExecutionFrame are correct. 11 // The execution order is given by the m_NextExecutionFrame in each ExecutionFrame. 12 // A 13 // | 14 // B 15 // | 16 // C 17 TEST_SUITE("NextExecutionFrameTestSuite") 18 { 19 TEST_CASE("NextExecutionFrameTest") 20 { 21 armnn::ExecutionFrame executionFrameA; 22 armnn::ExecutionFrame executionFrameB; 23 armnn::ExecutionFrame executionFrameC; 24 25 executionFrameA.SetNextExecutionFrame(&executionFrameB); 26 executionFrameB.SetNextExecutionFrame(&executionFrameC); 27 //not setting C to check that the default setting is nullptr. 28 29 auto nextExecutionFrameA = executionFrameA.ExecuteWorkloads(nullptr); 30 auto nextExecutionFrameB = executionFrameB.ExecuteWorkloads(&executionFrameA); 31 auto nextExecutionFrameC = executionFrameC.ExecuteWorkloads(&executionFrameB); 32 33 CHECK_EQ(nextExecutionFrameA, &executionFrameB); 34 CHECK_EQ(nextExecutionFrameB, &executionFrameC); 35 36 CHECK(!nextExecutionFrameC); 37 38 CHECK_NE(nextExecutionFrameA, &executionFrameC); 39 } 40 } 41 42