QtTest: [skip ci] enable Qt testing framework

This commit is contained in:
wmayer
2022-12-01 13:57:00 +01:00
parent 5a5394516e
commit 4e8ecc41b6
4 changed files with 98 additions and 1 deletions

View File

@@ -0,0 +1,62 @@
#include <QTest>
#include <sstream>
#include <Base/Builder3D.h>
class testInventorBuilder : public QObject
{
Q_OBJECT
public:
testInventorBuilder()
: builder(output)
{
}
~testInventorBuilder()
{
}
private Q_SLOTS:
void initTestCase()
{
}
void initTestCase_data()
{
}
void cleanupTestCase()
{
}
void init()
{
}
void cleanup()
{
// clear the buffer
output.str(std::string());
}
void test_Output()
{
QCOMPARE(output.str().c_str(), "#Inventor V2.1 ascii \n\n");
}
void test_MaterialBinding()
{
Base::MaterialBindingItem item{Base::MaterialBinding{}};
builder.addNode(item);
QCOMPARE(output.str().c_str(), "MaterialBinding { value OVERALL } \n");
}
private:
std::stringstream output;
Base::InventorBuilder builder;
};
QTEST_GUILESS_MAIN(testInventorBuilder)
#include "InventorBuilder.moc"