gem5 v24.0.0.0
Loading...
Searching...
No Matches
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)
Bitfield< 21 > ss
Definition misc_types.hh:60

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

Referenced by TEST(), TEST(), TEST(), and TEST().

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 gem5::ArmISA::ss.


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