mail[Wesnoth-commits] r45008 - in /trunk/src: CMakeLists.txt Makefile.am SConscript exceptions.cpp game.cpp tests/gui/test_gui2.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by guillaume . melquiond on July 31, 2010 - 18:57:
Author: silene
Date: Sat Jul 31 18:57:33 2010
New Revision: 45008

URL: http://svn.gna.org/viewcvs/wesnoth?rev=45008&view=rev
Log:
Fixed compilation of unit tests by moving symbols out of game.cpp.

Added:
    trunk/src/exceptions.cpp
Modified:
    trunk/src/CMakeLists.txt
    trunk/src/Makefile.am
    trunk/src/SConscript
    trunk/src/game.cpp
    trunk/src/tests/gui/test_gui2.cpp

Modified: trunk/src/CMakeLists.txt
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/CMakeLists.txt?rev=45008&r1=45007&r2=45008&view=diff
==============================================================================
--- trunk/src/CMakeLists.txt (original)
+++ trunk/src/CMakeLists.txt Sat Jul 31 18:57:33 2010
@@ -324,6 +324,7 @@
        config_cache.cpp
        controller_base.cpp
        dialogs.cpp
+       exceptions.cpp
        floating_textbox.cpp
        formula.cpp
        formula_debugger.cpp

Modified: trunk/src/Makefile.am
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/Makefile.am?rev=45008&r1=45007&r2=45008&view=diff
==============================================================================
--- trunk/src/Makefile.am (original)
+++ trunk/src/Makefile.am Sat Jul 31 18:57:33 2010
@@ -99,6 +99,7 @@
        config_cache.cpp \
        controller_base.cpp \
        dialogs.cpp \
+       exceptions.cpp \
        floating_textbox.cpp \
        formula.cpp \
        formula_debugger.cpp \
@@ -448,8 +449,8 @@
        tests/gui/test_save_dialog.cpp \
        $(wesnoth_source)
 
-test_LDADD = $(INTERNALLIBS) $(THELIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIBS) 
$(PANGO_LIBS) $(FONTCONFIG_LIBS)
-test_DEPENDENCIES=libwesnoth-core.a libwesnoth.a
+test_LDADD = $(INTERNALLIBS) $(THELIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIBS) 
$(PANGO_LIBS) $(FONTCONFIG_LIBS) lua/liblua.a
+test_DEPENDENCIES=libwesnoth-core.a libwesnoth.a lua/liblua.a
 if ANA
 test_LDADD += $(BOOST_SYSTEM_LIBS) $(BOOST_THREAD_LIBS) -lana
 test_DEPENDENCIES += libana.a

Modified: trunk/src/SConscript
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/SConscript?rev=45008&r1=45007&r2=45008&view=diff
==============================================================================
--- trunk/src/SConscript (original)
+++ trunk/src/SConscript Sat Jul 31 18:57:33 2010
@@ -198,6 +198,7 @@
     config_cache.cpp
     controller_base.cpp
     dialogs.cpp
+    exceptions.cpp
     floating_textbox.cpp
     formula.cpp
     formula_debugger.cpp

Added: trunk/src/exceptions.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/exceptions.cpp?rev=45008&view=auto
==============================================================================
--- trunk/src/exceptions.cpp (added)
+++ trunk/src/exceptions.cpp Sat Jul 31 18:57:33 2010
@@ -1,0 +1,33 @@
+/* $Id$ */
+/*
+   Copyright (C) 2010 by Guillaume Melquiond <guillaume.melquiond@xxxxxxxxx>
+   Part of the Battle for Wesnoth Project http://www.wesnoth.org/
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License version 2
+   or at your option any later version.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY.
+
+   See the COPYING file for more details.
+*/
+
+#include "exceptions.hpp"
+#include "game_errors.hpp"
+#include "game_end_exceptions.hpp"
+#include "video.hpp"
+
+char const *game::exception::sticky;
+
+void game::exception::rethrow()
+{
+       if (!sticky) return;
+       if (strcmp(sticky, "quit") == 0) throw CVideo::quit();
+       if (strcmp(sticky, "load game") == 0) throw 
game::load_game_exception();
+       if (strcmp(sticky, "end level") == 0) throw end_level_exception(QUIT);
+       throw game::exception("Unknown exception", "unknown");
+}
+
+std::string game::load_game_exception::game;
+bool game::load_game_exception::show_replay;
+bool game::load_game_exception::cancel_orders;

Modified: trunk/src/game.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game.cpp?rev=45008&r1=45007&r2=45008&view=diff
==============================================================================
--- trunk/src/game.cpp (original)
+++ trunk/src/game.cpp Sat Jul 31 18:57:33 2010
@@ -131,21 +131,6 @@
 static bool less_campaigns_rank(const config &a, const config &b) {
        return a["rank"].to_int(1000) < b["rank"].to_int(1000);
 }
-
-char const *game::exception::sticky;
-
-void game::exception::rethrow()
-{
-       if (!sticky) return;
-       if (strcmp(sticky, "quit") == 0) throw CVideo::quit();
-       if (strcmp(sticky, "load game") == 0) throw 
game::load_game_exception();
-       if (strcmp(sticky, "end level") == 0) throw end_level_exception(QUIT);
-       throw game::exception("Unknown exception", "unknown");
-}
-
-std::string game::load_game_exception::game;
-bool game::load_game_exception::show_replay;
-bool game::load_game_exception::cancel_orders;
 
 namespace {
 struct jump_to_campaign_info

Modified: trunk/src/tests/gui/test_gui2.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/tests/gui/test_gui2.cpp?rev=45008&r1=45007&r2=45008&view=diff
==============================================================================
--- trunk/src/tests/gui/test_gui2.cpp (original)
+++ trunk/src/tests/gui/test_gui2.cpp Sat Jul 31 18:57:33 2010
@@ -226,7 +226,7 @@
                gui2::tmessage dlg("title", "message", true);
                dlg.show(video, 1);
        } catch(twml_exception& e) {
-               BOOST_CHECK(e.user_message == _("Failed to show a dialog, "
+               BOOST_CHECK(e.message == _("Failed to show a dialog, "
                                        "which doesn't fit on the screen."));
                return;
        } catch(...) {




Related Messages


Powered by MHonArc, Updated Sat Jul 31 19:20:15 2010