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

[TOPIC-GPIO] tests: gpio_api_1pin: fix port related testcases #19782

Merged
merged 1 commit into from
Oct 16, 2019

Conversation

mnkp
Copy link
Member

@mnkp mnkp commented Oct 11, 2019

Keep promise of testing 1 pin only, don't attempt to test other pins when verifying gpio_port_* API functions.

Fixes: #19692

@mnkp mnkp added area: GPIO area: Tests Issues related to a particular existing or missing test labels Oct 11, 2019
@mnkp mnkp requested a review from pabigot as a code owner October 11, 2019 21:49
@zephyrbot
Copy link
Collaborator

zephyrbot commented Oct 11, 2019

All checks passed.

checkpatch (informational only, not a failure)

-:109: WARNING:LONG_LINE: line over 80 characters
#109: FILE: tests/drivers/gpio/gpio_api_1pin/src/test_port.c:182:
+		port_set_masked_raw_and_verify(port, BIT(TEST_PIN), test_vector[i], i);

-:135: WARNING:LONG_LINE: line over 80 characters
#135: FILE: tests/drivers/gpio/gpio_api_1pin/src/test_port.c:222:
+		port_set_masked_and_verify(port, BIT(TEST_PIN), test_vector[i], i);

-:163: WARNING:LONG_LINE: line over 80 characters
#163: FILE: tests/drivers/gpio/gpio_api_1pin/src/test_port.c:265:
+		port_set_masked_and_verify(port, BIT(TEST_PIN), test_vector[i], i);

-:177: WARNING:LONG_LINE: line over 80 characters
#177: FILE: tests/drivers/gpio/gpio_api_1pin/src/test_port.c:272:
+		port_set_masked_raw_and_verify(port, BIT(TEST_PIN), test_vector[i], i);

-:210: WARNING:LONG_LINE: line over 80 characters
#210: FILE: tests/drivers/gpio/gpio_api_1pin/src/test_port.c:316:
+		port_set_masked_and_verify(port, BIT(TEST_PIN), test_vector[i], i);

-:212: WARNING:LONG_LINE: line over 80 characters
#212: FILE: tests/drivers/gpio/gpio_api_1pin/src/test_port.c:318:
+		port_get_raw_and_verify(port, BIT(TEST_PIN), ~test_vector[i], i);

-:226: WARNING:LONG_LINE: line over 80 characters
#226: FILE: tests/drivers/gpio/gpio_api_1pin/src/test_port.c:323:
+		port_set_masked_raw_and_verify(port, BIT(TEST_PIN), test_vector[i], i);

- total: 0 errors, 7 warnings, 330 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Your patch has style problems, please review.

NOTE: Ignored message types: AVOID_EXTERNS BRACES CONFIG_EXPERIMENTAL CONST_STRUCT DATE_TIME FILE_PATH_CHANGES MINMAX NETWORKING_BLOCK_COMMENT_STYLE PRINTK_WITHOUT_KERN_LEVEL SPLIT_STRING VOLATILE

NOTE: If any of the errors are false positives, please report
      them to the maintainers.

Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages.

Copy link
Collaborator

@pabigot pabigot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the known problems on sx1509b though it specifies non-existent pins on that platform which produces a diagnostic.

All the 1 << pos expressions should be replaced by BIT(pos), since if TEST_PIN is ever 31 the code is subject to undefined behavior on a 32-bit system, but that's not a port-related problem.

Keep promise of testing 1 pin only, don't attempt to test other pins
when verifying gpio_port_* API functions. Use BIT macro to create a bit
mask.

Fixes: zephyrproject-rtos#19692

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
@mnkp
Copy link
Member Author

mnkp commented Oct 12, 2019

All the 1 << pos expressions should be replaced by BIT(pos)

Good point. Fixed.

@pabigot pabigot self-requested a review October 12, 2019 22:17
@pabigot pabigot changed the title tests: gpio_api_1pin: fix port related testcases [TOPIC-GPIO] tests: gpio_api_1pin: fix port related testcases Oct 15, 2019
@MaureenHelm MaureenHelm merged commit f203d89 into zephyrproject-rtos:topic-gpio Oct 16, 2019
@mnkp mnkp deleted the test_gpio_api_1pin branch October 16, 2019 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: GPIO area: Tests Issues related to a particular existing or missing test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants