Files
qt-creator/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp

29 lines
684 B
C++
Raw Normal View History

2009-03-02 11:30:43 +01:00
#include <QtTest>
#include <pp.h>
using namespace CPlusPlus;
2009-03-02 11:30:43 +01:00
class tst_Preprocessor: public QObject
{
Q_OBJECT
private Q_SLOTS:
void unfinished_function_like_macro_call();
2009-03-02 11:30:43 +01:00
};
void tst_Preprocessor::unfinished_function_like_macro_call()
{
Client *client = 0; // no client.
Environment env;
Preprocessor preprocess(client, &env);
2009-06-19 11:19:41 +02:00
QByteArray preprocessed = preprocess(QLatin1String("<stdin>"),
QByteArray("\n#define foo(a,b) a + b"
"\nfoo(1, 2\n"));
2009-10-27 11:05:35 +01:00
QCOMPARE(preprocessed.trimmed(), QByteArray("foo"));
}
2009-03-02 11:30:43 +01:00
QTEST_APPLESS_MAIN(tst_Preprocessor)
#include "tst_preprocessor.moc"