-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
tests: drivers: uart: config api has extra dependency in test 2 #23459
Comments
@xuhao8210 We can continue the discussion from #22849 here and resolve it with a PR. Thanks! |
@jenmwms OK. got it .Thanks Jen. if any comments for my suggestion, please let me know. Thanks again. |
@xuhao8210 Thanks for suggesting changes. I agree with the approach, however I have a comment about renaming the 1st case to
I'll submit a PR soon |
Why do we need to rename the first case? We have 2 test cases:
|
<For the 1st case , we may only force on testing for setting configuration, so we may use the 1st case from your last version: 6c1156d to name test case: “test_uart_config_set()”.> So we do not (or cannot) verify the 1st test works ( |
Tests were added for the UART configure API in zephyrproject-rtos#22849. The existing test implementation works, but suggested to reduce dependency between test cases. This commit allows each test to run independently of each other by removing the function call of uart_config_get() in the uart_configure() test case, and uses the uart_config_get() test case to confirm the value set and gotten/read. Fixes zephyrproject-rtos#23459 Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
@jenmwms For the test case name, you are right, and I forgot the name style, originally I would like to make the test case to better understand based on test case name. So please keep the test case name. Sorry for making you confuse. Thanks. |
@jenmwms For the 1st test case issue, if the 1st case is also include the checking point that it checks whether output value is same with the input value, the 1st case will same with 2nd case. |
Tests were added for the UART configure API in #22849. The existing test implementation works, but suggested to reduce dependency between test cases. This commit allows each test to run independently of each other by removing the function call of uart_config_get() in the uart_configure() test case, and uses the uart_config_get() test case to confirm the value set and gotten/read. Fixes #23459 Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
Tests were added for the UART configure API in zephyrproject-rtos#22849. The existing test implementation works, but suggested to reduce dependency between test cases. This commit allows each test to run independently of each other by removing the function call of uart_config_get() in the uart_configure() test case, and uses the uart_config_get() test case to confirm the value set and gotten/read. Fixes zephyrproject-rtos#23459 Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
Is your enhancement proposal related to a problem? Please describe.
Tests were added for the UART configure API in - tests: drivers: uart: config api #22849. The existing test implementation works, but the 2nd case: ”test_config_get()” will fail if we don’t run the 1st case :” test_uart_configure()” because the 2nd case have not set the value for the variable :”uart_cfg_check”.
Describe the solution you'd like
Suggest to make each case's independence as possible.
Describe alternatives you've considered
From comment in original discovery #22849 -
Could you please help also review the code below ?
================last part code ==================
/* Verify configure() - set device configuration using data in cfg /
int ret = uart_configure(uart_dev, &uart_cfg);
zassert_ture(ret == 0, "set config error");
/ Confirm the values provided are the values set*/
ret = uart_config_get(uart_dev, &uart_cfg_check);
zassert_ture(ret == 0, "get config error");
if (memcmp(&uart_cfg, &uart_cfg_check, sizeof(uart_cfg)) != 0) {
return TC_FAIL;
} else {
return TC_PASS;
}
==============End last part code ==================
Additional context
tests: drivers: uart: config api #22849, included checking that the values stored and retrieved are as expected after calling the functions under test. The functions under test offer return values of success or error, which does not easily lend itself to check the stored/retrieved value in addition to the return value.
The text was updated successfully, but these errors were encountered: