diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-01-04 16:09:45 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-01-04 16:09:45 +0300 |
commit | b37c6febad44ba62bb089eea35a1ae71104a9334 (patch) | |
tree | 72d30b24d7cad2131e86e6e63ef2ecfcef266a14 | |
parent | c0671d0212a66f23da2413b16a8bc25b4f67ed77 (diff) | |
download | mplint-b37c6febad44ba62bb089eea35a1ae71104a9334.tar.gz mplint-b37c6febad44ba62bb089eea35a1ae71104a9334.tar.bz2 mplint-b37c6febad44ba62bb089eea35a1ae71104a9334.tar.xz mplint-b37c6febad44ba62bb089eea35a1ae71104a9334.zip |
Add tests for translation checks.
-rw-r--r-- | tests/testreport.txt | 2 | ||||
-rw-r--r-- | tests/testsrc/bad/translation.cpp | 33 | ||||
-rw-r--r-- | tests/testsrc/good/translation.cpp | 34 |
3 files changed, 69 insertions, 0 deletions
diff --git a/tests/testreport.txt b/tests/testreport.txt index 94223aa..b555001 100644 --- a/tests/testreport.txt +++ b/tests/testreport.txt @@ -42,6 +42,8 @@ [testsrc/bad/license6.cpp:5]: V005: Missing "This file is part of The ManaPlus Client." [testsrc/bad/license6.h:5]: V005: Missing "This file is part of The ManaPlus Client." [testsrc/bad/packet.cpp:25]: V012: Wrong output packet creation. Must be 'createOutPacket(CMSG...' +[testsrc/bad/translation.cpp:27]: V014: Missing "// TRANSLATORS: " comment before this line. +[testsrc/bad/translation.cpp:32]: V014: Missing "// TRANSLATORS: " comment before this line. [testsrc/bad/uk.po:2257]: V010: Wrong character at end of translation line. [testsrc/bad/uk.po:2269]: V010: Wrong character at start of translation line. [testsrc/bad/uk.po:2535]: V010: Wrong number of spaces at start of translation line. diff --git a/tests/testsrc/bad/translation.cpp b/tests/testsrc/bad/translation.cpp new file mode 100644 index 0000000..ce72e76 --- /dev/null +++ b/tests/testsrc/bad/translation.cpp @@ -0,0 +1,33 @@ +/* + * The ManaPlus Client + * Copyright (C) 2014 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "debug.h" + +void Test1() +{ + // TRANSLATORS: test line + int k; + std::string str = _("This is text line"); +} + +void Test2() +{ + std::string str = _("This is text line"); +} diff --git a/tests/testsrc/good/translation.cpp b/tests/testsrc/good/translation.cpp new file mode 100644 index 0000000..dfbe647 --- /dev/null +++ b/tests/testsrc/good/translation.cpp @@ -0,0 +1,34 @@ +/* + * The ManaPlus Client + * Copyright (C) 2014 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "debug.h" + +void Test1() +{ + // TRANSLATORS: test line + std::string str = _("This is text line"); +} + +void Test2() +{ + // TRANSLATORS: test line + // second line + std::string str = _("This is text line"); +} |