Skip to content
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

bin-sem-flush-test reporting work incorrectly #347

Closed
dmknutsen opened this issue Dec 31, 2019 · 0 comments · Fixed by #388 or #408
Closed

bin-sem-flush-test reporting work incorrectly #347

dmknutsen opened this issue Dec 31, 2019 · 0 comments · Fixed by #388 or #408
Assignees
Milestone

Comments

@dmknutsen
Copy link
Contributor

Describe the bug
There is an issue in bin-sem-flush-test.c. Within the BinSemFlushCheck function - lines 229, 230, 242, and 243 contain the wrong variable name (task_1_work as opposed to task_2_work & task_3_work).

To Reproduce
Run Test.

Expected behavior
Expect "Task 2/3 work = %u" to correspond with task_2/3_work variables.

Code snips
void BinSemFlushCheck(void)
{
int32 status;

/* At first, No task should have done any work yet (all blocked) */
UtAssert_True(task_1_work == 0, "Task 1 work = %u",(unsigned int)task_1_work);
UtAssert_True(task_2_work == 0, "Task 2 work = %u",(unsigned int)task_1_work);
UtAssert_True(task_3_work == 0, "Task 3 work = %u",(unsigned int)task_1_work);

status = OS_BinSemFlush(bin_sem_id);
UtAssert_True(status == OS_SUCCESS, "BinSem1 flush Rc=%d", (int)status);

/* After more delay the work done should be nonzero on all tasks */
/* NOTE - There is a slight race condition here as the task could be blocked
 * by something else other than the bin sem.
 */
OS_TaskDelay(4000);

UtAssert_True(task_1_work != 0, "Task 1 work = %u",(unsigned int)task_1_work);
UtAssert_True(task_2_work != 0, "Task 2 work = %u",(unsigned int)task_1_work);
UtAssert_True(task_3_work != 0, "Task 3 work = %u",(unsigned int)task_1_work);

UtAssert_True(task_1_failures == 0, "Task 1 failures = %u",(unsigned int)task_1_failures);
UtAssert_True(task_2_failures == 0, "Task 2 failures = %u",(unsigned int)task_2_failures);
UtAssert_True(task_3_failures == 0, "Task 3 failures = %u",(unsigned int)task_3_failures);

}

System observed on:
NA

Additional context
NA

Reporter Info
Dan Knutsen
NASA Goddard Space Flight Center

@skliper skliper changed the title bin-sem-flush-test.c bin-sem-flush-test reporting work incorrectly Jan 2, 2020
@jphickey jphickey transferred this issue from nasa/cFE Jan 9, 2020
@skliper skliper added this to the 5.1.0 milestone Jan 15, 2020
dmknutsen added a commit to dmknutsen/osal that referenced this issue Mar 25, 2020
dmknutsen added a commit to dmknutsen/osal that referenced this issue Mar 27, 2020
astrogeco added a commit that referenced this issue Apr 6, 2020
Fix #347, replaces task_1_work with correct variable names
@astrogeco astrogeco linked a pull request Apr 9, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants