gem5  v21.2.0.0
Classes | Functions | Variables 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.


class  SwitchingFiber
class  LinkedFiber


 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)


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  ,

Definition at line 163 of file

References currentIndex, and gem5::Fiber::run().

◆ TEST() [2/3]

TEST ( Fiber  ,

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

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

◆ TEST() [3/3]

TEST ( Fiber  ,

Definition at line 123 of file

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

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

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

Generated on Tue Dec 21 2021 11:34:44 for gem5 by doxygen 1.8.17