diff options
author | Eike Ziller <eike.ziller@theqtcompany.com> | 2015-02-12 17:36:29 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@theqtcompany.com> | 2015-02-12 17:36:29 +0100 |
commit | 56aadc407d7becadec794e660ae7d7c20e820e0c (patch) | |
tree | c9aad23933bc6b0c68406e64e359f57143ef54d8 /tests/auto/cplusplus/preprocessor | |
parent | 9926fc2ab12ccaa02b7f03b416c54cd58ef30b31 (diff) | |
parent | 28971701fd4baa99f294d9393650b83c40754e18 (diff) | |
download | qt-creator-56aadc407d7becadec794e660ae7d7c20e820e0c.tar.gz |
Merge remote-tracking branch 'origin/3.3'
Conflicts:
src/plugins/debugger/watchhandler.cpp
src/plugins/projectexplorer/kitmodel.cpp
src/plugins/qbsprojectmanager/qbsprojectmanager.cpp
src/shared/qbs
Change-Id: I6a68090993a264e93ac7850858cc24ba6bdb5602
Diffstat (limited to 'tests/auto/cplusplus/preprocessor')
-rw-r--r-- | tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp b/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp index 4852e24217..c9e417c59b 100644 --- a/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp +++ b/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp @@ -390,6 +390,7 @@ private slots: void empty_trailing_lines_data(); void undef(); void concat(); + void excessive_nesting(); }; // Remove all #... lines, and 'simplify' string, to allow easily comparing the result @@ -1901,6 +1902,23 @@ void tst_Preprocessor::concat() QCOMPARE(prep.constData(), output.constData()); } +void tst_Preprocessor::excessive_nesting() +{ + Environment env; + Preprocessor preprocess(0, &env); + QByteArray input; + const QByteArray output = + "# 1 \"<stdin>\"\n" + "# 2001 \"<stdin>\"\n"; + for (int i = 0; i < 1000; ++i) + input += "#if FOO\n"; + for (int i = 0; i < 1000; ++i) + input += "#endif\n"; + QByteArray prep = preprocess.run(QLatin1String("<stdin>"), input); + // Output cannot be precisely determined, but it shouldn't crash. + QCOMPARE(prep, output); +} + void tst_Preprocessor::compare_input_output(bool keepComments) { QFETCH(QByteArray, input); |