gem5  v21.1.0.2
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()

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

◆ TEST() [1/3]

TEST ( Fiber  ,
Linked   
)

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

References currentIndex, and gem5::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 55 of file fiber.test.cc.

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

◆ TEST() [3/3]

TEST ( Fiber  ,
Switching   
)

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

References a, b, c, expected, expectedIt, gem5::Fiber::finished(), and gem5::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

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

Referenced by TEST().

◆ currentIndex

int currentIndex = 0

Definition at line 147 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 93 of file fiber.test.cc.

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


Generated on Tue Sep 21 2021 12:26:26 for gem5 by doxygen 1.8.17