From b9509289aa702fc72f5b472608e994a6317a9fb1 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Fri, 25 Apr 2014 08:44:11 -0700 Subject: [PATCH] Fix test compilation --- tests/Makefile | 2 ++ tests/support/main.cpp | 4 ++-- tests/tests/hotkey.cpp | 4 +--- tests/tests/ifind.cpp | 2 -- tests/tests/util.cpp | 2 -- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/Makefile b/tests/Makefile index 93b5dc740..21d98ca1b 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -10,6 +10,8 @@ LDFLAGS += -Wl,-rpath $(CURDIR)/../libaegisub $(LDFLAGS_ICONV) CPPFLAGS += -I../src/include -I../libaegisub/include $(CFLAGS_ICONV) -I${GTEST_ROOT} -I${GTEST_ROOT}/include -I./support $(CPPFLAGS_BOOST) CXXFLAGS += -Wno-unused-value -Wno-sign-compare +PRECOMPILED_HEADER_NAME = ../libaegisub/lagi_pre.h + ifeq (yes, $(BUILD_DARWIN)) LDFLAGS += -framework ApplicationServices -framework Foundation endif diff --git a/tests/support/main.cpp b/tests/support/main.cpp index 5574e0186..1ebe24b0d 100644 --- a/tests/support/main.cpp +++ b/tests/support/main.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include @@ -29,7 +29,7 @@ int main(int argc, char **argv) { int retval; agi::log::log = new agi::log::LogSink; - agi::log::log->Subscribe(agi::util::make_unique("./")); + agi::log::log->Subscribe(agi::make_unique("./")); ::testing::InitGoogleTest(&argc, argv); srand(time(nullptr)); diff --git a/tests/tests/hotkey.cpp b/tests/tests/hotkey.cpp index ae9388d56..ffb1800aa 100644 --- a/tests/tests/hotkey.cpp +++ b/tests/tests/hotkey.cpp @@ -154,8 +154,6 @@ static void insert_combo(Hotkey::HotkeyMap &hm, const char *ctx, const char *cmd hm.insert(make_pair(std::string(cmd), Combo(ctx, cmd, keys))); } -static void set_var(bool *b) { *b = true; } - TEST(lagi_hotkey, set_hotkey_map) { agi::fs::Remove("data/hotkey_tmp"); { @@ -168,7 +166,7 @@ TEST(lagi_hotkey, set_hotkey_map) { insert_combo(hm, "Default", "cmd2", 2, "Shift", "C"); bool listener_called = false; - h.AddHotkeyChangeListener(set_var, &listener_called); + h.AddHotkeyChangeListener([&] { listener_called = true; }); h.SetHotkeyMap(hm); EXPECT_TRUE(listener_called); diff --git a/tests/tests/ifind.cpp b/tests/tests/ifind.cpp index 8c0b75656..baad59913 100644 --- a/tests/tests/ifind.cpp +++ b/tests/tests/ifind.cpp @@ -14,8 +14,6 @@ // // Aegisub Project http://www.aegisub.org/ -#include "../../libaegisub/config.h" - #include #include "main.h" diff --git a/tests/tests/util.cpp b/tests/tests/util.cpp index ec9a44f1d..82af8e0d4 100644 --- a/tests/tests/util.cpp +++ b/tests/tests/util.cpp @@ -14,8 +14,6 @@ // // Aegisub Project http://www.aegisub.org/ -#include "../../libaegisub/config.h" - #include #include "main.h"