mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-15 00:38:52 +00:00
inject no long for FBS generation to remove logs in flattests (#7926)
* inject no long for FBS generation to remove logs in flattests * updated blaze rules
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#endif
|
||||
|
||||
#define TEST_EQ(exp, val) TestEq(exp, val, "'" #exp "' != '" #val "'", __FILE__, __LINE__, "")
|
||||
#define TEST_NE(exp, val) TestNe(exp, val, "'" #exp "' == '" #val "'", __FILE__, __LINE__, "")
|
||||
#define TEST_ASSERT(val) TestEq(true, !!(val), "'" "true" "' != '" #val "'", __FILE__, __LINE__, "")
|
||||
#define TEST_NOTNULL(val) TestEq(true, (val) != nullptr, "'" "nullptr" "' == '" #val "'", __FILE__, __LINE__, "")
|
||||
#define TEST_EQ_STR(exp, val) TestEqStr(exp, val, "'" #exp "' != '" #val "'", __FILE__, __LINE__, "")
|
||||
@@ -106,4 +107,24 @@ inline void TestEq<std::string, std::string>(std::string expval,
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, typename U>
|
||||
void TestNe(T expval, U val, const char *exp, const char *file, int line,
|
||||
const char *func) {
|
||||
if (static_cast<U>(expval) == val) {
|
||||
TestFail(flatbuffers::NumToString(scalar_as_underlying(expval)).c_str(),
|
||||
flatbuffers::NumToString(scalar_as_underlying(val)).c_str(), exp,
|
||||
file, line, func);
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
inline void TestNe<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);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !TEST_ASSERT_H
|
||||
|
||||
Reference in New Issue
Block a user