coroutine.test.cc (13465:dee578a46d87) | coroutine.test.cc (14067:2c3667b32607) |
---|---|
1/* 2 * Copyright (c) 2018 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 30 unchanged lines hidden (view full) --- 39 40#include <gtest/gtest.h> 41 42#include "base/coroutine.hh" 43 44using namespace m5; 45 46/** | 1/* 2 * Copyright (c) 2018 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 30 unchanged lines hidden (view full) --- 39 40#include <gtest/gtest.h> 41 42#include "base/coroutine.hh" 43 44using namespace m5; 45 46/** |
47 * This test is checking if the Coroutine, once it's created 48 * it doesn't start since the second argument of the constructor 49 * (run_coroutine) is set to false 50 */ 51TEST(Coroutine, Unstarted) 52{ 53 auto yielding_task = 54 [] (Coroutine<void, void>::CallerType& yield) 55 { 56 yield(); 57 }; 58 59 const bool start_upon_creation = false; 60 Coroutine<void, void> coro(yielding_task, start_upon_creation); 61 62 ASSERT_FALSE(coro.started()); 63} 64 65/** |
|
47 * This test is checking if the Coroutine, once it yields 48 * back to the caller, it is still marked as not finished. 49 */ 50TEST(Coroutine, Unfinished) 51{ 52 auto yielding_task = 53 [] (Coroutine<void, void>::CallerType& yield) 54 { --- 208 unchanged lines hidden --- | 66 * This test is checking if the Coroutine, once it yields 67 * back to the caller, it is still marked as not finished. 68 */ 69TEST(Coroutine, Unfinished) 70{ 71 auto yielding_task = 72 [] (Coroutine<void, void>::CallerType& yield) 73 { --- 208 unchanged lines hidden --- |