Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
flatbuffers
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
flatbuffers
Commits
c3c32ec9
Commit
c3c32ec9
authored
Nov 25, 2019
by
Vladimir Glavnyy
Committed by
Wouter van Oortmerssen
Nov 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ambiguity of a type deduction in TEST_EQ macro if arguments have `enum class` type. (#5630)
parent
075e8d67
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
100 additions
and
43 deletions
+100
-43
stl_emulation.h
include/flatbuffers/stl_emulation.h
+24
-4
test.cpp
tests/test.cpp
+18
-22
test_assert.cpp
tests/test_assert.cpp
+4
-4
test_assert.h
tests/test_assert.h
+54
-13
No files found.
include/flatbuffers/stl_emulation.h
View file @
c3c32ec9
...
@@ -96,13 +96,13 @@ inline void vector_emplace_back(std::vector<T> *vector, V &&data) {
...
@@ -96,13 +96,13 @@ inline void vector_emplace_back(std::vector<T> *vector, V &&data) {
}
}
};
};
template
<>
class
numeric_limits
<
float
>
:
template
<>
class
numeric_limits
<
float
>
:
public
std
::
numeric_limits
<
float
>
{
public
std
::
numeric_limits
<
float
>
{
public
:
public
:
static
float
lowest
()
{
return
-
FLT_MAX
;
}
static
float
lowest
()
{
return
-
FLT_MAX
;
}
};
};
template
<>
class
numeric_limits
<
double
>
:
template
<>
class
numeric_limits
<
double
>
:
public
std
::
numeric_limits
<
double
>
{
public
std
::
numeric_limits
<
double
>
{
public
:
public
:
static
double
lowest
()
{
return
-
DBL_MAX
;
}
static
double
lowest
()
{
return
-
DBL_MAX
;
}
...
@@ -138,18 +138,20 @@ inline void vector_emplace_back(std::vector<T> *vector, V &&data) {
...
@@ -138,18 +138,20 @@ inline void vector_emplace_back(std::vector<T> *vector, V &&data) {
template
<
typename
T
,
typename
U
>
using
is_same
=
std
::
is_same
<
T
,
U
>
;
template
<
typename
T
,
typename
U
>
using
is_same
=
std
::
is_same
<
T
,
U
>
;
template
<
typename
T
>
using
is_floating_point
=
std
::
is_floating_point
<
T
>
;
template
<
typename
T
>
using
is_floating_point
=
std
::
is_floating_point
<
T
>
;
template
<
typename
T
>
using
is_unsigned
=
std
::
is_unsigned
<
T
>
;
template
<
typename
T
>
using
is_unsigned
=
std
::
is_unsigned
<
T
>
;
template
<
typename
T
>
using
is_enum
=
std
::
is_enum
<
T
>
;
template
<
typename
T
>
using
make_unsigned
=
std
::
make_unsigned
<
T
>
;
template
<
typename
T
>
using
make_unsigned
=
std
::
make_unsigned
<
T
>
;
template
<
bool
B
,
class
T
,
class
F
>
template
<
bool
B
,
class
T
,
class
F
>
using
conditional
=
std
::
conditional
<
B
,
T
,
F
>
;
using
conditional
=
std
::
conditional
<
B
,
T
,
F
>
;
template
<
class
T
,
T
v
>
template
<
class
T
,
T
v
>
using
integral_constant
=
std
::
integral_constant
<
T
,
v
>
;
using
integral_constant
=
std
::
integral_constant
<
T
,
v
>
;
#else
#else
// Map C++ TR1 templates defined by stlport.
// Map C++ TR1 templates defined by stlport.
template
<
typename
T
>
using
is_scalar
=
std
::
tr1
::
is_scalar
<
T
>
;
template
<
typename
T
>
using
is_scalar
=
std
::
tr1
::
is_scalar
<
T
>
;
template
<
typename
T
,
typename
U
>
using
is_same
=
std
::
tr1
::
is_same
<
T
,
U
>
;
template
<
typename
T
,
typename
U
>
using
is_same
=
std
::
tr1
::
is_same
<
T
,
U
>
;
template
<
typename
T
>
using
is_floating_point
=
template
<
typename
T
>
using
is_floating_point
=
std
::
tr1
::
is_floating_point
<
T
>
;
std
::
tr1
::
is_floating_point
<
T
>
;
template
<
typename
T
>
using
is_unsigned
=
std
::
tr1
::
is_unsigned
<
T
>
;
template
<
typename
T
>
using
is_unsigned
=
std
::
tr1
::
is_unsigned
<
T
>
;
template
<
typename
T
>
using
is_enum
=
std
::
tr1
::
is_enum
<
T
>
;
// Android NDK doesn't have std::make_unsigned or std::tr1::make_unsigned.
// Android NDK doesn't have std::make_unsigned or std::tr1::make_unsigned.
template
<
typename
T
>
struct
make_unsigned
{
template
<
typename
T
>
struct
make_unsigned
{
static_assert
(
is_unsigned
<
T
>::
value
,
"Specialization not implemented!"
);
static_assert
(
is_unsigned
<
T
>::
value
,
"Specialization not implemented!"
);
...
@@ -165,7 +167,7 @@ inline void vector_emplace_back(std::vector<T> *vector, V &&data) {
...
@@ -165,7 +167,7 @@ inline void vector_emplace_back(std::vector<T> *vector, V &&data) {
using
conditional
=
std
::
tr1
::
conditional
<
B
,
T
,
F
>
;
using
conditional
=
std
::
tr1
::
conditional
<
B
,
T
,
F
>
;
template
<
class
T
,
T
v
>
template
<
class
T
,
T
v
>
using
integral_constant
=
std
::
tr1
::
integral_constant
<
T
,
v
>
;
using
integral_constant
=
std
::
tr1
::
integral_constant
<
T
,
v
>
;
#endif // !FLATBUFFERS_CPP98_STL
#endif // !FLATBUFFERS_CPP98_STL
#else
#else
// MSVC 2010 doesn't support C++11 aliases.
// MSVC 2010 doesn't support C++11 aliases.
template
<
typename
T
>
struct
is_scalar
:
public
std
::
is_scalar
<
T
>
{};
template
<
typename
T
>
struct
is_scalar
:
public
std
::
is_scalar
<
T
>
{};
...
@@ -173,6 +175,7 @@ inline void vector_emplace_back(std::vector<T> *vector, V &&data) {
...
@@ -173,6 +175,7 @@ inline void vector_emplace_back(std::vector<T> *vector, V &&data) {
template
<
typename
T
>
struct
is_floating_point
:
template
<
typename
T
>
struct
is_floating_point
:
public
std
::
is_floating_point
<
T
>
{};
public
std
::
is_floating_point
<
T
>
{};
template
<
typename
T
>
struct
is_unsigned
:
public
std
::
is_unsigned
<
T
>
{};
template
<
typename
T
>
struct
is_unsigned
:
public
std
::
is_unsigned
<
T
>
{};
template
<
typename
T
>
struct
is_enum
:
public
std
::
is_enum
<
T
>
{};
template
<
typename
T
>
struct
make_unsigned
:
public
std
::
make_unsigned
<
T
>
{};
template
<
typename
T
>
struct
make_unsigned
:
public
std
::
make_unsigned
<
T
>
{};
template
<
bool
B
,
class
T
,
class
F
>
template
<
bool
B
,
class
T
,
class
F
>
struct
conditional
:
public
std
::
conditional
<
B
,
T
,
F
>
{};
struct
conditional
:
public
std
::
conditional
<
B
,
T
,
F
>
{};
...
@@ -280,6 +283,23 @@ inline void vector_emplace_back(std::vector<T> *vector, V &&data) {
...
@@ -280,6 +283,23 @@ inline void vector_emplace_back(std::vector<T> *vector, V &&data) {
template
<
class
T
>
bool
operator
==
(
const
unique_ptr
<
T
>&
x
,
intptr_t
y
)
{
template
<
class
T
>
bool
operator
==
(
const
unique_ptr
<
T
>&
x
,
intptr_t
y
)
{
return
reinterpret_cast
<
intptr_t
>
(
x
.
get
())
==
y
;
return
reinterpret_cast
<
intptr_t
>
(
x
.
get
())
==
y
;
}
}
template
<
class
T
>
bool
operator
!=
(
const
unique_ptr
<
T
>&
x
,
decltype
(
nullptr
))
{
return
!!
x
;
}
template
<
class
T
>
bool
operator
!=
(
decltype
(
nullptr
),
const
unique_ptr
<
T
>&
x
)
{
return
!!
x
;
}
template
<
class
T
>
bool
operator
==
(
const
unique_ptr
<
T
>&
x
,
decltype
(
nullptr
))
{
return
!
x
;
}
template
<
class
T
>
bool
operator
==
(
decltype
(
nullptr
),
const
unique_ptr
<
T
>&
x
)
{
return
!
x
;
}
#endif // !FLATBUFFERS_CPP98_STL
#endif // !FLATBUFFERS_CPP98_STL
}
// namespace flatbuffers
}
// namespace flatbuffers
...
...
tests/test.cpp
View file @
c3c32ec9
...
@@ -1394,7 +1394,7 @@ void FuzzTest2() {
...
@@ -1394,7 +1394,7 @@ void FuzzTest2() {
break
;
break
;
}
}
}
}
TEST_NOTNULL
(
NULL
);
TEST_NOTNULL
(
nullptr
);
}
}
// clang-format off
// clang-format off
...
@@ -2985,32 +2985,28 @@ void FixedLengthArrayTest() {
...
@@ -2985,32 +2985,28 @@ void FixedLengthArrayTest() {
TEST_NOTNULL
(
mArStruct
->
mutable_d
()
->
GetMutablePointer
(
1
));
TEST_NOTNULL
(
mArStruct
->
mutable_d
()
->
GetMutablePointer
(
1
));
TEST_NOTNULL
(
mArStruct
->
mutable_d
()
->
GetMutablePointer
(
1
)
->
mutable_a
());
TEST_NOTNULL
(
mArStruct
->
mutable_d
()
->
GetMutablePointer
(
1
)
->
mutable_a
());
mArStruct
->
mutable_d
()
->
GetMutablePointer
(
1
)
->
mutable_a
()
->
Mutate
(
1
,
5
);
mArStruct
->
mutable_d
()
->
GetMutablePointer
(
1
)
->
mutable_a
()
->
Mutate
(
1
,
5
);
TEST_EQ
(
mArStruct
->
d
()
->
Get
(
1
)
->
a
()
->
Get
(
1
),
5
);
TEST_EQ
(
5
,
mArStruct
->
d
()
->
Get
(
1
)
->
a
()
->
Get
(
1
)
);
TEST_EQ
(
mArStruct
->
d
()
->
Get
(
0
)
->
b
()
==
MyGame
::
Example
::
TestEnum
::
B
,
true
);
TEST_EQ
(
MyGame
::
Example
::
TestEnum
::
B
,
mArStruct
->
d
()
->
Get
(
0
)
->
b
()
);
TEST_NOTNULL
(
mArStruct
->
d
()
->
Get
(
0
)
->
c
());
TEST_NOTNULL
(
mArStruct
->
d
()
->
Get
(
0
)
->
c
());
TEST_EQ
(
mArStruct
->
d
()
->
Get
(
0
)
->
c
()
->
Get
(
0
)
==
MyGame
::
Example
::
TestEnum
::
C
,
TEST_EQ
(
MyGame
::
Example
::
TestEnum
::
C
,
mArStruct
->
d
()
->
Get
(
0
)
->
c
()
->
Get
(
0
));
true
);
TEST_EQ
(
MyGame
::
Example
::
TestEnum
::
A
,
mArStruct
->
d
()
->
Get
(
0
)
->
c
()
->
Get
(
1
));
TEST_EQ
(
mArStruct
->
d
()
->
Get
(
0
)
->
c
()
->
Get
(
1
)
==
MyGame
::
Example
::
TestEnum
::
A
,
TEST_EQ
(
flatbuffers
::
numeric_limits
<
int64_t
>::
max
(),
true
);
mArStruct
->
d
()
->
Get
(
0
)
->
d
()
->
Get
(
0
));
TEST_EQ
(
mArStruct
->
d
()
->
Get
(
0
)
->
d
()
->
Get
(
0
),
TEST_EQ
(
flatbuffers
::
numeric_limits
<
int64_t
>::
min
(),
flatbuffers
::
numeric_limits
<
int64_t
>::
max
());
mArStruct
->
d
()
->
Get
(
0
)
->
d
()
->
Get
(
1
));
TEST_EQ
(
mArStruct
->
d
()
->
Get
(
0
)
->
d
()
->
Get
(
1
),
TEST_EQ
(
MyGame
::
Example
::
TestEnum
::
C
,
mArStruct
->
d
()
->
Get
(
1
)
->
b
());
flatbuffers
::
numeric_limits
<
int64_t
>::
min
());
TEST_EQ
(
mArStruct
->
d
()
->
Get
(
1
)
->
b
()
==
MyGame
::
Example
::
TestEnum
::
C
,
true
);
TEST_NOTNULL
(
mArStruct
->
d
()
->
Get
(
1
)
->
c
());
TEST_NOTNULL
(
mArStruct
->
d
()
->
Get
(
1
)
->
c
());
TEST_EQ
(
mArStruct
->
d
()
->
Get
(
1
)
->
c
()
->
Get
(
0
)
==
MyGame
::
Example
::
TestEnum
::
C
,
TEST_EQ
(
MyGame
::
Example
::
TestEnum
::
C
,
mArStruct
->
d
()
->
Get
(
1
)
->
c
()
->
Get
(
0
));
true
);
TEST_EQ
(
MyGame
::
Example
::
TestEnum
::
A
,
mArStruct
->
d
()
->
Get
(
1
)
->
c
()
->
Get
(
1
));
TEST_EQ
(
mArStruct
->
d
()
->
Get
(
1
)
->
c
()
->
Get
(
1
)
==
MyGame
::
Example
::
TestEnum
::
A
,
TEST_EQ
(
flatbuffers
::
numeric_limits
<
int64_t
>::
min
(),
true
);
mArStruct
->
d
()
->
Get
(
1
)
->
d
()
->
Get
(
0
));
TEST_EQ
(
mArStruct
->
d
()
->
Get
(
1
)
->
d
()
->
Get
(
0
),
TEST_EQ
(
flatbuffers
::
numeric_limits
<
int64_t
>::
max
(),
flatbuffers
::
numeric_limits
<
int64_t
>::
min
());
mArStruct
->
d
()
->
Get
(
1
)
->
d
()
->
Get
(
1
));
TEST_EQ
(
mArStruct
->
d
()
->
Get
(
1
)
->
d
()
->
Get
(
1
),
flatbuffers
::
numeric_limits
<
int64_t
>::
max
());
for
(
int
i
=
0
;
i
<
mArStruct
->
b
()
->
size
()
-
1
;
i
++
)
for
(
int
i
=
0
;
i
<
mArStruct
->
b
()
->
size
()
-
1
;
i
++
)
TEST_EQ
(
mArStruct
->
b
()
->
Get
(
i
),
i
+
1
);
TEST_EQ
(
mArStruct
->
b
()
->
Get
(
i
),
i
+
1
);
// Check alignment
// Check alignment
TEST_EQ
(
reinterpret_cast
<
uintptr_t
>
(
mArStruct
->
d
())
%
8
,
0
);
TEST_EQ
(
0
,
reinterpret_cast
<
uintptr_t
>
(
mArStruct
->
d
())
%
8
);
TEST_EQ
(
reinterpret_cast
<
uintptr_t
>
(
mArStruct
->
f
())
%
8
,
0
);
TEST_EQ
(
0
,
reinterpret_cast
<
uintptr_t
>
(
mArStruct
->
f
())
%
8
);
#endif
#endif
}
}
...
...
tests/test_assert.cpp
View file @
c3c32ec9
...
@@ -12,8 +12,8 @@ static TestFailEventListener fail_listener_ = nullptr;
...
@@ -12,8 +12,8 @@ static TestFailEventListener fail_listener_ = nullptr;
void
TestFail
(
const
char
*
expval
,
const
char
*
val
,
const
char
*
exp
,
void
TestFail
(
const
char
*
expval
,
const
char
*
val
,
const
char
*
exp
,
const
char
*
file
,
int
line
,
const
char
*
func
)
{
const
char
*
file
,
int
line
,
const
char
*
func
)
{
TEST_OUTPUT_LINE
(
"
VALUE
:
\"
%s
\"
"
,
expval
);
TEST_OUTPUT_LINE
(
"
EXPECTED
:
\"
%s
\"
"
,
expval
);
TEST_OUTPUT_LINE
(
"
EXPECTED
:
\"
%s
\"
"
,
val
);
TEST_OUTPUT_LINE
(
"
VALUE
:
\"
%s
\"
"
,
val
);
TEST_OUTPUT_LINE
(
"TEST FAILED: %s:%d, %s in %s"
,
file
,
line
,
exp
,
TEST_OUTPUT_LINE
(
"TEST FAILED: %s:%d, %s in %s"
,
file
,
line
,
exp
,
func
?
func
:
""
);
func
?
func
:
""
);
testing_fails
++
;
testing_fails
++
;
...
@@ -25,8 +25,8 @@ void TestFail(const char *expval, const char *val, const char *exp,
...
@@ -25,8 +25,8 @@ void TestFail(const char *expval, const char *val, const char *exp,
}
}
void
TestEqStr
(
const
char
*
expval
,
const
char
*
val
,
const
char
*
exp
,
void
TestEqStr
(
const
char
*
expval
,
const
char
*
val
,
const
char
*
exp
,
const
char
*
file
,
int
line
)
{
const
char
*
file
,
int
line
,
const
char
*
func
)
{
if
(
strcmp
(
expval
,
val
)
!=
0
)
{
TestFail
(
expval
,
val
,
exp
,
file
,
line
);
}
if
(
strcmp
(
expval
,
val
)
!=
0
)
{
TestFail
(
expval
,
val
,
exp
,
file
,
line
,
func
);
}
}
}
#if defined(FLATBUFFERS_MEMORY_LEAK_TRACKING) && defined(_MSC_VER) && \
#if defined(FLATBUFFERS_MEMORY_LEAK_TRACKING) && defined(_MSC_VER) && \
...
...
tests/test_assert.h
View file @
c3c32ec9
...
@@ -16,17 +16,17 @@
...
@@ -16,17 +16,17 @@
{ printf(__VA_ARGS__); printf("\n"); }
{ printf(__VA_ARGS__); printf("\n"); }
#endif
#endif
#define TEST_EQ(exp, val) TestEq(exp, val,
#exp, __FILE__, __LINE__
)
#define TEST_EQ(exp, val) TestEq(exp, val,
"'" #exp "' != '" #val "'", __FILE__, __LINE__, ""
)
#define TEST_ASSERT(
exp) TestEq(exp, true, #exp, __FILE__, __LINE__
)
#define TEST_ASSERT(
val) TestEq(true, !!(val), "'" "true" "' != '" #val "'", __FILE__, __LINE__, ""
)
#define TEST_NOTNULL(
exp) TestEq(exp == NULL, false, #exp, __FILE__, __LINE__
)
#define TEST_NOTNULL(
val) TestEq(true, (val) != nullptr, "'" "nullptr" "' == '" #val "'", __FILE__, __LINE__, ""
)
#define TEST_EQ_STR(exp, val) TestEqStr(exp, val,
#exp, __FILE__, __LINE__
)
#define TEST_EQ_STR(exp, val) TestEqStr(exp, val,
"'" #exp "' != '" #val "'", __FILE__, __LINE__, ""
)
#ifdef _WIN32
#ifdef _WIN32
#define TEST_ASSERT_FUNC(
exp) TestEq(exp, true, #exp
, __FILE__, __LINE__, __FUNCTION__)
#define TEST_ASSERT_FUNC(
val) TestEq(true, !!(val), "'" "true" "' != '" #val "'"
, __FILE__, __LINE__, __FUNCTION__)
#define TEST_EQ_FUNC(exp, val) TestEq(exp, val,
#exp
, __FILE__, __LINE__, __FUNCTION__)
#define TEST_EQ_FUNC(exp, val) TestEq(exp, val,
"'" #exp "' != '" #val "'"
, __FILE__, __LINE__, __FUNCTION__)
#else
#else
#define TEST_ASSERT_FUNC(
exp) TestEq(exp, true, #exp
, __FILE__, __LINE__, __PRETTY_FUNCTION__)
#define TEST_ASSERT_FUNC(
val) TestEq(true, !!(val), "'" "true" "' != '" #val "'"
, __FILE__, __LINE__, __PRETTY_FUNCTION__)
#define TEST_EQ_FUNC(exp, val) TestEq(exp, val,
#exp
, __FILE__, __LINE__, __PRETTY_FUNCTION__)
#define TEST_EQ_FUNC(exp, val) TestEq(exp, val,
"'" #exp "' != '" #val "'"
, __FILE__, __LINE__, __PRETTY_FUNCTION__)
#endif
#endif
// clang-format on
// clang-format on
...
@@ -54,14 +54,55 @@ void TestFail(const char *expval, const char *val, const char *exp,
...
@@ -54,14 +54,55 @@ void TestFail(const char *expval, const char *val, const char *exp,
const
char
*
file
,
int
line
,
const
char
*
func
=
0
);
const
char
*
file
,
int
line
,
const
char
*
func
=
0
);
void
TestEqStr
(
const
char
*
expval
,
const
char
*
val
,
const
char
*
exp
,
void
TestEqStr
(
const
char
*
expval
,
const
char
*
val
,
const
char
*
exp
,
const
char
*
file
,
int
line
);
const
char
*
file
,
int
line
,
const
char
*
func
=
0
);
// Workaround for `enum class` printing.
// There is an issue with the printing of enums with a fixed underlying type.
// These enums are generated by `flatc` if `--scoped-enums` is active.
// All modern compilers have problems with `std::stringstream&<<(T v)` if T is
// an enum with fixed type. For details see DR1601:
// http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1601
// https://stackoverflow.com/questions/34336024/ambiguous-overload-when-writing-an-enum-with-an-enum-base-but-only-with-clang
template
<
typename
T
,
bool
is_enum_type
=
flatbuffers
::
is_enum
<
T
>::
value
>
struct
underlying_of_scalar
{
static_assert
(
flatbuffers
::
is_scalar
<
T
>::
value
,
"invalid type T"
);
typedef
T
type
;
};
template
<
typename
T
>
struct
underlying_of_scalar
<
T
,
true
>
{
// clang-format off
// There are old compilers without full C++11 support (see stl_emulation.h).
#if defined(FLATBUFFERS_TEMPLATES_ALIASES) && !defined(FLATBUFFERS_CPP98_STL)
using
type
=
typename
std
::
underlying_type
<
T
>::
type
;
#else
typedef
int64_t
type
;
#endif
// clang-format on
};
template
<
typename
T
>
typename
underlying_of_scalar
<
T
>::
type
scalar_as_underlying
(
T
v
)
{
return
static_cast
<
typename
underlying_of_scalar
<
T
>::
type
>
(
v
);
}
template
<
typename
T
,
typename
U
>
template
<
typename
T
,
typename
U
>
void
TestEq
(
T
expval
,
U
val
,
const
char
*
exp
,
const
char
*
file
,
int
line
,
void
TestEq
(
T
expval
,
U
val
,
const
char
*
exp
,
const
char
*
file
,
int
line
,
const
char
*
func
=
0
)
{
const
char
*
func
)
{
if
(
U
(
expval
)
!=
val
)
{
if
(
static_cast
<
U
>
(
expval
)
!=
val
)
{
TestFail
(
flatbuffers
::
NumToString
(
expval
).
c_str
(),
TestFail
(
flatbuffers
::
NumToString
(
scalar_as_underlying
(
expval
)).
c_str
(),
flatbuffers
::
NumToString
(
val
).
c_str
(),
exp
,
file
,
line
,
func
);
flatbuffers
::
NumToString
(
scalar_as_underlying
(
val
)).
c_str
(),
exp
,
file
,
line
,
func
);
}
}
template
<>
inline
void
TestEq
<
std
::
string
,
std
::
string
>
(
std
::
string
expval
,
std
::
string
val
,
const
char
*
exp
,
const
char
*
file
,
int
line
,
const
char
*
func
)
{
if
(
expval
!=
val
)
{
TestFail
(
expval
.
c_str
(),
val
.
c_str
(),
exp
,
file
,
line
,
func
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment