Merge branch 'main' into bgbsww-toponaming-makeElementFace
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include <array>
|
||||
#include <fmt/core.h>
|
||||
|
||||
#include <App/Application.h>
|
||||
#include <App/ComplexGeoData.h>
|
||||
@@ -318,7 +317,8 @@ TEST_F(ComplexGeoDataTest, elementTypeCharMappedNameWithPrefix) // NOLINT
|
||||
int size {0};
|
||||
Data::MappedName mappedName;
|
||||
Data::IndexedName indexedName;
|
||||
auto name = fmt::format("{}TestMappedElement:;", Data::ELEMENT_MAP_PREFIX);
|
||||
std::string name(Data::ELEMENT_MAP_PREFIX);
|
||||
name.append("TestMappedElement:;");
|
||||
std::tie(indexedName, mappedName) = createMappedName(name);
|
||||
|
||||
// Act
|
||||
|
||||
@@ -127,3 +127,91 @@ TEST_F(MappedElementTest, lessThanOperator)
|
||||
EXPECT_FALSE(mappedElement2A < mappedElement1B);
|
||||
EXPECT_FALSE(mappedElement2B < mappedElement2BDuplicate);
|
||||
}
|
||||
|
||||
TEST_F(MappedElementTest, comparatorBothAreZeroSize)
|
||||
{
|
||||
// Arrange
|
||||
Data::MappedName mappedName1 {""};
|
||||
Data::MappedName mappedName2 {""};
|
||||
auto comp = Data::ElementNameComparator();
|
||||
|
||||
// Act & Assert
|
||||
EXPECT_FALSE(comp(mappedName1, mappedName2));
|
||||
}
|
||||
|
||||
TEST_F(MappedElementTest, comparatorOneIsZeroSize)
|
||||
{
|
||||
// Arrange
|
||||
Data::MappedName mappedName1 {""};
|
||||
Data::MappedName mappedName2 {"#12345"};
|
||||
auto comp = Data::ElementNameComparator();
|
||||
|
||||
// Act & Assert
|
||||
EXPECT_TRUE(comp(mappedName1, mappedName2));
|
||||
}
|
||||
|
||||
TEST_F(MappedElementTest, comparatorBothStartWithHexDigitsThatDiffer)
|
||||
{
|
||||
// Arrange
|
||||
Data::MappedName mappedName1 {"#fed;B"};
|
||||
Data::MappedName mappedName2 {"#abcdef;A"};
|
||||
auto comp = Data::ElementNameComparator();
|
||||
|
||||
// Act & Assert
|
||||
EXPECT_TRUE(comp(mappedName1, mappedName2));
|
||||
}
|
||||
|
||||
TEST_F(MappedElementTest, comparatorBothStartWithTheSameHexDigits)
|
||||
{
|
||||
// Arrange
|
||||
Data::MappedName mappedName1 {"#12345;B"};
|
||||
Data::MappedName mappedName2 {"#12345;A"};
|
||||
auto comp = Data::ElementNameComparator();
|
||||
|
||||
// Act & Assert
|
||||
EXPECT_FALSE(comp(mappedName1, mappedName2));
|
||||
}
|
||||
|
||||
TEST_F(MappedElementTest, DISABLED_comparatorHexWithoutTerminatorIsBroken)
|
||||
{
|
||||
// Arrange
|
||||
Data::MappedName mappedName1 {"#fed"};
|
||||
Data::MappedName mappedName2 {"#abcdef"};
|
||||
auto comp = Data::ElementNameComparator();
|
||||
|
||||
// Act & Assert
|
||||
EXPECT_FALSE(comp(mappedName1, mappedName2));
|
||||
}
|
||||
|
||||
TEST_F(MappedElementTest, comparatorNoHexDigitsLexicalCompare)
|
||||
{
|
||||
// Arrange
|
||||
Data::MappedName mappedName1 {"A"};
|
||||
Data::MappedName mappedName2 {"B"};
|
||||
auto comp = Data::ElementNameComparator();
|
||||
|
||||
// Act & Assert
|
||||
EXPECT_TRUE(comp(mappedName1, mappedName2));
|
||||
}
|
||||
|
||||
TEST_F(MappedElementTest, comparatorNoHexDigitsSameStringNumericCompare)
|
||||
{
|
||||
// Arrange
|
||||
Data::MappedName mappedName1 {"Edge123456;"};
|
||||
Data::MappedName mappedName2 {"Edge321;"};
|
||||
auto comp = Data::ElementNameComparator();
|
||||
|
||||
// Act & Assert
|
||||
EXPECT_FALSE(comp(mappedName1, mappedName2));
|
||||
}
|
||||
|
||||
TEST_F(MappedElementTest, DISABLED_comparatorIntegerWithoutTerminatorIsBroken)
|
||||
{
|
||||
// Arrange
|
||||
Data::MappedName mappedName1 {"Edge123456"};
|
||||
Data::MappedName mappedName2 {"Edge321"};
|
||||
auto comp = Data::ElementNameComparator();
|
||||
|
||||
// Act & Assert
|
||||
EXPECT_FALSE(comp(mappedName1, mappedName2));
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "Base/Reader.h"
|
||||
#include <array>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <fmt/format.h>
|
||||
#include <fstream>
|
||||
|
||||
namespace fs = boost::filesystem;
|
||||
|
||||
Reference in New Issue
Block a user