just tests the constuctor, getMesh, and isLoaded method. This confirms that a basic spherical mesh can be loaded in correctly
26 lines
647 B
C++
26 lines
647 B
C++
#include <gtest/gtest.h>
|
|
#include "meshIO.h"
|
|
#include <iostream>
|
|
#include <string>
|
|
#include "mfem.hpp"
|
|
|
|
std::string EXAMPLE_FILENAME = std::string(getenv("MESON_SOURCE_ROOT")) + "/src/resources/mesh/sphere.msh";
|
|
|
|
|
|
class meshIOTest : public ::testing::Test {};
|
|
|
|
TEST_F(meshIOTest, DefaultConstructor) {
|
|
EXPECT_NO_THROW(MeshIO meshIO(EXAMPLE_FILENAME));
|
|
}
|
|
|
|
TEST_F(meshIOTest, IsLoaded) {
|
|
MeshIO meshIO(EXAMPLE_FILENAME);
|
|
EXPECT_EQ(meshIO.IsLoaded(), true);
|
|
}
|
|
|
|
TEST_F(meshIOTest, GetMesh) {
|
|
MeshIO meshIO(EXAMPLE_FILENAME);
|
|
mfem::Mesh& mesh = meshIO.GetMesh();
|
|
EXPECT_EQ(mesh.GetNE(), 670);
|
|
EXPECT_EQ(mesh.GetNV(), 201);
|
|
} |