Revert "C++: Re-enable macro definition line test"

This reverts commit 44d8e7bef7.

The original test case was actually right. I guess I was mislead
by the recently added preprocessor tests, which are the ones
that should be corrected (together with the preprocessor, which
seems to have issues with # lineno generation).

Conflicts:

	tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp

Change-Id: I47f82ed23a37086d0d81c4b3ea2cac48fb753451
Reviewed-by: hjk <qthjk@ovi.com>
Reviewed-by: Francois Ferrand <thetypz@gmail.com>
This commit is contained in:
Leandro Melo
2012-06-13 09:50:39 +02:00
committed by hjk
parent f978400ae5
commit 9daa34003d

View File

@@ -300,6 +300,9 @@ protected:
} }
static QString simplified(QByteArray buf); static QString simplified(QByteArray buf);
private /* not corrected yet */:
void macro_definition_lineno();
private slots: private slots:
void defined(); void defined();
void defined_data(); void defined_data();
@@ -310,7 +313,6 @@ private slots:
void macro_args_count(); void macro_args_count();
void invalid_param_count(); void invalid_param_count();
void objmacro_expanding_as_fnmacro_notification(); void objmacro_expanding_as_fnmacro_notification();
void macro_definition_lineno();
void macro_uses(); void macro_uses();
void macro_uses_lines(); void macro_uses_lines();
void macro_arguments_notificatin(); void macro_arguments_notificatin();
@@ -540,30 +542,30 @@ void tst_Preprocessor::macro_definition_lineno()
QByteArray preprocessed = preprocess.run(QLatin1String("<stdin>"), QByteArray preprocessed = preprocess.run(QLatin1String("<stdin>"),
QByteArray("#define foo(ARGS) int f(ARGS)\n" QByteArray("#define foo(ARGS) int f(ARGS)\n"
"foo(int a);\n")); "foo(int a);\n"));
QVERIFY(preprocessed.contains("#gen true\n# 1 \"<stdin>\"\nint f")); QVERIFY(preprocessed.contains("#gen true\n# 2 \"<stdin>\"\nint f"));
preprocessed = preprocess.run(QLatin1String("<stdin>"), preprocessed = preprocess.run(QLatin1String("<stdin>"),
QByteArray("#define foo(ARGS) int f(ARGS)\n" QByteArray("#define foo(ARGS) int f(ARGS)\n"
"foo(int a)\n" "foo(int a)\n"
";\n")); ";\n"));
QVERIFY(preprocessed.contains("#gen true\n# 1 \"<stdin>\"\nint f")); QVERIFY(preprocessed.contains("#gen true\n# 2 \"<stdin>\"\nint f"));
preprocessed = preprocess.run(QLatin1String("<stdin>"), preprocessed = preprocess.run(QLatin1String("<stdin>"),
QByteArray("#define foo(ARGS) int f(ARGS)\n" QByteArray("#define foo(ARGS) int f(ARGS)\n"
"foo(int \n" "foo(int \n"
" a);\n")); " a);\n"));
QVERIFY(preprocessed.contains("#gen true\n# 1 \"<stdin>\"\nint f")); QVERIFY(preprocessed.contains("#gen true\n# 2 \"<stdin>\"\nint f"));
preprocessed = preprocess.run(QLatin1String("<stdin>"), preprocessed = preprocess.run(QLatin1String("<stdin>"),
QByteArray("#define foo int f\n" QByteArray("#define foo int f\n"
"foo;\n")); "foo;\n"));
QVERIFY(preprocessed.contains("#gen true\n# 1 \"<stdin>\"\nint f")); QVERIFY(preprocessed.contains("#gen true\n# 2 \"<stdin>\"\nint f"));
preprocessed = preprocess.run(QLatin1String("<stdin>"), preprocessed = preprocess.run(QLatin1String("<stdin>"),
QByteArray("#define foo int f\n" QByteArray("#define foo int f\n"
"foo\n" "foo\n"
";\n")); ";\n"));
QVERIFY(preprocessed.contains("#gen true\n# 1 \"<stdin>\"\nint f")); QVERIFY(preprocessed.contains("#gen true\n# 2 \"<stdin>\"\nint f"));
} }
void tst_Preprocessor::objmacro_expanding_as_fnmacro_notification() void tst_Preprocessor::objmacro_expanding_as_fnmacro_notification()