Fix test compilation with gcc

This commit is contained in:
Thomas Goyne 2014-07-02 10:36:19 -07:00
parent c5bffa9352
commit c804042978
2 changed files with 13 additions and 13 deletions

View File

@ -7,7 +7,7 @@ run_PCH := $(d)support/tests_pre.h
run_CPPFLAGS := -I$(TOP)libaegisub/include -I$(TOP) -I$(d)support \ run_CPPFLAGS := -I$(TOP)libaegisub/include -I$(TOP) -I$(d)support \
-I$(GTEST_ROOT) -I$(GTEST_ROOT)/include $(CPPFLAGS_BOOST) $(CFLAGS_LUA) -I$(GTEST_ROOT) -I$(GTEST_ROOT)/include $(CPPFLAGS_BOOST) $(CFLAGS_LUA)
run_CXXFLAGS := -Wno-unused-value -Wno-sign-compare run_CXXFLAGS := -Wno-unused-value -Wno-sign-compare
run_LIBS := $(LIBS_BOOST) $(LIBS_ICU) run_LIBS := $(LIBS_BOOST) $(LIBS_ICU) -pthread
run_OBJ := \ run_OBJ := \
$(subst .cpp,.o,$(wildcard $(d)tests/*.cpp)) \ $(subst .cpp,.o,$(wildcard $(d)tests/*.cpp)) \
$(d)support/main.o \ $(d)support/main.o \

View File

@ -28,12 +28,12 @@
class lagi_cajun : public libagi { }; class lagi_cajun : public libagi { };
TEST(lagi_cajun, CastNonConst) { TEST(lagi_cajun, CastNonConst) {
json::UnknownElement Integer = 0; auto Integer = json::UnknownElement{0};
json::UnknownElement Double = 0.0; auto Double = json::UnknownElement{0.0};
json::UnknownElement String = "1"; auto String = json::UnknownElement{"1"};
json::UnknownElement Boolean = false; auto Boolean = json::UnknownElement{false};
json::UnknownElement Array = json::Array(); auto Array = json::UnknownElement{json::Array{}};
json::UnknownElement Object = json::Object(); auto Object = json::UnknownElement{json::Object{}};
EXPECT_NO_THROW(static_cast<json::Integer&>(Integer)); EXPECT_NO_THROW(static_cast<json::Integer&>(Integer));
EXPECT_NO_THROW(static_cast<json::Double&>(Double)); EXPECT_NO_THROW(static_cast<json::Double&>(Double));
@ -51,12 +51,12 @@ TEST(lagi_cajun, CastNonConst) {
} }
TEST(lagi_cajun, CastConst) { TEST(lagi_cajun, CastConst) {
const json::UnknownElement Integer = 10; const auto Integer = json::UnknownElement{10};
const json::UnknownElement Double = 10.0; const auto Double = json::UnknownElement{10.0};
const json::UnknownElement String = "1"; const auto String = json::UnknownElement{"1"};
const json::UnknownElement Boolean = false; const auto Boolean = json::UnknownElement{false};
const json::UnknownElement Array = json::Array(); const auto Array = json::UnknownElement{json::Array{}};
const json::UnknownElement Object = json::Object(); const auto Object = json::UnknownElement{json::Object{}};
/* these shouldn't compile /* these shouldn't compile
EXPECT_NO_THROW(static_cast<json::Integer&>(Integer)); EXPECT_NO_THROW(static_cast<json::Integer&>(Integer));