gem5  v20.1.0.0
Macros | Functions
cprintf.test.cc File Reference
#include <gtest/gtest.h>
#include <cstdio>
#include <sstream>
#include <string>
#include "base/cprintf.hh"

Go to the source code of this file.

Macros

#define CPRINTF_TEST(...)
 

Functions

 TEST (CPrintf, Misc)
 
 TEST (CPrintf, FloatingPoint)
 
 TEST (CPrintf, Types)
 
 TEST (CPrintf, SpecialFormatting)
 

Macro Definition Documentation

◆ CPRINTF_TEST

#define CPRINTF_TEST (   ...)
Value:
do { \
std::stringstream ss; \
ccprintf(ss, __VA_ARGS__); \
int maxlen = ss.str().length() + 3; \
char *buf = new char[maxlen]; \
buf[maxlen - 1] = '\0'; \
snprintf(buf, maxlen - 2, __VA_ARGS__); \
EXPECT_EQ(ss.str(), std::string(buf)); \
delete [] buf; \
} while (0)

Definition at line 37 of file cprintf.test.cc.

Function Documentation

◆ TEST() [1/4]

TEST ( CPrintf  ,
FloatingPoint   
)

Definition at line 67 of file cprintf.test.cc.

References CPRINTF_TEST, and ArmISA::f.

◆ TEST() [2/4]

TEST ( CPrintf  ,
Misc   
)

Definition at line 49 of file cprintf.test.cc.

References CPRINTF_TEST, and GuestABI::foo().

◆ TEST() [3/4]

TEST ( CPrintf  ,
SpecialFormatting   
)

Definition at line 174 of file cprintf.test.cc.

References CPRINTF_TEST.

◆ TEST() [4/4]

TEST ( CPrintf  ,
Types   
)

Definition at line 156 of file cprintf.test.cc.

References ccprintf(), CPRINTF_TEST, EXPECT_EQ, and ArmISA::ss.

ArmISA::ss
Bitfield< 21 > ss
Definition: miscregs_types.hh:56

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