-
Notifications
You must be signed in to change notification settings - Fork 561
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
Add kernel testcases #6177
Closed
NayanaNagaraj23
wants to merge
3
commits into
Samsung:master
from
NayanaNagaraj23:add_kernel_testcases
Closed
Add kernel testcases #6177
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ | |
* @Preconditions :NA | ||
* @Postconditions :NA | ||
*/ | ||
static void itc_libc_semaphore_getprotocol_n_no_sem_init(void) | ||
static void itc_libc_semaphore_getprotocol_no_sem_init_neg(void) | ||
{ | ||
sem_t sem; | ||
int protocol; | ||
|
@@ -62,6 +62,6 @@ static void itc_libc_semaphore_getprotocol_n_no_sem_init(void) | |
|
||
int itc_libc_semaphore_main(void) | ||
{ | ||
itc_libc_semaphore_getprotocol_n_no_sem_init(); | ||
itc_libc_semaphore_getprotocol_no_sem_init_neg(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as previous
This is what we use in the naming and automation tool parses. |
||
return 0; | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,7 +52,7 @@ extern struct timespec g_basetime; | |
* Postconditions :none | ||
* @return :void | ||
*/ | ||
static void tc_clock_clock_getres(void) | ||
static void tc_clock_clock_getres_pos(void) | ||
{ | ||
int ret_chk; | ||
struct timespec st_res; | ||
|
@@ -66,6 +66,14 @@ static void tc_clock_clock_getres(void) | |
TC_ASSERT_EQ("clock_getres", st_res.tv_sec, 0); | ||
TC_ASSERT_EQ("clock_getres", st_res.tv_nsec, NSEC_PER_TICK); | ||
|
||
TC_SUCCESS_RESULT(); | ||
} | ||
|
||
static void tc_clock_clock_getres_neg(void) | ||
{ | ||
int ret_chk; | ||
struct timespec st_res; | ||
|
||
ret_chk = clock_getres(33 , &st_res); | ||
TC_ASSERT_EQ("clock_getres", ret_chk, ERROR); | ||
|
||
|
@@ -81,15 +89,25 @@ static void tc_clock_clock_getres(void) | |
* Postconditions :none | ||
* @return :void | ||
*/ | ||
static void tc_clock_clock_set_get_time(void) | ||
|
||
|
||
static void tc_clock_clock_get_time_pos(void) | ||
{ | ||
int ret_chk; | ||
struct timespec stime; | ||
struct timespec gtime; | ||
|
||
ret_chk = clock_gettime(CLOCK_ERR, &stime); | ||
TC_ASSERT_EQ("clock_gettime", ret_chk, ERROR); | ||
TC_ASSERT_EQ("clock_gettime", errno, EINVAL); | ||
ret_chk = clock_gettime(CLOCK_REALTIME, &stime); | ||
TC_ASSERT_EQ("clock_gettime", ret_chk, OK); | ||
|
||
TC_SUCCESS_RESULT(); | ||
} | ||
|
||
static void tc_clock_clock_set_time_pos(void) | ||
{ | ||
int ret_chk; | ||
struct timespec stime; | ||
struct timespec gtime; | ||
|
||
ret_chk = clock_gettime(CLOCK_REALTIME, &stime); | ||
TC_ASSERT_EQ("clock_gettime", ret_chk, OK); | ||
|
@@ -111,12 +129,30 @@ static void tc_clock_clock_set_get_time(void) | |
|
||
stime.tv_sec -= l_day; /* Setting original time to system */ | ||
|
||
ret_chk = clock_settime(CLOCK_REALTIME, &stime); | ||
TC_ASSERT_EQ("clock_setime", ret_chk, OK); | ||
|
||
TC_SUCCESS_RESULT(); | ||
} | ||
|
||
static void tc_clock_clock_set_time_neg(void) | ||
{ | ||
int ret_chk; | ||
struct timespec stime; | ||
|
||
ret_chk = clock_settime(CLOCK_ERR, &stime); | ||
TC_ASSERT_EQ("clock_settime", ret_chk, ERROR); | ||
TC_ASSERT_EQ("clock_settime", errno, EINVAL); | ||
|
||
ret_chk = clock_settime(CLOCK_REALTIME, &stime); | ||
TC_ASSERT_EQ("clock_setime", ret_chk, OK); | ||
TC_SUCCESS_RESULT(); | ||
} | ||
|
||
static void tc_clock_clock_get_time_invalid_clock_neg(void) | ||
{ | ||
int ret_chk; | ||
struct timespec stime; | ||
|
||
ret_chk = clock_gettime(CLOCK_ERR, &stime); | ||
TC_ASSERT_EQ("clock_gettime", errno, EINVAL); | ||
|
||
TC_SUCCESS_RESULT(); | ||
} | ||
|
@@ -130,7 +166,7 @@ static void tc_clock_clock_set_get_time(void) | |
* Postconditions :none | ||
* @return :void | ||
*/ | ||
static void tc_clock_clock_gettimeofday(void) | ||
static void tc_clock_clock_gettimeofday_pos(void) | ||
{ | ||
int ret_chk; | ||
struct timeval tv1; | ||
|
@@ -148,6 +184,15 @@ static void tc_clock_clock_gettimeofday(void) | |
if (tv2.tv_sec == tv1.tv_sec + SEC_2) { | ||
TC_ASSERT_GEQ("gettimeofday", tv2.tv_usec, tv1.tv_usec); | ||
} | ||
|
||
TC_SUCCESS_RESULT(); | ||
} | ||
|
||
|
||
static void tc_clock_clock_gettimeofday_neg(void) | ||
{ | ||
int ret_chk; | ||
|
||
#ifdef CONFIG_DEBUG | ||
ret_chk = gettimeofday(NULL, NULL); | ||
TC_ASSERT_EQ("gettimeofday", ret_chk, ERROR); | ||
|
@@ -165,7 +210,7 @@ static void tc_clock_clock_gettimeofday(void) | |
* Postconditions :none | ||
* @return :void | ||
*/ | ||
static void tc_clock_clock_abstime2ticks(void) | ||
static void tc_clock_clock_abstime2ticks_pos(void) | ||
{ | ||
int fd; | ||
int ret; | ||
|
@@ -184,10 +229,14 @@ static void tc_clock_clock_abstime2ticks(void) | |
|
||
int clock_main(void) | ||
{ | ||
tc_clock_clock_gettimeofday(); | ||
tc_clock_clock_set_get_time(); | ||
tc_clock_clock_getres(); | ||
tc_clock_clock_abstime2ticks(); | ||
|
||
tc_clock_clock_gettimeofday_pos(); | ||
tc_clock_clock_gettimeofday_neg(); | ||
tc_clock_clock_get_time_invalid_clock_neg(); | ||
tc_clock_clock_get_time_pos(); | ||
tc_clock_clock_set_time_pos(); | ||
tc_clock_clock_set_time_neg(); | ||
tc_clock_clock_getres_pos(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please check indentation |
||
tc_clock_clock_getres_neg(); | ||
tc_clock_clock_abstime2ticks_pos(); | ||
return 0; | ||
} |
Oops, something went wrong.
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.
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.
We check
_p
and_n
internally in the automation tool. Do you have any reason to change?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.
In some functions the _p and _n are at the middle and others are at the end of the function name, this is not identified properly in the TCM tool. So, I have changed the names as _pos and _neg at the end of the function for better identification and uniformity.