gem5  v20.1.0.0
Classes | Namespaces | Macros | Typedefs | Functions | Variables
proxy_ptr.test.cc File Reference
#include <gtest/gtest.h>
#include <vector>
#include "sim/proxy_ptr.hh"

Go to the source code of this file.

Classes

struct  Access
 
class  BackingStore
 
class  TestProxy
 
struct  TestABI
 
struct  GuestABI::Argument< TestABI, Addr >
 

Namespaces

 GuestABI
 

Macros

#define EXPECT_ACCESSES(store, ...)
 

Typedefs

using Accesses = std::vector< Access >
 
template<typename T >
using TestPtr = ProxyPtr< T, TestProxy >
 
template<typename T >
using ConstTestPtr = ConstProxyPtr< T, TestProxy >
 

Functions

::testing::AssertionResult accessed (const char *expr1, const char *expr2, const BackingStore &store, const Accesses &expected)
 
std::ostream & operator<< (std::ostream &os, const Access &access)
 
 TEST (ProxyPtr, Clean)
 
 TEST (ProxyPtr, Dirty)
 
 TEST (ProxyPtr, LoadAndFlush)
 
 TEST (ProxyPtr, ConstOperators)
 
 TEST (ProxyPtr, NonConstOperators)
 
void abiTestFunc (ThreadContext *tc, TestPtr< uint8_t > ptr)
 
void abiTestFuncConst (ThreadContext *tc, ConstTestPtr< uint8_t > ptr)
 
 TEST (ProxyPtr, GuestABI)
 

Variables

bool abiCalled = false
 
bool abiCalledConst = false
 

Macro Definition Documentation

◆ EXPECT_ACCESSES

#define EXPECT_ACCESSES (   store,
  ... 
)
Value:
do { \
Accesses expected({__VA_ARGS__}); \
EXPECT_PRED_FORMAT2(accessed, store, expected); \
store.accesses.clear(); \
} while (false)

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

Typedef Documentation

◆ Accesses

Definition at line 59 of file proxy_ptr.test.cc.

◆ ConstTestPtr

template<typename T >
using ConstTestPtr = ConstProxyPtr<T, TestProxy>

Definition at line 186 of file proxy_ptr.test.cc.

◆ TestPtr

template<typename T >
using TestPtr = ProxyPtr<T, TestProxy>

Definition at line 183 of file proxy_ptr.test.cc.

Function Documentation

◆ abiTestFunc()

void abiTestFunc ( ThreadContext tc,
TestPtr< uint8_t >  ptr 
)

Definition at line 490 of file proxy_ptr.test.cc.

References abiCalled, ConstProxyPtr< T, Proxy >::addr(), and EXPECT_EQ.

Referenced by TEST().

◆ abiTestFuncConst()

void abiTestFuncConst ( ThreadContext tc,
ConstTestPtr< uint8_t >  ptr 
)

Definition at line 497 of file proxy_ptr.test.cc.

References abiCalledConst, ConstProxyPtr< T, Proxy >::addr(), and EXPECT_EQ.

Referenced by TEST().

◆ accessed()

::testing::AssertionResult accessed ( const char *  expr1,
const char *  expr2,
const BackingStore store,
const Accesses expected 
)

Definition at line 139 of file proxy_ptr.test.cc.

References BackingStore::expect_accesses(), and expected.

◆ operator<<()

std::ostream& operator<< ( std::ostream &  os,
const Access access 
)

Definition at line 153 of file proxy_ptr.test.cc.

References Access::addr, ccprintf(), X86ISA::os, Access::read, and Access::size.

◆ TEST() [1/6]

TEST ( ProxyPtr  ,
Clean   
)

Definition at line 188 of file proxy_ptr.test.cc.

References ConstProxyPtr< T, Proxy >::addr(), and EXPECT_ACCESSES.

◆ TEST() [2/6]

TEST ( ProxyPtr  ,
ConstOperators   
)

◆ TEST() [3/6]

TEST ( ProxyPtr  ,
Dirty   
)

◆ TEST() [4/6]

TEST ( ProxyPtr  ,
GuestABI   
)

◆ TEST() [5/6]

TEST ( ProxyPtr  ,
LoadAndFlush   
)

Definition at line 233 of file proxy_ptr.test.cc.

References EXPECT_EQ, ProxyPtr< T, Proxy >::flush(), and BackingStore::store.

◆ TEST() [6/6]

TEST ( ProxyPtr  ,
NonConstOperators   
)

Variable Documentation

◆ abiCalled

bool abiCalled = false

Definition at line 486 of file proxy_ptr.test.cc.

Referenced by abiTestFunc(), and TEST().

◆ abiCalledConst

bool abiCalledConst = false

Definition at line 487 of file proxy_ptr.test.cc.

Referenced by abiTestFuncConst(), and TEST().

accessed
::testing::AssertionResult accessed(const char *expr1, const char *expr2, const BackingStore &store, const Accesses &expected)
Definition: proxy_ptr.test.cc:139
expected
std::vector< SwitchingFiber * > expected({ &a, &b, &a, &a, &a, &b, &c, &a, &c, &c, &c })

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