File indexing completed on 2024-04-28 05:02:28

0001 /*
0002     SPDX-FileCopyrightText: 2002 Thomas Baumgart tbaumgart @kde.org
0003 
0004     This file is part of libalkimia.
0005 
0006     SPDX-License-Identifier: LGPL-2.1-or-later
0007 */
0008 
0009 #include "alkexceptiontest.h"
0010 
0011 #include "test.h"
0012 
0013 QTEST_GUILESS_MAIN(AlkExceptionTest)
0014 
0015 void AlkExceptionTest::init()
0016 {
0017 }
0018 
0019 void AlkExceptionTest::cleanup()
0020 {
0021 }
0022 
0023 void AlkExceptionTest::testDefaultConstructor()
0024 {
0025     const AlkException &e = ALKEXCEPTION("Message");
0026     QVERIFY(e.what() == "Message");
0027     QVERIFY(e.line() == __LINE__ - 2);
0028     QVERIFY(e.file() == __FILE__);
0029 }
0030 
0031 void AlkExceptionTest::testConstructor()
0032 {
0033     AlkException e("New message", "Joe's file", 1234);
0034     QVERIFY(e.what() == "New message");
0035     QVERIFY(e.line() == 1234);
0036     QVERIFY(e.file() == "Joe's file");
0037 }