summaryrefslogtreecommitdiffstats
path: root/tests/auto/linguist/lupdate/testdata/good/lacksqobject
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/linguist/lupdate/testdata/good/lacksqobject')
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/lacksqobject/expectedoutput.txt4
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/lacksqobject/main.cpp88
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/lacksqobject/project.pro3
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/lacksqobject/project.ts.result40
4 files changed, 135 insertions, 0 deletions
diff --git a/tests/auto/linguist/lupdate/testdata/good/lacksqobject/expectedoutput.txt b/tests/auto/linguist/lupdate/testdata/good/lacksqobject/expectedoutput.txt
new file mode 100644
index 000000000..f6fc40036
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/lacksqobject/expectedoutput.txt
@@ -0,0 +1,4 @@
+.*/lupdate/testdata/good/lacksqobject/main.cpp:58: Class 'B' lacks Q_OBJECT macro
+.*/lupdate/testdata/good/lacksqobject/main.cpp:65: Class 'C' lacks Q_OBJECT macro
+.*/lupdate/testdata/good/lacksqobject/main.cpp:78: Class 'nsB::B' lacks Q_OBJECT macro
+.*/lupdate/testdata/good/lacksqobject/main.cpp:84: Class 'nsB::C' lacks Q_OBJECT macro
diff --git a/tests/auto/linguist/lupdate/testdata/good/lacksqobject/main.cpp b/tests/auto/linguist/lupdate/testdata/good/lacksqobject/main.cpp
new file mode 100644
index 000000000..42e81deb2
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/lacksqobject/main.cpp
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// IMPORTANT!!!! If you want to add testdata to this file,
+// always add it to the end in order to not change the linenumbers of translations!!!
+
+#define QTCORE <QtCore>
+#include QTCORE // Hidden from lupdate, but compiles
+
+//
+// Test 'lacks Q_OBJECT' reporting on namespace scopes
+//
+
+class B : public QObject {
+ //Q_OBJECT
+ void foo();
+};
+
+void B::foo() {
+ tr("Bla", "::B");
+}
+
+
+class C : public QObject {
+ //Q_OBJECT
+ void foo() {
+ tr("Bla", "::C");
+ }
+};
+
+
+namespace nsB {
+
+ class B : public QObject {
+ //Q_OBJECT
+ void foo();
+ };
+
+ void B::foo() {
+ tr("Bla", "nsB::B");
+ }
+
+ class C : public QObject {
+ //Q_OBJECT
+ void foo() {
+ tr("Bla", "nsB::C");
+ }
+ };
+}
+
diff --git a/tests/auto/linguist/lupdate/testdata/good/lacksqobject/project.pro b/tests/auto/linguist/lupdate/testdata/good/lacksqobject/project.pro
new file mode 100644
index 000000000..759bea068
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/lacksqobject/project.pro
@@ -0,0 +1,3 @@
+SOURCES = main.cpp
+
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/lacksqobject/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/lacksqobject/project.ts.result
new file mode 100644
index 000000000..bc876cdb1
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/lacksqobject/project.ts.result
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0">
+<context>
+ <name>B</name>
+ <message>
+ <location filename="main.cpp" line="58"/>
+ <source>Bla</source>
+ <comment>::B</comment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>C</name>
+ <message>
+ <location filename="main.cpp" line="65"/>
+ <source>Bla</source>
+ <comment>::C</comment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>nsB::B</name>
+ <message>
+ <location filename="main.cpp" line="78"/>
+ <source>Bla</source>
+ <comment>nsB::B</comment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>nsB::C</name>
+ <message>
+ <location filename="main.cpp" line="84"/>
+ <source>Bla</source>
+ <comment>nsB::C</comment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>