gem5  v20.1.0.0
Classes | Functions | Variables
fiber.test.cc File Reference
#include <gtest/gtest.h>
#include <initializer_list>
#include <iostream>
#include <vector>
#include "base/fiber.hh"

Go to the source code of this file.

Classes

class  SwitchingFiber
 
class  LinkedFiber
 

Functions

 TEST (Fiber, Starting)
 This test is checking if the "started" member has its expected value before and after the fiber runs. More...
 
SwitchingFiber a ("A", { &b, &a, Fiber::primaryFiber(), &b, &c })
 
SwitchingFiber b ("B", { &a, &c })
 
SwitchingFiber c ("C", { &a, Fiber::primaryFiber(), Fiber::primaryFiber() })
 
 TEST (Fiber, Switching)
 
 TEST (Fiber, Linked)
 

Variables

SwitchingFiber a
 
SwitchingFiber b
 
SwitchingFiber c
 
std::vector< SwitchingFiber * >::iterator expectedIt
 
std::vector< SwitchingFiber * > expected ({ &a, &b, &a, &a, &a, &b, &c, &a, &c, &c, &c })
 
int currentIndex = 0
 

Function Documentation

◆ a()

SwitchingFiber a ( "A"  ,
{ &b, &a, Fiber::primaryFiber(), &b, &c  
)

◆ b()

SwitchingFiber b ( "B"  ,
{ &a, &c  
)

◆ c()

◆ TEST() [1/3]

TEST ( Fiber  ,
Linked   
)

Definition at line 161 of file fiber.test.cc.

References currentIndex, EXPECT_EQ, Fiber::primaryFiber(), and Fiber::run().

◆ TEST() [2/3]

TEST ( Fiber  ,
Starting   
)

This test is checking if the "started" member has its expected value before and after the fiber runs.

In the test an empty fiber is used since we are just interested on the _started member and nothing more.

Do nothing

Definition at line 53 of file fiber.test.cc.

References Fiber::Fiber(), Fiber::main(), and Fiber::primaryFiber().

◆ TEST() [3/3]

TEST ( Fiber  ,
Switching   
)

Definition at line 121 of file fiber.test.cc.

References a, b, c, EXPECT_EQ, EXPECT_FALSE, EXPECT_TRUE, expected, expectedIt, Fiber::finished(), and Fiber::run().

Variable Documentation

◆ a

SwitchingFiber a("A", { &b, &a, Fiber::primaryFiber(), &b, &c })

Referenced by TEST().

◆ b

SwitchingFiber b("B", { &a, &c })

Referenced by TEST().

◆ c

Referenced by TEST().

◆ currentIndex

int currentIndex = 0

Definition at line 145 of file fiber.test.cc.

Referenced by LinkedFiber::main(), and TEST().

◆ expected

std::vector<SwitchingFiber *> expected({ &a, &b, &a, &a, &a, &b, &c, &a, &c, &c, &c })

◆ expectedIt

std::vector<SwitchingFiber *>::iterator expectedIt

Definition at line 91 of file fiber.test.cc.

Referenced by SwitchingFiber::checkExpected(), and TEST().


Generated on Wed Sep 30 2020 14:02:18 for gem5 by doxygen 1.8.17