gem5 v24.0.0.0
Loading...
Searching...
No Matches
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  gem5::guest_abi::Argument< TestABI, Addr >
 

Namespaces

namespace  gem5
 Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
 
namespace  gem5::guest_abi
 

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 (ProxyPtrTest, 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)
std::vector< SwitchingFiber * > expected({ &a, &b, &a, &a, &a, &b, &c, &a, &c, &c, &c })
::testing::AssertionResult accessed(const char *expr1, const char *expr2, const BackingStore &store, const Accesses &expected)

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

Referenced by TEST(), and TEST().

Typedef Documentation

◆ Accesses

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

◆ ConstTestPtr

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

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

◆ TestPtr

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

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

Function Documentation

◆ abiTestFunc()

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

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

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

Referenced by TEST().

◆ abiTestFuncConst()

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

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

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

Referenced by TEST().

◆ accessed()

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

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

References BackingStore::expect_accesses(), and expected().

◆ operator<<()

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

◆ TEST() [1/6]

TEST ( ProxyPtr ,
Clean  )

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

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

◆ TEST() [2/6]

◆ TEST() [3/6]

TEST ( ProxyPtr ,
Dirty  )

◆ TEST() [4/6]

◆ TEST() [5/6]

◆ TEST() [6/6]

TEST ( ProxyPtrTest ,
GuestABI  )

Variable Documentation

◆ abiCalled

bool abiCalled = false

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

Referenced by abiTestFunc(), and TEST().

◆ abiCalledConst

bool abiCalledConst = false

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

Referenced by abiTestFuncConst(), and TEST().


Generated on Tue Jun 18 2024 16:24:08 for gem5 by doxygen 1.11.0