Fix some gcc warnings/errors

This commit is contained in:
miloyip 2015-05-01 22:38:00 +08:00
parent 9a5283eb0a
commit 33b5c59e5d
2 changed files with 14 additions and 1 deletions

View File

@ -18,6 +18,12 @@
#include "document.h" #include "document.h"
#include <cmath> // HUGE_VAL, fmod #include <cmath> // HUGE_VAL, fmod
#if defined(__GNUC__)
RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_OFF(effc++)
RAPIDJSON_DIAG_OFF(float-equal)
#endif
RAPIDJSON_NAMESPACE_BEGIN RAPIDJSON_NAMESPACE_BEGIN
template <typename Encoding> template <typename Encoding>
@ -862,4 +868,8 @@ typedef GenericSchemaValidator<UTF8<> > SchemaValidator;
RAPIDJSON_NAMESPACE_END RAPIDJSON_NAMESPACE_END
#if defined(__GNUC__)
RAPIDJSON_DIAG_POP
#endif
#endif // RAPIDJSON_SCHEMA_H_ #endif // RAPIDJSON_SCHEMA_H_

View File

@ -26,7 +26,10 @@ using namespace rapidjson;
Document d;\ Document d;\
d.Parse(json);\ d.Parse(json);\
EXPECT_FALSE(d.HasParseError());\ EXPECT_FALSE(d.HasParseError());\
EXPECT_EQ(expected, d.Accept(validator));\ if (expected)\
EXPECT_TRUE(d.Accept(validator));\
else\
EXPECT_FALSE(d.Accept(validator));\
} }
TEST(SchemaValidator, Typeless) { TEST(SchemaValidator, Typeless) {