qttest.cpp 556 B

123456789101112131415161718192021222324252627282930
  1. // (c) Copyright Juergen Hunold 2012
  2. // Use, modification and distribution is subject to the Boost Software
  3. // License, Version 1.0. (See accompanying file LICENSE.txt or copy at
  4. // https://www.bfgroup.xyz/b2/LICENSE.txt)
  5. #include <QtTest>
  6. class QtTest: public QObject
  7. {
  8. /*!
  9. Test if the moc gets the #define
  10. */
  11. #if defined(TEST_MOCK)
  12. Q_OBJECT
  13. #endif
  14. private Q_SLOTS:
  15. void toUpper();
  16. };
  17. void
  18. QtTest::toUpper()
  19. {
  20. QString str = "Hello";
  21. QCOMPARE(str.toUpper(), QString("HELLO"));
  22. }
  23. QTEST_MAIN(QtTest)
  24. #include "qttest.moc"