gem5  v21.1.0.2
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 39 of file cprintf.test.cc.

Function Documentation

◆ TEST() [1/4]

TEST ( CPrintf  ,
FloatingPoint   
)

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

References CPRINTF_TEST, and gem5::ArmISA::f.

◆ TEST() [2/4]

TEST ( CPrintf  ,
Misc   
)

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

References CPRINTF_TEST.

◆ TEST() [3/4]

TEST ( CPrintf  ,
SpecialFormatting   
)

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

References CPRINTF_TEST.

◆ TEST() [4/4]

TEST ( CPrintf  ,
Types   
)

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

References gem5::ccprintf(), CPRINTF_TEST, and ss.

ss
std::stringstream ss
Definition: trace.test.cc:45

Generated on Tue Sep 21 2021 12:26:26 for gem5 by doxygen 1.8.17