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

Stray remaining use of 'goto' in test code #1356

Closed
thnkslprpt opened this issue Jan 25, 2023 · 0 comments · Fixed by #1357
Closed

Stray remaining use of 'goto' in test code #1356

thnkslprpt opened this issue Jan 25, 2023 · 0 comments · Fixed by #1357

Comments

@thnkslprpt
Copy link
Contributor

Describe the bug
Noticed a single stray use of goto remaining in the test code.

Expected behavior
Use of goto is advised against by most coding guidelines.
Preference is to use other method of flow control.

Code snips

int32 UT_os_setup_fs()
{
int32 res;
res = OS_mkfs(g_fsAddrPtr, g_devName, "RAM3", OSAL_SIZE_C(512), OSAL_BLOCKCOUNT_C(64));
if (res != OS_SUCCESS)
{
UtPrintf("OS_mkfs() returns %d\n", (int)res);
goto UT_os_setup_fs_exit_tag;
}
res = OS_mount(g_devName, g_mntName);
if (res != OS_SUCCESS)
{
UtPrintf("OS_mount() returns %d\n", (int)res);
OS_rmfs(g_devName);
goto UT_os_setup_fs_exit_tag;
}
UT_os_setup_fs_exit_tag:
return res;
}

Reporter Info
Avi Weiss @thnkslprpt

thnkslprpt added a commit to thnkslprpt/osal that referenced this issue Jan 25, 2023
dzbaker added a commit that referenced this issue Feb 23, 2024
…ng-goto

Fix #1356, Remove stray remaining 'goto' in OSAL test code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants