Fix test compilation

This commit is contained in:
Thomas Goyne 2014-04-25 08:44:11 -07:00
parent 2de5396f7a
commit b9509289aa
5 changed files with 5 additions and 9 deletions

View File

@ -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) 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 CXXFLAGS += -Wno-unused-value -Wno-sign-compare
PRECOMPILED_HEADER_NAME = ../libaegisub/lagi_pre.h
ifeq (yes, $(BUILD_DARWIN)) ifeq (yes, $(BUILD_DARWIN))
LDFLAGS += -framework ApplicationServices -framework Foundation LDFLAGS += -framework ApplicationServices -framework Foundation
endif endif

View File

@ -17,7 +17,7 @@
#include <libaegisub/dispatch.h> #include <libaegisub/dispatch.h>
#include <libaegisub/fs.h> #include <libaegisub/fs.h>
#include <libaegisub/log.h> #include <libaegisub/log.h>
#include <libaegisub/util.h> #include <libaegisub/make_unique.h>
#include <boost/locale/generator.hpp> #include <boost/locale/generator.hpp>
#include <cstdlib> #include <cstdlib>
@ -29,7 +29,7 @@ int main(int argc, char **argv) {
int retval; int retval;
agi::log::log = new agi::log::LogSink; agi::log::log = new agi::log::LogSink;
agi::log::log->Subscribe(agi::util::make_unique<agi::log::JsonEmitter>("./")); agi::log::log->Subscribe(agi::make_unique<agi::log::JsonEmitter>("./"));
::testing::InitGoogleTest(&argc, argv); ::testing::InitGoogleTest(&argc, argv);
srand(time(nullptr)); srand(time(nullptr));

View File

@ -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))); 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) { TEST(lagi_hotkey, set_hotkey_map) {
agi::fs::Remove("data/hotkey_tmp"); agi::fs::Remove("data/hotkey_tmp");
{ {
@ -168,7 +166,7 @@ TEST(lagi_hotkey, set_hotkey_map) {
insert_combo(hm, "Default", "cmd2", 2, "Shift", "C"); insert_combo(hm, "Default", "cmd2", 2, "Shift", "C");
bool listener_called = false; bool listener_called = false;
h.AddHotkeyChangeListener(set_var, &listener_called); h.AddHotkeyChangeListener([&] { listener_called = true; });
h.SetHotkeyMap(hm); h.SetHotkeyMap(hm);
EXPECT_TRUE(listener_called); EXPECT_TRUE(listener_called);

View File

@ -14,8 +14,6 @@
// //
// Aegisub Project http://www.aegisub.org/ // Aegisub Project http://www.aegisub.org/
#include "../../libaegisub/config.h"
#include <libaegisub/util.h> #include <libaegisub/util.h>
#include "main.h" #include "main.h"

View File

@ -14,8 +14,6 @@
// //
// Aegisub Project http://www.aegisub.org/ // Aegisub Project http://www.aegisub.org/
#include "../../libaegisub/config.h"
#include <libaegisub/util.h> #include <libaegisub/util.h>
#include "main.h" #include "main.h"