|
@@ -3,7 +3,7 @@
|
|
|
* Company: Lynar Studios
|
|
|
* E-Mail: webmaster@lynarstudios.com
|
|
|
* Created: 2023-02-13
|
|
|
-* Changed: 2023-03-25
|
|
|
+* Changed: 2023-05-18
|
|
|
*
|
|
|
* */
|
|
|
|
|
@@ -72,7 +72,7 @@ namespace
|
|
|
|
|
|
TEST_F(SectionPairSectionTest, add)
|
|
|
{
|
|
|
- shared_ptr<SectionPairSection> section = make_shared<SectionPairSection>("general");
|
|
|
+ auto section = make_shared<SectionPairSection>("general");
|
|
|
section->add(make_shared<SectionPairRow>("color", SectionPairRowEnumType::SECTION_PAIR_ROW_SINGLE_VALUE));
|
|
|
|
|
|
ASSERT_EQ(1, section->getRowAmount());
|
|
@@ -80,7 +80,7 @@ namespace
|
|
|
|
|
|
TEST_F(SectionPairSectionTest, add_row_already_exists)
|
|
|
{
|
|
|
- shared_ptr<SectionPairSection> section = make_shared<SectionPairSection>("general");
|
|
|
+ auto section = make_shared<SectionPairSection>("general");
|
|
|
section->add(make_shared<SectionPairRow>("color", SectionPairRowEnumType::SECTION_PAIR_ROW_SINGLE_VALUE));
|
|
|
|
|
|
EXPECT_THROW(
|
|
@@ -99,7 +99,7 @@ namespace
|
|
|
|
|
|
TEST_F(SectionPairSectionTest, clear)
|
|
|
{
|
|
|
- shared_ptr<SectionPairSection> section = make_shared<SectionPairSection>("general");
|
|
|
+ auto section = make_shared<SectionPairSection>("general");
|
|
|
section->add(make_shared<SectionPairRow>("color", SectionPairRowEnumType::SECTION_PAIR_ROW_SINGLE_VALUE));
|
|
|
|
|
|
ASSERT_EQ(1, section->getRowAmount());
|
|
@@ -109,7 +109,7 @@ namespace
|
|
|
|
|
|
TEST_F(SectionPairSectionTest, get_by_index)
|
|
|
{
|
|
|
- shared_ptr<SectionPairSection> section = make_shared<SectionPairSection>("general");
|
|
|
+ auto section = make_shared<SectionPairSection>("general");
|
|
|
section->add(make_shared<SectionPairRow>("color", SectionPairRowEnumType::SECTION_PAIR_ROW_SINGLE_VALUE));
|
|
|
|
|
|
ASSERT_TRUE(section->get(0) != nullptr);
|
|
@@ -117,7 +117,7 @@ namespace
|
|
|
|
|
|
TEST_F(SectionPairSectionTest, get_by_index_out_of_bounds)
|
|
|
{
|
|
|
- shared_ptr<SectionPairSection> section = make_shared<SectionPairSection>("general");
|
|
|
+ auto section = make_shared<SectionPairSection>("general");
|
|
|
|
|
|
EXPECT_THROW(
|
|
|
{
|
|
@@ -135,7 +135,7 @@ namespace
|
|
|
|
|
|
TEST_F(SectionPairSectionTest, get_by_key)
|
|
|
{
|
|
|
- shared_ptr<SectionPairSection> section = make_shared<SectionPairSection>("general");
|
|
|
+ auto section = make_shared<SectionPairSection>("general");
|
|
|
section->add(make_shared<SectionPairRow>("color", SectionPairRowEnumType::SECTION_PAIR_ROW_SINGLE_VALUE));
|
|
|
|
|
|
ASSERT_TRUE(section->get("color") != nullptr);
|
|
@@ -143,7 +143,7 @@ namespace
|
|
|
|
|
|
TEST_F(SectionPairSectionTest, get_by_key_not_found)
|
|
|
{
|
|
|
- shared_ptr<SectionPairSection> section = make_shared<SectionPairSection>("general");
|
|
|
+ auto section = make_shared<SectionPairSection>("general");
|
|
|
section->add(make_shared<SectionPairRow>("color", SectionPairRowEnumType::SECTION_PAIR_ROW_SINGLE_VALUE));
|
|
|
|
|
|
ASSERT_TRUE(section->get("hobbies") == nullptr);
|
|
@@ -151,7 +151,7 @@ namespace
|
|
|
|
|
|
TEST_F(SectionPairSectionTest, getAmount)
|
|
|
{
|
|
|
- shared_ptr<SectionPairSection> section = make_shared<SectionPairSection>("general");
|
|
|
+ auto section = make_shared<SectionPairSection>("general");
|
|
|
ASSERT_EQ(0, section->getRowAmount());
|
|
|
}
|
|
|
|
|
@@ -162,19 +162,19 @@ namespace
|
|
|
|
|
|
TEST_F(SectionPairSectionTest, getList)
|
|
|
{
|
|
|
- shared_ptr<SectionPairSection> section = make_shared<SectionPairSection>("general");
|
|
|
+ auto section = make_shared<SectionPairSection>("general");
|
|
|
ASSERT_TRUE(section->getList().empty());
|
|
|
}
|
|
|
|
|
|
TEST_F(SectionPairSectionTest, getSectionId)
|
|
|
{
|
|
|
- shared_ptr<SectionPairSection> section = make_shared<SectionPairSection>("general");
|
|
|
+ auto section = make_shared<SectionPairSection>("general");
|
|
|
ASSERT_STREQ("general", section->getSectionId().c_str());
|
|
|
}
|
|
|
|
|
|
TEST_F(SectionPairSectionTest, hasRow)
|
|
|
{
|
|
|
- shared_ptr<SectionPairSection> section = make_shared<SectionPairSection>("general");
|
|
|
+ auto section = make_shared<SectionPairSection>("general");
|
|
|
section->add(make_shared<SectionPairRow>("color", SectionPairRowEnumType::SECTION_PAIR_ROW_SINGLE_VALUE));
|
|
|
|
|
|
ASSERT_TRUE(section->hasRow("color"));
|
|
@@ -182,7 +182,7 @@ namespace
|
|
|
|
|
|
TEST_F(SectionPairSectionTest, hasRow_not_found)
|
|
|
{
|
|
|
- shared_ptr<SectionPairSection> section = make_shared<SectionPairSection>("general");
|
|
|
+ auto section = make_shared<SectionPairSection>("general");
|
|
|
section->add(make_shared<SectionPairRow>("color", SectionPairRowEnumType::SECTION_PAIR_ROW_SINGLE_VALUE));
|
|
|
|
|
|
ASSERT_FALSE(section->hasRow("hobbies"));
|
|
@@ -199,7 +199,7 @@ namespace
|
|
|
|
|
|
TEST_F(SectionPairSectionTest, setSectionId)
|
|
|
{
|
|
|
- shared_ptr<SectionPairSection> section = make_shared<SectionPairSection>("general");
|
|
|
+ auto section = make_shared<SectionPairSection>("general");
|
|
|
|
|
|
section->setSectionId("personal");
|
|
|
ASSERT_STREQ("personal", section->getSectionId().c_str());
|
|
@@ -207,7 +207,7 @@ namespace
|
|
|
|
|
|
TEST_F(SectionPairSectionTest, setSectionId_empty_id)
|
|
|
{
|
|
|
- shared_ptr<SectionPairSection> section = make_shared<SectionPairSection>("general");
|
|
|
+ auto section = make_shared<SectionPairSection>("general");
|
|
|
|
|
|
EXPECT_THROW(
|
|
|
{
|
|
@@ -225,7 +225,7 @@ namespace
|
|
|
|
|
|
TEST_F(SectionPairSectionTest, setSectionId_invalid_id)
|
|
|
{
|
|
|
- shared_ptr<SectionPairSection> section = make_shared<SectionPairSection>("general");
|
|
|
+ auto section = make_shared<SectionPairSection>("general");
|
|
|
|
|
|
EXPECT_THROW(
|
|
|
{
|
|
@@ -243,7 +243,7 @@ namespace
|
|
|
|
|
|
TEST_F(SectionPairSectionTest, unmarshal)
|
|
|
{
|
|
|
- shared_ptr<SectionPairSection> section = make_shared<SectionPairSection>("tmp-id");
|
|
|
+ auto section = make_shared<SectionPairSection>("tmp-id");
|
|
|
section->unmarshal(SectionPairSectionProvider::createSerializedSectionWithTomExample(NewLine::get()));
|
|
|
|
|
|
ASSERT_STREQ("general", section->getSectionId().c_str());
|