gem5  v22.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() })
 
std::vector< SwitchingFiber * > expected ({ &a, &b, &a, &a, &a, &b, &c, &a, &c, &c, &c })
 
 TEST (Fiber, Switching)
 
 TEST (Fiber, Linked)
 

Variables

SwitchingFiber a
 
SwitchingFiber b
 
SwitchingFiber c
 
std::vector< SwitchingFiber * >::iterator expectedIt
 
int currentIndex = 0
 

Function Documentation

◆ a()

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

References a, b, c, and gem5::Fiber::primaryFiber().

◆ b()

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

References a, and c.

◆ c()

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

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

◆ expected()

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

◆ 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 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 a(), b(), c(), expected(), and TEST().

◆ b

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

Referenced by a(), expected(), and TEST().

◆ c

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

Referenced by a(), b(), expected(), and TEST().

◆ currentIndex

int currentIndex = 0

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

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

◆ expectedIt

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

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

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


Generated on Wed Dec 21 2022 10:22:53 for gem5 by doxygen 1.9.1