Skip to content

Commit

Permalink
Merge pull request #14697 from jamesbeyond/fix_inte_test
Browse files Browse the repository at this point in the history
TESTS: rename variable interface to fix broken tests
  • Loading branch information
0xc0170 authored May 31, 2021
2 parents a2d62f9 + 8301854 commit 0e72912
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
18 changes: 9 additions & 9 deletions TESTS/integration/net-single/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ void led_thread()
#endif

#define MAX_RETRIES 3
NetworkInterface *interface = NULL;
NetworkInterface *netif = NULL;
static control_t setup_network(const size_t call_count)
{
interface = NetworkInterface::get_default_instance();
TEST_ASSERT_NOT_NULL_MESSAGE(interface, "failed to initialize network");
netif = NetworkInterface::get_default_instance();
TEST_ASSERT_NOT_NULL_MESSAGE(netif, "failed to initialize network");

nsapi_error_t err = -1;
for (int tries = 0; tries < MAX_RETRIES; tries++) {
err = interface->connect();
err = netif->connect();
if (err == NSAPI_ERROR_OK) {
break;
} else {
Expand All @@ -78,34 +78,34 @@ static control_t setup_network(const size_t call_count)

static control_t download_128(const size_t call_count)
{
download_test(interface, story, sizeof(story), 128);
download_test(netif, story, sizeof(story), 128);

return CaseNext;
}
static control_t download_256(const size_t call_count)
{
download_test(interface, story, sizeof(story), 256);
download_test(netif, story, sizeof(story), 256);

return CaseNext;
}

static control_t download_1k(const size_t call_count)
{
download_test(interface, story, sizeof(story), 1024);
download_test(netif, story, sizeof(story), 1024);

return CaseNext;
}

static control_t download_2k(const size_t call_count)
{
download_test(interface, story, sizeof(story), 2 * 1024);
download_test(netif, story, sizeof(story), 2 * 1024);

return CaseNext;
}

static control_t download_4k(const size_t call_count)
{
download_test(interface, story, sizeof(story), 4 * 1024);
download_test(netif, story, sizeof(story), 4 * 1024);

return CaseNext;
}
Expand Down
10 changes: 5 additions & 5 deletions TESTS/integration/stress-net-fs/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ void led_thread()
#endif

#define MAX_RETRIES 3
NetworkInterface *interface = NULL;
NetworkInterface *netif = NULL;

static control_t setup_network(const size_t call_count)
{
interface = NetworkInterface::get_default_instance();
TEST_ASSERT_NOT_NULL_MESSAGE(interface, "failed to initialize network");
netif = NetworkInterface::get_default_instance();
TEST_ASSERT_NOT_NULL_MESSAGE(netif, "failed to initialize network");

nsapi_error_t err = -1;
for (int tries = 0; tries < MAX_RETRIES; tries++) {
err = interface->connect();
err = netif->connect();
if (err == NSAPI_ERROR_OK) {
break;
} else {
Expand Down Expand Up @@ -106,7 +106,7 @@ static uint32_t thread_counter = 0;
void download_fn()
{
uint32_t thread_id = core_util_atomic_incr_u32(&thread_counter, 1);
download_test(interface, story, sizeof(story), 256, thread_id);
download_test(netif, story, sizeof(story), 256, thread_id);
}
void file_fn(size_t buffer)
{
Expand Down

0 comments on commit 0e72912

Please sign in to comment.