Go to the documentation of this file.
40 #include <gtest/gtest.h>
42 #include <initializer_list>
55 class StartingFiber :
public Fiber
64 ASSERT_FALSE(fiber.started());
68 ASSERT_TRUE(fiber.started());
99 const char *
name, std::initializer_list<Fiber *>
l) :
115 for (
auto &
n :
next) {
140 "Didn't exactly use up the expected Fiber sequence";
Fiber(size_t stack_size=DefaultStackSize)
bool finished() const
Returns whether the "main" function of this fiber has finished.
LinkedFiber(Fiber *link, int index)
void main()
This method is called when this fiber is first run.
#define EXPECT_EQ(lhs, rhs)
A macro which verifies that lhs and rhs are equal to each other.
#define EXPECT_FALSE(expr)
A macro which verifies that expr evaluates to false.
static Fiber * primaryFiber()
Get a pointer to the primary Fiber.
This class represents a fiber, which is a light weight sort of thread which is cooperatively schedule...
std::vector< Fiber * > next
TEST(Fiber, Starting)
This test is checking if the "started" member has its expected value before and after the fiber runs.
#define EXPECT_TRUE(expr)
A macro which verifies that expr evaluates to true.
void main()
This method is called when this fiber is first run.
void run()
Start executing the fiber represented by this object.
const std::string & name()
std::vector< SwitchingFiber * >::iterator expectedIt
virtual void main()=0
This method is called when this fiber is first run.
SwitchingFiber(const char *name, std::initializer_list< Fiber * > l)
std::vector< SwitchingFiber * > expected({ &a, &b, &a, &a, &a, &b, &c, &a, &c, &c, &c })
Generated on Wed Sep 30 2020 14:02:07 for gem5 by doxygen 1.8.17