mail[Wesnoth-commits] r28980 - in /trunk: data/test/test/_main.cfg po/wesnoth/de.po src/tests/test_config_cache.cpp


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

Header


Content

Posted by paniemin on August 25, 2008 - 19:52:
Author: suokko
Date: Mon Aug 25 19:52:58 2008
New Revision: 28980

URL: http://svn.gna.org/viewcvs/wesnoth?rev=28980&view=rev
Log:
Fixed config test translation reset test to work

Modified:
    trunk/data/test/test/_main.cfg
    trunk/po/wesnoth/de.po
    trunk/src/tests/test_config_cache.cpp

Modified: trunk/data/test/test/_main.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/test/test/_main.cfg?rev=28980&r1=28979&r2=28980&view=diff
==============================================================================
--- trunk/data/test/test/_main.cfg (original)
+++ trunk/data/test/test/_main.cfg Mon Aug 25 19:52:58 2008
@@ -9,7 +9,7 @@
 [/test_key]
 #endif
 #ifdef TEST_DEFINE
-[test_key]
+[test_key2]
        define=_ "testing translation reset."
-[/test_key]
+[/test_key2]
 #endif

Modified: trunk/po/wesnoth/de.po
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/po/wesnoth/de.po?rev=28980&r1=28979&r2=28980&view=diff
==============================================================================
--- trunk/po/wesnoth/de.po (original)
+++ trunk/po/wesnoth/de.po Mon Aug 25 19:52:58 2008
@@ -6508,9 +6508,9 @@
 
 #. [test_key]
 #: data/test/test/_main.cfg:13
-#, fuzzy
+#: src/tests/test_config_cache.cpp:119 src/tests/test_config_cache.cpp:141
 msgid "testing translation reset."
-msgstr "Estländische Übersetzung"
+msgstr "Estländische Übersetzung."
 
 #. [menu]
 #: data/themes/default.cfg:120 data/themes/dfool.cfg:134
@@ -9382,16 +9382,6 @@
 msgid "Owned village"
 msgstr "Eigenes Dorf"
 
-#: src/tests/test_config_cache.cpp:119 src/tests/test_config_cache.cpp:141
-#, fuzzy
-msgid "testing translation reset"
-msgstr "Estländische Übersetzung"
-
-#: src/tests/test_config_cache.cpp:155
-#, fuzzy
-msgid "test translation reset"
-msgstr "Portugiesische Übersetzung"
-
 #: src/theme.cpp:339
 msgid "border_size should be between 0.0 and 0.5."
 msgstr "Der Wert für »border_size« muss zwischen 0,0 und 0,5 liegen."

Modified: trunk/src/tests/test_config_cache.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/tests/test_config_cache.cpp?rev=28980&r1=28979&r2=28980&view=diff
==============================================================================
--- trunk/src/tests/test_config_cache.cpp (original)
+++ trunk/src/tests/test_config_cache.cpp Mon Aug 25 19:52:58 2008
@@ -14,6 +14,7 @@
 
 #define GETTEXT_DOMAIN "wesnoth"
 
+#include <iostream>
 #include <boost/test/auto_unit_test.hpp>
 
 #include "config_cache.hpp"
@@ -121,11 +122,13 @@
 
        cache.add_define("TEST_DEFINE");
 
-       child = &test_config.add_child("test_key");
+       child = &test_config.add_child("test_key2");
        (*child)["define"] = t_string("testing translation reset.", 
GETTEXT_DOMAIN);
        
 
        BOOST_CHECK_EQUAL(test_config, cache.get_config());
+
+       BOOST_CHECK_EQUAL((*test_config.child("test_key2"))["define"].str(), 
(*cache.get_config().child("test_key2"))["define"].str());
 }
 
 static bool match_german(const language_def& def)
@@ -143,8 +146,10 @@
        child = &test_config.add_child("test_key");
        (*child)["define"] = "test";
 
-       child = &test_config.add_child("test_key");
+       child = &test_config.add_child("test_key2");
        (*child)["define"] = t_string("testing translation reset.", 
GETTEXT_DOMAIN);
+
+       BOOST_CHECK_EQUAL((*test_config.child("test_key2"))["define"].str(), 
(*cache.get_config().child("test_key2"))["define"].str());
 
        // Change language
        const language_def& original_lang = get_language();
@@ -157,11 +162,12 @@
        ::set_language(*German);
        cache.reload_translations();
 
-       BOOST_CHECK_MESSAGE( test_config != cache.get_config(), "Translation 
update failed to update translations!"  );
+       BOOST_CHECK_MESSAGE((*test_config.child("test_key2"))["define"].str() 
!= (*cache.get_config().child("test_key2"))["define"].str(), "Translation 
reset failed to make test string different!");
        
        (*child)["define"].reset_translation();
 
        BOOST_CHECK_EQUAL(test_config, cache.get_config());
+       BOOST_CHECK_EQUAL((*test_config.child("test_key2"))["define"].str(), 
(*cache.get_config().child("test_key2"))["define"].str());
        set_language(original_lang);
 }
 




Related Messages


Powered by MHonArc, Updated Mon Aug 25 20:42:37 2008