Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
cybozu::test Namespace Reference

Classes

class  AutoRun
 

Functions

void test (bool ret, const std::string &msg, const std::string &param, const char *file, int line)
 
template<typename T , typename U >
bool isEqual (const T &lhs, const U &rhs)
 
bool isEqual (size_t lhs, int rhs)
 
bool isEqual (int lhs, size_t rhs)
 
bool isEqual (const char *lhs, const char *rhs)
 
bool isEqual (char *lhs, const char *rhs)
 
bool isEqual (const char *lhs, char *rhs)
 
bool isEqual (char *lhs, char *rhs)
 
bool isEqual (float lhs, float rhs)
 
bool isEqual (double lhs, double rhs)
 

Function Documentation

◆ isEqual() [1/9]

bool cybozu::test::isEqual ( char * lhs,
char * rhs )
inline

Definition at line 152 of file test.hpp.

153{
154 return strcmp(lhs, rhs) == 0;
155}

◆ isEqual() [2/9]

bool cybozu::test::isEqual ( char * lhs,
const char * rhs )
inline

Definition at line 144 of file test.hpp.

145{
146 return strcmp(lhs, rhs) == 0;
147}

◆ isEqual() [3/9]

bool cybozu::test::isEqual ( const char * lhs,
char * rhs )
inline

Definition at line 148 of file test.hpp.

149{
150 return strcmp(lhs, rhs) == 0;
151}

◆ isEqual() [4/9]

bool cybozu::test::isEqual ( const char * lhs,
const char * rhs )
inline

Definition at line 140 of file test.hpp.

141{
142 return strcmp(lhs, rhs) == 0;
143}

◆ isEqual() [5/9]

template<typename T , typename U >
bool cybozu::test::isEqual ( const T & lhs,
const U & rhs )

Definition at line 126 of file test.hpp.

127{
128 return lhs == rhs;
129}

◆ isEqual() [6/9]

bool cybozu::test::isEqual ( double lhs,
double rhs )
inline

Definition at line 168 of file test.hpp.

169{
170 union di {
171 double d;
172 uint64_t i;
173 } ldi, rdi;
174 ldi.d = lhs;
175 rdi.d = rhs;
176 return ldi.i == rdi.i;
177}
unsigned __int64 uint64_t
Definition stdint.h:136
CK_ULONG d

◆ isEqual() [7/9]

bool cybozu::test::isEqual ( float lhs,
float rhs )
inline

Definition at line 157 of file test.hpp.

158{
159 union fi {
160 float f;
161 uint32_t i;
162 } lfi, rfi;
163 lfi.f = lhs;
164 rfi.f = rhs;
165 return lfi.i == rfi.i;
166}
unsigned int uint32_t
Definition stdint.h:126

◆ isEqual() [8/9]

bool cybozu::test::isEqual ( int lhs,
size_t rhs )
inline

Definition at line 136 of file test.hpp.

137{
138 return size_t(lhs) == rhs;
139}

◆ isEqual() [9/9]

bool cybozu::test::isEqual ( size_t lhs,
int rhs )
inline

Definition at line 132 of file test.hpp.

133{
134 return lhs == size_t(rhs);
135}

◆ test()

void cybozu::test::test ( bool ret,
const std::string & msg,
const std::string & param,
const char * file,
int line )
inline

Definition at line 117 of file test.hpp.

118{
119 autoRun.set(ret);
120 if (!ret) {
121 printf("%s(%d):ctest:%s(%s);\n", file, line, msg.c_str(), param.c_str());
122 }
123}
void set(bool isOK)
Definition test.hpp:44
CK_RV ret
Here is the call graph for this function: