Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Fix compile warnings in common io and wifi tests #1995

Merged
merged 2 commits into from
May 12, 2020
Merged

Conversation

qiutongs
Copy link
Contributor

@qiutongs qiutongs commented May 11, 2020

Description

Fix compile warnings in common io and wifi tests

Checklist:

  • I have tested my changes. No regression in existing tests.
  • My code is Linted.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@@ -126,6 +126,9 @@ TEST_TEAR_DOWN( TEST_IOT_I2C )
void prvI2CCallback( IotI2COperationStatus_t xOpStatus,
void * pvParam )
{
/* Silence the compiler. */
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure.

Copy link
Member

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 );
Copy link
Contributor

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?

Copy link
Contributor Author

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 ) );
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Member

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.

@qiutongs qiutongs requested a review from aggarw13 May 11, 2020 22:48
@qiutongs qiutongs merged commit 634318e into master May 12, 2020
@qiutongs qiutongs deleted the qiutongs/compile-fx branch May 12, 2020 19:28
alfred2g pushed a commit to alfred2g/amazon-freertos that referenced this pull request May 21, 2020
Co-authored-by: qiutongs <songqt01@gmail,com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants