Update mtlsUtils.cpp#205
Open
Abhinavpv28 wants to merge 8 commits into
Open
Conversation
Contributor
Author
|
@copilot add gtest testcases for functions in rfc_common.cpp that are not covered |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes a minor formatting-only update in mtlsUtils.cpp by inserting an additional blank line after the file header comment, before the first #include.
Changes:
- Add a single blank line between the header comment block and the include section in
rfcMgr/mtlsUtils.cpp.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
run_ut.sh:30
- ENABLE_COV is now defaulted to true even when --enable-cov is not provided. Since coverage compiler/linker flags are only exported inside the --enable-cov branch, this will still trigger the lcov step later without producing gcno/gcda files, which can fail the script (and makes the flag redundant). Consider defaulting ENABLE_COV to false and only enabling/reporting coverage when the option is explicitly set (or export the coverage flags whenever ENABLE_COV=true and guard lcov with tool/file existence checks).
ENABLE_COV=true
if [ "x$1" = "x--enable-cov" ]; then
echo "Enabling coverage options"
export CXXFLAGS="-g -O0 -fprofile-arcs -ftest-coverage"
export CFLAGS="-g -O0 -fprofile-arcs -ftest-coverage"
export LDFLAGS="-lgcov --coverage"
ENABLE_COV=true
fi
Comment on lines
+917
to
+921
| TEST(rfcMgrTest, waitForRfcCompletion_doesNotCrash) { | ||
| // This test just ensures the function runs without crashing or hanging | ||
| // It is a smoke test, as actual sysevent and file presence are not guaranteed in test env | ||
| ASSERT_NO_FATAL_FAILURE(waitForRfcCompletion()); | ||
| } |
Comment on lines
+926
to
+927
| // Accept either empty or any string (smoke test) | ||
| SUCCEED(); |
| #################################################################################### | ||
|
|
||
| ENABLE_COV=false | ||
| ENABLE_COV=true |
Comment on lines
+199
to
+200
| // This test expects the .RFC_LegacyRFCEnabled.ini file does not exist | ||
| // Should return false |
Comment on lines
+917
to
+921
| TEST(rfcMgrTest, waitForRfcCompletion_doesNotCrash) { | ||
| // This test just ensures the function runs without crashing or hanging | ||
| // It is a smoke test, as actual sysevent and file presence are not guaranteed in test env | ||
| ASSERT_NO_FATAL_FAILURE(waitForRfcCompletion()); | ||
| } |
Comment on lines
+924
to
+927
| // This test expects no real DCMSettings.conf, so should return empty string | ||
| std::string cron = getCronFromDCMSettings(); | ||
| // Accept either empty or any string (smoke test) | ||
| SUCCEED(); |
Comment on lines
4
to
6
| pull_request: | ||
| branches: [ main ] | ||
| branches: [ develop ] | ||
|
|
Code Coverage Summary |
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (1)
run_ut.sh:30
ENABLE_COVis now initialized totrue, which makes the script always try to generate an lcov report (lines 80+), even when the caller did not request coverage and may not have lcov/coverage artifacts available. Consider defaulting this back tofalseand only enabling coverage generation when--enable-covis passed (or add a separate flag for "generate report" vs "compile with coverage").
ENABLE_COV=true
if [ "x$1" = "x--enable-cov" ]; then
echo "Enabling coverage options"
export CXXFLAGS="-g -O0 -fprofile-arcs -ftest-coverage"
export CFLAGS="-g -O0 -fprofile-arcs -ftest-coverage"
export LDFLAGS="-lgcov --coverage"
ENABLE_COV=true
fi
Comment on lines
+23
to
25
|
|
||
| #include "mtlsUtils.h" | ||
| #include "rfc_common.h" |
Comment on lines
+198
to
+202
| TEST(utilsTest, legacyRfcEnabled_returnsFalseIfFileMissing) { | ||
| // This test expects the .RFC_LegacyRFCEnabled.ini file does not exist | ||
| // Should return false | ||
| EXPECT_FALSE(legacyRfcEnabled()); | ||
| } |
Comment on lines
+918
to
+920
| // This test just ensures the function runs without crashing or hanging | ||
| // It is a smoke test, as actual sysevent and file presence are not guaranteed in test env | ||
| ASSERT_NO_FATAL_FAILURE(waitForRfcCompletion()); |
Comment on lines
+923
to
+928
| TEST(rfcMgrTest, getCronFromDCMSettings_returnsStringOrEmpty) { | ||
| // This test expects no real DCMSettings.conf, so should return empty string | ||
| std::string cron = getCronFromDCMSettings(); | ||
| // Accept either empty or any string (smoke test) | ||
| SUCCEED(); | ||
| } |
Comment on lines
+1615
to
+1620
| TEST(rfcMgrTest, getErouterIPAddress_empty) { | ||
| rfc::RFCManager mgr; | ||
| // Should return empty string in test env | ||
| std::string ip = mgr.getErouterIPAddress(); | ||
| SUCCEED(); | ||
| } |
| #################################################################################### | ||
|
|
||
| ENABLE_COV=false | ||
| ENABLE_COV=true |
Comment on lines
+198
to
+202
| TEST(utilsTest, legacyRfcEnabled_returnsFalseIfFileMissing) { | ||
| // This test expects the .RFC_LegacyRFCEnabled.ini file does not exist | ||
| // Should return false | ||
| EXPECT_FALSE(legacyRfcEnabled()); | ||
| } |
Comment on lines
+917
to
+921
| TEST(rfcMgrTest, waitForRfcCompletion_doesNotCrash) { | ||
| // This test just ensures the function runs without crashing or hanging | ||
| // It is a smoke test, as actual sysevent and file presence are not guaranteed in test env | ||
| ASSERT_NO_FATAL_FAILURE(waitForRfcCompletion()); | ||
| } |
Comment on lines
+923
to
+928
| TEST(rfcMgrTest, getCronFromDCMSettings_returnsStringOrEmpty) { | ||
| // This test expects no real DCMSettings.conf, so should return empty string | ||
| std::string cron = getCronFromDCMSettings(); | ||
| // Accept either empty or any string (smoke test) | ||
| SUCCEED(); | ||
| } |
Comment on lines
+1598
to
+1602
| TEST(rfcMgrTest, IsIarmBusConnected_smoke) { | ||
| rfc::RFCManager mgr; | ||
| // Should not crash, always returns true if !USE_IARMBUS | ||
| EXPECT_TRUE(mgr.IsIarmBusConnected()); | ||
| } |
Comment on lines
+1615
to
+1620
| TEST(rfcMgrTest, getErouterIPAddress_empty) { | ||
| rfc::RFCManager mgr; | ||
| // Should return empty string in test env | ||
| std::string ip = mgr.getErouterIPAddress(); | ||
| SUCCEED(); | ||
| } |
Comment on lines
+23
to
24
|
|
||
| #include "mtlsUtils.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.