Skip to content

Commit

Permalink
Add rule and metadata unit test and fix copyright notice
Browse files Browse the repository at this point in the history
Signed-off-by: romanodanilo <[email protected]>
  • Loading branch information
romanodanilo committed Jun 6, 2024
1 parent a934870 commit 0e7db35
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 10 deletions.
4 changes: 2 additions & 2 deletions include/common/result_format/c_metadata.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Copyright 2023 CARIAD SE.
*
* Copyright 2024, ASAM e.V.
*
* This Source Code Form is subject to the terms of the Mozilla
* Public License, v. 2.0. If a copy of the MPL was not distributed
* with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
Expand Down
5 changes: 3 additions & 2 deletions include/common/result_format/c_rule.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/**
* Copyright 2023 CARIAD SE.
*
* Copyright 2024, ASAM e.V.
*
* This Source Code Form is subject to the terms of the Mozilla
* Public License, v. 2.0. If a copy of the MPL was not distributed
* with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/


#ifndef cRule_h__
#define cRule_h__

Expand Down
6 changes: 3 additions & 3 deletions src/common/src/result_format/c_metadata.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright 2023 CARIAD SE.
*
/**
* Copyright 2024, ASAM e.V.
*
* This Source Code Form is subject to the terms of the Mozilla
* Public License, v. 2.0. If a copy of the MPL was not distributed
* with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
Expand Down
6 changes: 3 additions & 3 deletions src/common/src/result_format/c_rule.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright 2023 CARIAD SE.
*
/**
* Copyright 2024, ASAM e.V.
*
* This Source Code Form is subject to the terms of the Mozilla
* Public License, v. 2.0. If a copy of the MPL was not distributed
* with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,24 @@ TEST_F(cTesterExampleCheckerBundle, CmdTooMuchArguments)
TestResult nRes = ExecuteCommand(strResultMessage, MODULE_NAME, "a b");
ASSERT_TRUE(nRes == TestResult::ERR_FAILED);
}

TEST_F(cTesterExampleCheckerBundle, CmdConfigContainsAddressedRuleAndMetadata)
{
std::string strResultMessage;

std::string strConfigFilePath = strTestFilesDir + "/" + std::string(MODULE_NAME) + "_config.xml";
std::string strResultFilePath = strWorkingDir + "/" + std::string(MODULE_NAME) + ".xqar";

TestResult nRes = ExecuteCommand(strResultMessage, MODULE_NAME, strConfigFilePath);
ASSERT_TRUE_EXT(nRes == TestResult::ERR_NOERROR, strResultMessage.c_str());
nRes |= CheckFileExists(strResultMessage, strResultFilePath, false);
ASSERT_TRUE_EXT(nRes == TestResult::ERR_NOERROR, strResultMessage.c_str());

nRes |= XmlContainsNode(strResultFilePath, "AddressedRule");
ASSERT_TRUE_EXT(nRes == TestResult::ERR_NOERROR, strResultMessage.c_str());

nRes |= XmlContainsNode(strResultFilePath, "Metadata");
ASSERT_TRUE_EXT(nRes == TestResult::ERR_NOERROR, strResultMessage.c_str());

fs::remove(strResultFilePath.c_str());
}

0 comments on commit 0e7db35

Please sign in to comment.