summaryrefslogtreecommitdiffstats
path: root/tests/auto/linguist
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-09-10 09:34:43 +0200
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-09-10 16:31:25 +0200
commitf7db9a602a83b05ccad6ac33a2ab63acf3367481 (patch)
treefaec051e25a7d2f357e034f672f7549839fa493c /tests/auto/linguist
parentc2d6eb9dca7546bbe8d9c6c62db683615e4b23a7 (diff)
delay next token fetching when opening namespace
otherwise, if the next token to be fetched is a non-empty #define, it would save the context before entering the namespace, and thus the post-define context restore would just discard the namespace entry. Task-number: QTBUG-12683
Diffstat (limited to 'tests/auto/linguist')
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp25
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result8
2 files changed, 33 insertions, 0 deletions
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp b/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp
index c56ba7cb36..706e8d020a 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp
@@ -318,3 +318,28 @@ int LotsaFun::operator<<(int left, int right)
tr("this is inside operator<<");
return left << right;
}
+
+
+
+// QTBUG-12683: define in re-opened namespace
+namespace NameSchpace {
+
+class YetMoreFun : public QObject
+{
+ Q_OBJECT
+public:
+ void funStuff();
+};
+
+}
+
+namespace NameSchpace {
+
+#define somevar 1
+
+void YetMoreFun::funStuff()
+{
+ tr("funStuff!");
+}
+
+}
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result
index 1a6d551a1e..f73fc64776 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result
@@ -149,6 +149,14 @@ backslashed \ stuff.</source>
</message>
</context>
<context>
+ <name>NameSchpace::YetMoreFun</name>
+ <message>
+ <location filename="main.cpp" line="342"/>
+ <source>funStuff!</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>Plurals, QCoreApplication</name>
<message numerus="yes">
<location filename="main.cpp" line="81"/>