tests: Add unit tests for getElementTypes()

This commit is contained in:
wmayer
2024-05-29 15:04:37 +02:00
committed by wwmayer
parent 574fb46e65
commit 0490c0195a
5 changed files with 100 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
#include "gtest/gtest.h"
#include <src/App/InitApplication.h>
#include <Mod/Mesh/App/MeshFeature.h>
class MeshFeatureTest: public ::testing::Test
{
protected:
static void SetUpTestSuite()
{
tests::initApplication();
}
void SetUp() override
{}
void TearDown() override
{}
};
// NOLINTBEGIN(cppcoreguidelines-*,readability-*)
TEST_F(MeshFeatureTest, getElementTypes)
{
Mesh::Feature mf;
std::vector<const char*> types = mf.getElementTypes();
EXPECT_EQ(types.size(), 2);
EXPECT_STREQ(types[0], "Mesh");
EXPECT_STREQ(types[1], "Segment");
}
TEST_F(MeshFeatureTest, getComplexElementTypes)
{
Mesh::MeshObject mf;
std::vector<const char*> types = mf.getElementTypes();
EXPECT_EQ(types.size(), 2);
EXPECT_STREQ(types[0], "Mesh");
EXPECT_STREQ(types[1], "Segment");
}
// NOLINTEND(cppcoreguidelines-*,readability-*)