-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: UT for core_log_set_function() #6047
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6047 +/- ##
=======================================
Coverage 70.07% 70.07%
=======================================
Files 133 133
Lines 19563 19563
Branches 3261 3261
=======================================
+ Hits 13708 13709 +1
+ Misses 5855 5854 -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @grom72 and @osalyk)
src/test/core_log/core_log.c
line 206 at r1 (raw file):
/* Happy day scenario with custom logging function */ static int test_set_custom_function(const struct test_case *tc, int argc, char *argv[])
This function is basically a copy of the test_happy_day()
function. I recommend establishing test_happy_day_helper()
with appropriate if-else statements allowing testing both test_happy_day and test_set_custom_function.
Code quote:
test_set_custom_function
src/test/core_log/core_log.c
line 214 at r1 (raw file):
* disable MOCK as custom_log_function() may be called form * core_log_set_function() */
Suggestion:
/*
* Disable the validation as custom_log_function() may be called form
* core_log_set_function().
*/
src/test/core_log/core_log.c
line 215 at r1 (raw file):
* core_log_set_function() */ FUNC_MOCK_RCOUNTER_SET(custom_log_function, 0);
Suggestion:
#define NOT_VALIDATED_CALL 0
FUNC_MOCK_RCOUNTER_SET(custom_log_function, NOT_VALIDATED_CALL);
src/test/core_log/core_log_common.c
line 86 at r1 (raw file):
FUNC_MOCK_END /* custom logging function MOCK used only in test_set_custom_function test */
I don't like this comment. Not much value and even less maintainability.
b65f124
to
858aa9d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 of 4 files reviewed, 3 unresolved discussions (waiting on @janekmi and @osalyk)
src/test/core_log/core_log.c
line 214 at r1 (raw file):
* disable MOCK as custom_log_function() may be called form * core_log_set_function() */
Done.
src/test/core_log/core_log.c
line 215 at r1 (raw file):
* core_log_set_function() */ FUNC_MOCK_RCOUNTER_SET(custom_log_function, 0);
Done.
src/test/core_log/core_log_common.c
line 86 at r1 (raw file):
Previously, janekmi (Jan Michalski) wrote…
I don't like this comment. Not much value and even less maintainability.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @osalyk)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 4 files at r1, 3 of 3 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @grom72)
858aa9d
to
bd27225
Compare
Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@intel.com>
bd27225
to
9a96de0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 3 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @grom72)
This change is