-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix compile warnings in common io and wifi tests #1995
Conversation
@@ -126,6 +126,9 @@ TEST_TEAR_DOWN( TEST_IOT_I2C ) | |||
void prvI2CCallback( IotI2COperationStatus_t xOpStatus, | |||
void * pvParam ) | |||
{ | |||
/* Silence the compiler. */ |
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.
Can you mention something like Disable unused parameter warning.
instead to clearly mention the warning being silenced
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.
Sure.
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.
Yes please "Silence the compiler" is not a good comment
@@ -357,7 +360,7 @@ TEST( TEST_IOT_I2C, AFQP_IotI2CSetGetConfigurationFail ) | |||
TEST_ASSERT_EQUAL( IOT_I2C_INVALID_VALUE, lRetVal ); | |||
|
|||
/* i2c ioctl with unsupported request */ | |||
lRetVal = iot_i2c_ioctl( xI2CHandle, testIotI2C_INVALID_IOCTL_INDEX, &xI2CConfig ); | |||
lRetVal = iot_i2c_ioctl( xI2CHandle, ( IotI2CIoctlRequest_t ) testIotI2C_INVALID_IOCTL_INDEX, &xI2CConfig ); |
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.
I notice that testIotI2C_INVALID_IOCTL_INDEX
is defined as UINT32_MAX
. Instead of explicitly downcasting it, should it be defined to be a lower value as UINT8_MAX
instead or any other unsupported value?
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.
I think this is a better idea. Will do.
@@ -484,7 +487,7 @@ TEST( TEST_IOT_I2C, AFQP_IotI2CReadAsyncAssisted ) | |||
TEST_ASSERT_EQUAL( IOT_I2C_SUCCESS, lRetVal ); | |||
|
|||
/* Read from i2c device */ | |||
lRetVal = iot_i2c_read_async( xI2CHandle, &ucReadBuf, sizeof( ucReadBuf ) ); | |||
lRetVal = iot_i2c_read_async( xI2CHandle, ucReadBuf, sizeof( ucReadBuf ) ); |
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.
Were these tests passing earlier?
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.
They weren't running. See the test case name is suffixed with "assisted". We haven't support assisted tests yet.
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.
Is it possible to locally verify that these tests are passing?
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.
Yes, but it takes extra work. Since assisted test is not supported for now, let's worry about this 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.
Since ucReadBuf is an array this would work either way. I agree with Qiutong, this should not hold us up here. The warning this removes is simply that the adress off operator is redundant.
Co-authored-by: qiutongs <songqt01@gmail,com>
Description
Fix compile warnings in common io and wifi tests
Checklist:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.