From 71d265f5921fed35f51b5f169870c4ef51dde8a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Fri, 17 Jan 2014 13:49:41 +0100 Subject: Add missing header guards Change-Id: I515313289c0a4af0f675131760ad4ccd0c6e6149 Reviewed-by: Olivier Goffart --- tests/auto/tools/moc/assign-namespace.h | 4 ++++ tests/auto/tools/moc/backslash-newlines.h | 4 ++++ tests/auto/tools/moc/c-comments.h | 4 ++++ tests/auto/tools/moc/cstyle-enums.h | 4 ++++ tests/auto/tools/moc/cxx11-enums.h | 4 ++++ tests/auto/tools/moc/dir-in-include-path.h | 4 ++++ tests/auto/tools/moc/dollars.h | 4 ++++ tests/auto/tools/moc/error-on-wrong-notify.h | 4 ++++ tests/auto/tools/moc/escapes-in-string-literals.h | 4 ++++ tests/auto/tools/moc/extraqualification.h | 4 ++++ tests/auto/tools/moc/forgotten-qinterface.h | 4 ++++ tests/auto/tools/moc/forward-declared-param.h | 6 +++++- tests/auto/tools/moc/function-with-attributes.h | 4 ++++ tests/auto/tools/moc/interface-from-framework.h | 3 ++- tests/auto/tools/moc/macro-on-cmdline.h | 4 ++++ tests/auto/tools/moc/namespaced-flags.h | 4 ++++ tests/auto/tools/moc/no-keywords.h | 4 ++++ tests/auto/tools/moc/oldstyle-casts.h | 4 ++++ tests/auto/tools/moc/parse-boost.h | 4 ++++ tests/auto/tools/moc/pp-dollar-signs.h | 4 ++++ tests/auto/tools/moc/pure-virtual-signals.h | 4 ++++ tests/auto/tools/moc/qinvokable.h | 4 ++++ tests/auto/tools/moc/qprivateslots.h | 4 ++++ tests/auto/tools/moc/qtbug-35657-gadget.h | 5 +++++ tests/auto/tools/moc/related-metaobjects-in-gadget.h | 5 +++++ tests/auto/tools/moc/related-metaobjects-in-namespaces.h | 5 +++++ .../auto/tools/moc/single-quote-digit-separator-n3781.h | 4 ++++ tests/auto/tools/moc/single_function_keyword.h | 4 ++++ tests/auto/tools/moc/slots-with-void-template.h | 4 ++++ tests/auto/tools/moc/task192552.h | 4 ++++ tests/auto/tools/moc/task234909.h | 4 ++++ tests/auto/tools/moc/task87883.h | 4 ++++ tests/auto/tools/moc/template-gtgt.h | 4 ++++ tests/auto/tools/moc/trigraphs.h | 4 ++++ tests/auto/tools/moc/tst_moc.cpp | 16 ++++++++-------- tests/auto/tools/moc/unterminated-function-macro.h | 4 ++++ tests/auto/tools/moc/using-namespaces.h | 4 ++++ .../auto/tools/moc/warn-on-multiple-qobject-subclasses.h | 4 ++++ tests/auto/tools/moc/warn-on-property-without-read.h | 4 ++++ 39 files changed, 162 insertions(+), 10 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/tools/moc/assign-namespace.h b/tests/auto/tools/moc/assign-namespace.h index 8f5ecc23e7..7377b38f6b 100644 --- a/tests/auto/tools/moc/assign-namespace.h +++ b/tests/auto/tools/moc/assign-namespace.h @@ -39,6 +39,9 @@ ** ****************************************************************************/ +#ifndef ASSIGN_NAMESPACE_H +#define ASSIGN_NAMESPACE_H + namespace A { namespace Nested @@ -50,3 +53,4 @@ namespace A namespace Mine = Qt; namespace Theirs = A::Nested::Space; +#endif // ASSIGN_NAMESPACE_H diff --git a/tests/auto/tools/moc/backslash-newlines.h b/tests/auto/tools/moc/backslash-newlines.h index 27c47843a2..29d800f26f 100644 --- a/tests/auto/tools/moc/backslash-newlines.h +++ b/tests/auto/tools/moc/backslash-newlines.h @@ -39,6 +39,9 @@ ** ****************************************************************************/ +#ifndef BACKSLASH_NEWLINES_H +#define BACKSLASH_NEWLINES_H + #include const int blackslashNewlinesDummy = 0 @@ -61,3 +64,4 @@ public slots: #undef value +#endif // BACKSLASH_NEWLINES_H diff --git a/tests/auto/tools/moc/c-comments.h b/tests/auto/tools/moc/c-comments.h index bded642737..dff4492287 100644 --- a/tests/auto/tools/moc/c-comments.h +++ b/tests/auto/tools/moc/c-comments.h @@ -38,6 +38,9 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ + +#ifndef C_COMMENTS_H +#define C_COMMENTS_H #include /* test support for multi-line comments in preprocessor statements */ @@ -53,3 +56,4 @@ public: }; #endif +#endif // C_COMMENTS_H diff --git a/tests/auto/tools/moc/cstyle-enums.h b/tests/auto/tools/moc/cstyle-enums.h index 38c5932f69..7d1f6d0147 100644 --- a/tests/auto/tools/moc/cstyle-enums.h +++ b/tests/auto/tools/moc/cstyle-enums.h @@ -38,6 +38,9 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ + +#ifndef CSTYLE_ENUMS_H +#define CSTYLE_ENUMS_H #include class CStyleEnums @@ -48,3 +51,4 @@ public: typedef enum { Foo, Bar } Baz; }; +#endif // CSTYLE_ENUMS_H diff --git a/tests/auto/tools/moc/cxx11-enums.h b/tests/auto/tools/moc/cxx11-enums.h index 0bd99b762c..215ae093d9 100644 --- a/tests/auto/tools/moc/cxx11-enums.h +++ b/tests/auto/tools/moc/cxx11-enums.h @@ -38,6 +38,9 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ + +#ifndef CXX11_ENUMS_H +#define CXX11_ENUMS_H #include #if defined(Q_COMPILER_CLASS_ENUM) || defined(Q_MOC_RUN) @@ -64,3 +67,4 @@ public: enum TypedEnum { B0, B1 , B2, B3 }; }; #endif +#endif // CXX11_ENUMS_H diff --git a/tests/auto/tools/moc/dir-in-include-path.h b/tests/auto/tools/moc/dir-in-include-path.h index 0d46f69d63..34f96bea6b 100644 --- a/tests/auto/tools/moc/dir-in-include-path.h +++ b/tests/auto/tools/moc/dir-in-include-path.h @@ -38,6 +38,9 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ + +#ifndef DIR_IN_INCLUDE_PATH_H +#define DIR_IN_INCLUDE_PATH_H #include class DirInIncludePath : public QObject, public MyInterface @@ -45,3 +48,4 @@ class DirInIncludePath : public QObject, public MyInterface Q_OBJECT Q_INTERFACES(MyInterface) }; +#endif // DIR_IN_INCLUDE_PATH_H diff --git a/tests/auto/tools/moc/dollars.h b/tests/auto/tools/moc/dollars.h index 8fab45559c..b136b00881 100644 --- a/tests/auto/tools/moc/dollars.h +++ b/tests/auto/tools/moc/dollars.h @@ -39,6 +39,9 @@ ** ****************************************************************************/ +#ifndef DOLLARS_H +#define DOLLARS_H + /* both GCC and clang allow $ in identifiers * So moc should not throw a parse error if it parses a file that contains such identifiers */ @@ -68,3 +71,4 @@ namespace $NS { }; } +#endif // DOLLARS_H diff --git a/tests/auto/tools/moc/error-on-wrong-notify.h b/tests/auto/tools/moc/error-on-wrong-notify.h index d13e352143..7358f4e77a 100644 --- a/tests/auto/tools/moc/error-on-wrong-notify.h +++ b/tests/auto/tools/moc/error-on-wrong-notify.h @@ -38,6 +38,9 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ + +#ifndef ERROR_ON_WRONG_NOTIFY_H +#define ERROR_ON_WRONG_NOTIFY_H #include class ClassWithWrongNOTIFY : public QObject @@ -51,3 +54,4 @@ public: int foo() { return m_foo; } }; +#endif // ERROR_ON_WRONG_NOTIFY_H diff --git a/tests/auto/tools/moc/escapes-in-string-literals.h b/tests/auto/tools/moc/escapes-in-string-literals.h index e2f044e196..25f9df2e74 100644 --- a/tests/auto/tools/moc/escapes-in-string-literals.h +++ b/tests/auto/tools/moc/escapes-in-string-literals.h @@ -38,6 +38,9 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ + +#ifndef ESCAPES_IN_STRING_LITERALS_H +#define ESCAPES_IN_STRING_LITERALS_H #include class StringLiterals: public QObject @@ -47,3 +50,4 @@ class StringLiterals: public QObject Q_CLASSINFO("Test2", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\123") Q_CLASSINFO("Test3", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\nb") }; +#endif // ESCAPES_IN_STRING_LITERALS_H diff --git a/tests/auto/tools/moc/extraqualification.h b/tests/auto/tools/moc/extraqualification.h index 5c69699067..875eb56184 100644 --- a/tests/auto/tools/moc/extraqualification.h +++ b/tests/auto/tools/moc/extraqualification.h @@ -39,6 +39,9 @@ ** ****************************************************************************/ +#ifndef EXTRAQUALIFICATION_H +#define EXTRAQUALIFICATION_H + #include class Test : public QObject @@ -55,3 +58,4 @@ public slots: public: Q_SLOT void Test::anotherOne() {} }; +#endif // EXTRAQUALIFICATION_H diff --git a/tests/auto/tools/moc/forgotten-qinterface.h b/tests/auto/tools/moc/forgotten-qinterface.h index 4c8aa45d92..0c2fd87aa5 100644 --- a/tests/auto/tools/moc/forgotten-qinterface.h +++ b/tests/auto/tools/moc/forgotten-qinterface.h @@ -39,6 +39,9 @@ ** ****************************************************************************/ +#ifndef FORGOTTEN_QINTERFACE_H +#define FORGOTTEN_QINTERFACE_H + #include struct MyInterface @@ -53,3 +56,4 @@ class Test : public QObject, public MyInterface { Q_OBJECT }; +#endif // FORGOTTEN_QINTERFACE_H diff --git a/tests/auto/tools/moc/forward-declared-param.h b/tests/auto/tools/moc/forward-declared-param.h index 013c6563e8..441745f9fc 100644 --- a/tests/auto/tools/moc/forward-declared-param.h +++ b/tests/auto/tools/moc/forward-declared-param.h @@ -38,6 +38,9 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ + +#ifndef FORWARD_DECLARED_PARAM_H +#define FORWARD_DECLARED_PARAM_H #include #include @@ -73,4 +76,5 @@ signals: void signalQSet(const QSet &); void signalQSet(const QSet &); void signalQSet(const QSet &); -}; \ No newline at end of file +}; +#endif // FORWARD_DECLARED_PARAM_H diff --git a/tests/auto/tools/moc/function-with-attributes.h b/tests/auto/tools/moc/function-with-attributes.h index afa02e6f3a..88f3e3fcb3 100644 --- a/tests/auto/tools/moc/function-with-attributes.h +++ b/tests/auto/tools/moc/function-with-attributes.h @@ -38,6 +38,9 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ + +#ifndef FUNCTION_WITH_ATTRIBUTES_H +#define FUNCTION_WITH_ATTRIBUTES_H #include // test support for gcc attributes with functions @@ -62,3 +65,4 @@ public slots: DEPRECATED2 void test2() {} }; +#endif // FUNCTION_WITH_ATTRIBUTES_H diff --git a/tests/auto/tools/moc/interface-from-framework.h b/tests/auto/tools/moc/interface-from-framework.h index 8a4188e5ab..c961d18bb9 100644 --- a/tests/auto/tools/moc/interface-from-framework.h +++ b/tests/auto/tools/moc/interface-from-framework.h @@ -38,7 +38,8 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#ifndef INTERFACE_FROM-FRAMEWORK_H + +#ifndef INTERFACE_FROM_FRAMEWORK_H #define INTERFACE_FROM_FRAMEWORK_H #include diff --git a/tests/auto/tools/moc/macro-on-cmdline.h b/tests/auto/tools/moc/macro-on-cmdline.h index 9609b7cd31..681340471d 100644 --- a/tests/auto/tools/moc/macro-on-cmdline.h +++ b/tests/auto/tools/moc/macro-on-cmdline.h @@ -39,6 +39,9 @@ ** ****************************************************************************/ +#ifndef MACRO_ON_CMDLINE_H +#define MACRO_ON_CMDLINE_H + #if FOO class Test : public QObject @@ -48,3 +51,4 @@ public: }; #endif +#endif // MACRO_ON_CMDLINE_H diff --git a/tests/auto/tools/moc/namespaced-flags.h b/tests/auto/tools/moc/namespaced-flags.h index 97aecfbf3c..ce1e12d83f 100644 --- a/tests/auto/tools/moc/namespaced-flags.h +++ b/tests/auto/tools/moc/namespaced-flags.h @@ -38,6 +38,9 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ + +#ifndef NAMESPACED_FLAGS_H +#define NAMESPACED_FLAGS_H #include namespace Foo { @@ -78,3 +81,4 @@ namespace Foo { } Q_DECLARE_OPERATORS_FOR_FLAGS( Foo::Bar::Flags ) +#endif // NAMESPACED_FLAGS_H diff --git a/tests/auto/tools/moc/no-keywords.h b/tests/auto/tools/moc/no-keywords.h index ffd5928370..3fa6f089e0 100644 --- a/tests/auto/tools/moc/no-keywords.h +++ b/tests/auto/tools/moc/no-keywords.h @@ -39,6 +39,9 @@ ** ****************************************************************************/ +#ifndef NO_KEYWORDS_H +#define NO_KEYWORDS_H + #define QT_NO_KEYWORDS #undef signals #undef slots @@ -85,3 +88,4 @@ private: #define emit #undef QT_NO_KEYWORDS +#endif // NO_KEYWORDS_H diff --git a/tests/auto/tools/moc/oldstyle-casts.h b/tests/auto/tools/moc/oldstyle-casts.h index 89f90a3504..42f8381072 100644 --- a/tests/auto/tools/moc/oldstyle-casts.h +++ b/tests/auto/tools/moc/oldstyle-casts.h @@ -38,6 +38,9 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ + +#ifndef OLDSTYLE_CASTS_H +#define OLDSTYLE_CASTS_H #include class Foo: public QObject @@ -54,3 +57,4 @@ public slots: inline void slot(int, QObject * const) {} }; +#endif // OLDSTYLE_CASTS_H diff --git a/tests/auto/tools/moc/parse-boost.h b/tests/auto/tools/moc/parse-boost.h index b93eb7130c..4dd7693358 100644 --- a/tests/auto/tools/moc/parse-boost.h +++ b/tests/auto/tools/moc/parse-boost.h @@ -38,6 +38,9 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ + +#ifndef PARSE_BOOST_H +#define PARSE_BOOST_H #include #include #include @@ -124,3 +127,4 @@ #include #include #include +#endif // PARSE_BOOST_H diff --git a/tests/auto/tools/moc/pp-dollar-signs.h b/tests/auto/tools/moc/pp-dollar-signs.h index 98134a5019..a90b654ee4 100644 --- a/tests/auto/tools/moc/pp-dollar-signs.h +++ b/tests/auto/tools/moc/pp-dollar-signs.h @@ -39,4 +39,8 @@ ** ****************************************************************************/ +#ifndef PP_DOLLAR_SIGNS_H +#define PP_DOLLAR_SIGNS_H + $$ = parser->createFoo() +#endif // PP_DOLLAR_SIGNS_H diff --git a/tests/auto/tools/moc/pure-virtual-signals.h b/tests/auto/tools/moc/pure-virtual-signals.h index fb23089b30..070f5894a3 100644 --- a/tests/auto/tools/moc/pure-virtual-signals.h +++ b/tests/auto/tools/moc/pure-virtual-signals.h @@ -38,6 +38,9 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ + +#ifndef PURE_VIRTUAL_SIGNALS_H +#define PURE_VIRTUAL_SIGNALS_H #include class PureVirtualSignalsTest : public QObject @@ -58,3 +61,4 @@ signals: void mySignal(); void mySignal2(int foo); }; +#endif // PURE_VIRTUAL_SIGNALS_H diff --git a/tests/auto/tools/moc/qinvokable.h b/tests/auto/tools/moc/qinvokable.h index 9070f2ab8e..a47ae72b2b 100644 --- a/tests/auto/tools/moc/qinvokable.h +++ b/tests/auto/tools/moc/qinvokable.h @@ -39,6 +39,9 @@ ** ****************************************************************************/ +#ifndef QINVOKABLE_H +#define QINVOKABLE_H + #include class InvokableBeforeReturnType : public QObject @@ -55,3 +58,4 @@ public: Q_INVOKABLE inline void foo() {} Q_INVOKABLE virtual void bar() {} }; +#endif // QINVOKABLE_H diff --git a/tests/auto/tools/moc/qprivateslots.h b/tests/auto/tools/moc/qprivateslots.h index 5b0db3d27e..82a68270af 100644 --- a/tests/auto/tools/moc/qprivateslots.h +++ b/tests/auto/tools/moc/qprivateslots.h @@ -39,6 +39,9 @@ ** ****************************************************************************/ +#ifndef QPRIVATESLOTS_H +#define QPRIVATESLOTS_H + #include struct TestQPrivateSlots_Private @@ -58,3 +61,4 @@ private: TestQPrivateSlots_Private *d; }; +#endif // QPRIVATESLOTS_H diff --git a/tests/auto/tools/moc/qtbug-35657-gadget.h b/tests/auto/tools/moc/qtbug-35657-gadget.h index 1f25ce1b1d..c030405c67 100644 --- a/tests/auto/tools/moc/qtbug-35657-gadget.h +++ b/tests/auto/tools/moc/qtbug-35657-gadget.h @@ -39,6 +39,9 @@ ** ****************************************************************************/ +#ifndef QTBUG_35657_GADGET_H +#define QTBUG_35657_GADGET_H + #include namespace QTBUG_35657 { @@ -49,3 +52,5 @@ namespace QTBUG_35657 { enum SomeEnum { SomeEnumValue = 0 }; }; } + +#endif // QTBUG_35657_GADGET_H diff --git a/tests/auto/tools/moc/related-metaobjects-in-gadget.h b/tests/auto/tools/moc/related-metaobjects-in-gadget.h index 5665a79251..556e92efaf 100644 --- a/tests/auto/tools/moc/related-metaobjects-in-gadget.h +++ b/tests/auto/tools/moc/related-metaobjects-in-gadget.h @@ -39,6 +39,9 @@ ** ****************************************************************************/ +#ifndef RELATED_METAOBJECTS_IN_GADGET_H +#define RELATED_METAOBJECTS_IN_GADGET_H + #include #include "qtbug-35657-gadget.h" @@ -52,3 +55,5 @@ namespace QTBUG_35657 { A::SomeEnum blah() const { return A::SomeEnumValue; } }; } + +#endif // RELATED_METAOBJECTS_IN_GADGET_H diff --git a/tests/auto/tools/moc/related-metaobjects-in-namespaces.h b/tests/auto/tools/moc/related-metaobjects-in-namespaces.h index 0a3e9ed77d..4be856391f 100644 --- a/tests/auto/tools/moc/related-metaobjects-in-namespaces.h +++ b/tests/auto/tools/moc/related-metaobjects-in-namespaces.h @@ -39,6 +39,9 @@ ** ****************************************************************************/ +#ifndef RELATED_METAOBJECTS_IN_NAMESPACES_H +#define RELATED_METAOBJECTS_IN_NAMESPACES_H + #include namespace QTBUG_2151 { @@ -58,3 +61,5 @@ namespace QTBUG_2151 { A::SomeEnum blah() const { return A::SomeEnumValue; } }; } + +#endif // RELATED_METAOBJECTS_IN_NAMESPACES_H diff --git a/tests/auto/tools/moc/single-quote-digit-separator-n3781.h b/tests/auto/tools/moc/single-quote-digit-separator-n3781.h index 0b234011d5..f5f39c7dd7 100644 --- a/tests/auto/tools/moc/single-quote-digit-separator-n3781.h +++ b/tests/auto/tools/moc/single-quote-digit-separator-n3781.h @@ -39,6 +39,9 @@ ** ****************************************************************************/ +#ifndef SINGLE_QUOTE_DIGIT_SEPARATOR_N3781_H +#define SINGLE_QUOTE_DIGIT_SEPARATOR_N3781_H + #include class KDAB : public QObject @@ -56,3 +59,4 @@ public: }; Q_ENUMS(Salaries) }; +#endif // SINGLE_QUOTE_DIGIT_SEPARATOR_N3781_H diff --git a/tests/auto/tools/moc/single_function_keyword.h b/tests/auto/tools/moc/single_function_keyword.h index 44a1a41d30..6717509517 100644 --- a/tests/auto/tools/moc/single_function_keyword.h +++ b/tests/auto/tools/moc/single_function_keyword.h @@ -38,6 +38,9 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ + +#ifndef SINGLE_FUNCTION_KEYWORD_H +#define SINGLE_FUNCTION_KEYWORD_H #include class SingleFunctionKeywordBeforeReturnType : public QObject @@ -73,3 +76,4 @@ public: inline Q_SLOT void mySlot() { emit mySignal(); } }; +#endif // SINGLE_FUNCTION_KEYWORD_H diff --git a/tests/auto/tools/moc/slots-with-void-template.h b/tests/auto/tools/moc/slots-with-void-template.h index c38437ca54..524d565345 100644 --- a/tests/auto/tools/moc/slots-with-void-template.h +++ b/tests/auto/tools/moc/slots-with-void-template.h @@ -38,6 +38,9 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ + +#ifndef SLOTS_WITH_VOID_TEMPLATE_H +#define SLOTS_WITH_VOID_TEMPLATE_H #include template @@ -59,3 +62,4 @@ signals: void myVoidSignal(); void myVoidSignal2(void); }; +#endif // SLOTS_WITH_VOID_TEMPLATE_H diff --git a/tests/auto/tools/moc/task192552.h b/tests/auto/tools/moc/task192552.h index 23665bbb07..b221984d7d 100644 --- a/tests/auto/tools/moc/task192552.h +++ b/tests/auto/tools/moc/task192552.h @@ -38,6 +38,9 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ + +#ifndef TASK192552_H +#define TASK192552_H /* <:: is not valid C++, but we want moc to treat it as < :: since this is usually the intention @@ -53,3 +56,4 @@ public: QList<::QObject*> m_objects; #endif }; +#endif // TASK192552_H diff --git a/tests/auto/tools/moc/task234909.h b/tests/auto/tools/moc/task234909.h index 2ad8b9a410..37948441eb 100644 --- a/tests/auto/tools/moc/task234909.h +++ b/tests/auto/tools/moc/task234909.h @@ -38,6 +38,9 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ + +#ifndef TASK234909_H +#define TASK234909_H #include namespace NS_A { @@ -71,3 +74,4 @@ namespace NS_Main { } } +#endif // TASK234909_H diff --git a/tests/auto/tools/moc/task87883.h b/tests/auto/tools/moc/task87883.h index d6687588f7..65988221f1 100644 --- a/tests/auto/tools/moc/task87883.h +++ b/tests/auto/tools/moc/task87883.h @@ -38,6 +38,9 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ + +#ifndef TASK87883_H +#define TASK87883_H /* The bug is triggered only if there is a multiline comment after an #include statement that in the following line contains a single quote but lacks a finishing @@ -55,3 +58,4 @@ public: inline Task87883() {} }; +#endif // TASK87883_H diff --git a/tests/auto/tools/moc/template-gtgt.h b/tests/auto/tools/moc/template-gtgt.h index 2c2f56c34d..b5d83b5796 100644 --- a/tests/auto/tools/moc/template-gtgt.h +++ b/tests/auto/tools/moc/template-gtgt.h @@ -38,6 +38,9 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ + +#ifndef TEMPLATE_GTGT_H +#define TEMPLATE_GTGT_H template class myTemplate : QString, @@ -58,3 +61,4 @@ public: { } }; +#endif // TEMPLATE_GTGT_H diff --git a/tests/auto/tools/moc/trigraphs.h b/tests/auto/tools/moc/trigraphs.h index cc1824190e..301ea35265 100644 --- a/tests/auto/tools/moc/trigraphs.h +++ b/tests/auto/tools/moc/trigraphs.h @@ -39,6 +39,9 @@ ** ****************************************************************************/ +#ifndef TRIGRAPHS_H +#define TRIGRAPHS_H + #include namespace AAA { @@ -61,3 +64,4 @@ namespace BBB { }; } +#endif // TRIGRAPHS_H diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index e0e6129075..031884501c 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -692,8 +692,8 @@ void tst_Moc::warnOnExtraSignalSlotQualifiaction() QVERIFY(!mocOut.isEmpty()); QString mocWarning = QString::fromLocal8Bit(proc.readAllStandardError()); QCOMPARE(mocWarning, header + - QString(":53: Warning: Function declaration Test::badFunctionDeclaration contains extra qualification. Ignoring as signal or slot.\n") + - header + QString(":56: Warning: parsemaybe: Function declaration Test::anotherOne contains extra qualification. Ignoring as signal or slot.\n")); + QString(":56: Warning: Function declaration Test::badFunctionDeclaration contains extra qualification. Ignoring as signal or slot.\n") + + header + QString(":59: Warning: parsemaybe: Function declaration Test::anotherOne contains extra qualification. Ignoring as signal or slot.\n")); #else QSKIP("Only tested on linux/gcc"); #endif @@ -971,7 +971,7 @@ void tst_Moc::warnOnMultipleInheritance() QVERIFY(!mocOut.isEmpty()); QString mocWarning = QString::fromLocal8Bit(proc.readAllStandardError()); QCOMPARE(mocWarning, header + - QString(":53: Warning: Class Bar inherits from two QObject subclasses QWindow and Foo. This is not supported!\n")); + QString(":56: Warning: Class Bar inherits from two QObject subclasses QWindow and Foo. This is not supported!\n")); #else QSKIP("Only tested on linux/gcc"); #endif @@ -1034,7 +1034,7 @@ void tst_Moc::forgottenQInterface() QVERIFY(!mocOut.isEmpty()); QString mocWarning = QString::fromLocal8Bit(proc.readAllStandardError()); QCOMPARE(mocWarning, header + - QString(":55: Warning: Class Test implements the interface MyInterface but does not list it in Q_INTERFACES. qobject_cast to MyInterface will not work!\n")); + QString(":58: Warning: Class Test implements the interface MyInterface but does not list it in Q_INTERFACES. qobject_cast to MyInterface will not work!\n")); #else QSKIP("Only tested on linux/gcc"); #endif @@ -1350,7 +1350,7 @@ void tst_Moc::warnOnPropertyWithoutREAD() QVERIFY(!mocOut.isEmpty()); QString mocWarning = QString::fromLocal8Bit(proc.readAllStandardError()); QCOMPARE(mocWarning, header + - QString(":46: Warning: Property declaration foo has no READ accessor function or associated MEMBER variable. The property will be invalid.\n")); + QString(":49: Warning: Property declaration foo has no READ accessor function or associated MEMBER variable. The property will be invalid.\n")); #else QSKIP("Only tested on linux/gcc"); #endif @@ -1460,8 +1460,8 @@ void tst_Moc::warnOnVirtualSignal() QByteArray mocOut = proc.readAllStandardOutput(); QVERIFY(!mocOut.isEmpty()); QString mocWarning = QString::fromLocal8Bit(proc.readAllStandardError()); - QCOMPARE(mocWarning, header + QString(":48: Warning: Signals cannot be declared virtual\n") + - header + QString(":50: Warning: Signals cannot be declared virtual\n")); + QCOMPARE(mocWarning, header + QString(":51: Warning: Signals cannot be declared virtual\n") + + header + QString(":53: Warning: Signals cannot be declared virtual\n")); #else QSKIP("Only tested on linux/gcc"); #endif @@ -1575,7 +1575,7 @@ void tst_Moc::notifyError() QVERIFY(mocOut.isEmpty()); QString mocError = QString::fromLocal8Bit(proc.readAllStandardError()); QCOMPARE(mocError, header + - QString(":52: Error: NOTIFY signal 'fooChanged' of property 'foo' does not exist in class ClassWithWrongNOTIFY.\n")); + QString(":55: Error: NOTIFY signal 'fooChanged' of property 'foo' does not exist in class ClassWithWrongNOTIFY.\n")); #else QSKIP("Only tested on linux/gcc"); #endif diff --git a/tests/auto/tools/moc/unterminated-function-macro.h b/tests/auto/tools/moc/unterminated-function-macro.h index 813d60f0e4..60595d1536 100644 --- a/tests/auto/tools/moc/unterminated-function-macro.h +++ b/tests/auto/tools/moc/unterminated-function-macro.h @@ -39,6 +39,9 @@ ** ****************************************************************************/ +#ifndef UNTERMINATED_FUNCTION_MACRO_H +#define UNTERMINATED_FUNCTION_MACRO_H + class Dummy : public QObject { Q_OBJECT } @@ -49,3 +52,4 @@ static void foo() { MACRO(foo } +#endif // UNTERMINATED_FUNCTION_MACRO_H diff --git a/tests/auto/tools/moc/using-namespaces.h b/tests/auto/tools/moc/using-namespaces.h index c662bb762a..64ffa96a21 100644 --- a/tests/auto/tools/moc/using-namespaces.h +++ b/tests/auto/tools/moc/using-namespaces.h @@ -39,6 +39,9 @@ ** ****************************************************************************/ +#ifndef USING_NAMESPACES_H +#define USING_NAMESPACES_H + namespace Foo {} namespace Bar { @@ -54,3 +57,4 @@ using namespace Foo; using namespace Bar::Huh; using namespace ::Top; +#endif // USING_NAMESPACES_H diff --git a/tests/auto/tools/moc/warn-on-multiple-qobject-subclasses.h b/tests/auto/tools/moc/warn-on-multiple-qobject-subclasses.h index 346909cca1..bbe416f7f0 100644 --- a/tests/auto/tools/moc/warn-on-multiple-qobject-subclasses.h +++ b/tests/auto/tools/moc/warn-on-multiple-qobject-subclasses.h @@ -39,6 +39,9 @@ ** ****************************************************************************/ +#ifndef WARN_ON_MULTIPLE_QOBJECT_SUBCLASSES_H +#define WARN_ON_MULTIPLE_QOBJECT_SUBCLASSES_H + #include class Foo : public QObject @@ -53,3 +56,4 @@ class Bar : public QWindow, public Foo }; +#endif // WARN_ON_MULTIPLE_QOBJECT_SUBCLASSES_H diff --git a/tests/auto/tools/moc/warn-on-property-without-read.h b/tests/auto/tools/moc/warn-on-property-without-read.h index 75d2953aa1..85c092d240 100644 --- a/tests/auto/tools/moc/warn-on-property-without-read.h +++ b/tests/auto/tools/moc/warn-on-property-without-read.h @@ -38,6 +38,9 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ + +#ifndef WARN_ON_PROPERTY_WITHOUT_READ_H +#define WARN_ON_PROPERTY_WITHOUT_READ_H #include class ClassWithPropertyWithoutREAD : public QObject @@ -46,3 +49,4 @@ class ClassWithPropertyWithoutREAD : public QObject Q_PROPERTY(int foo) Q_PROPERTY(int bar READ bar) }; +#endif // WARN_ON_PROPERTY_WITHOUT_READ_H -- cgit v1.2.3