File indexing completed on 2025-01-05 05:23:49

0001 /*
0002     This file is part of the Okteta Kasten module, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 2007 Friedrich W. H. Kossebau <kossebau@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 
0009 #include "bytearraydocumentfactorytest.hpp"
0010 
0011 // test object
0012 #include <bytearraydocumentfactory.hpp>
0013 // lib
0014 #include <bytearraydocument.hpp>
0015 // Qt
0016 #include <QTest>
0017 
0018 namespace Kasten {
0019 
0020 void ByteArrayDocumentFactoryTest::testCreate()
0021 {
0022     auto* factory = new ByteArrayDocumentFactory();
0023 
0024     AbstractDocument* document = factory->create();
0025     auto* byteArrayDocument = qobject_cast<ByteArrayDocument*>(document);
0026 
0027     QVERIFY(document != nullptr);
0028     QVERIFY(byteArrayDocument != nullptr);
0029     QCOMPARE(document->contentFlags(), Kasten::ContentStateNormal);
0030 
0031     delete document;
0032     delete factory;
0033 }
0034 
0035 }
0036 
0037 QTEST_GUILESS_MAIN(Kasten::ByteArrayDocumentFactoryTest)
0038 
0039 #include "moc_bytearraydocumentfactorytest.cpp"