Skip to content

Commit 148cf85

Browse files
author
Veijo Pesonen
committed
tests-integration-*: fixes traces
1 parent 4fa9cca commit 148cf85

File tree

4 files changed

+11
-14
lines changed

4 files changed

+11
-14
lines changed

TESTS/integration/COMMON/download_test.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ size_t download_test(NetworkInterface *interface, const unsigned char *data, siz
101101
break;
102102
}
103103
ThisThread::sleep_for(1000);
104-
tr_info("[NET-%d] Connection failed. Retry %d of %d", thread_id, tries, MAX_RETRIES);
104+
tr_info("[NET-%" PRIu32 "] Connection failed. Retry %d of %d", thread_id, tries, MAX_RETRIES);
105105
}
106106
TEST_ASSERT_EQUAL_INT_MESSAGE(0, result, "failed to connect");
107107

@@ -119,7 +119,7 @@ size_t download_test(NetworkInterface *interface, const unsigned char *data, siz
119119
} else {
120120
TEST_ASSERT_MESSAGE(0, "wrong thread id");
121121
}
122-
tr_info("[NET-%d] Registered socket callback function", thread_id);
122+
tr_info("[NET-%" PRIu32 "] Registered socket callback function", thread_id);
123123
event_fired[thread_id] = false;
124124

125125
/* setup request */
@@ -128,7 +128,7 @@ size_t download_test(NetworkInterface *interface, const unsigned char *data, siz
128128
/* construct request */
129129
size_t req_len = snprintf(request, REQ_BUF_SIZE - 1, req_template, dl_path, dl_host);
130130
request[req_len] = 0;
131-
tr_info("[NET-%d] Request header (%u): %s", thread_id, req_len, request);
131+
tr_info("[NET-%" PRIu32 "] Request header (%u): %s", thread_id, req_len, request);
132132

133133
/* send request to server */
134134
result = tcpsocket.send(request, req_len);
@@ -138,7 +138,7 @@ size_t download_test(NetworkInterface *interface, const unsigned char *data, siz
138138
char *receive_buffer = &g_receive_buffer[thread_id * RECV_BUF_SIZE];
139139

140140
tcpsocket.set_blocking(false);
141-
tr_info("[NET-%d] Non-blocking socket mode set", thread_id);
141+
tr_info("[NET-%" PRIu32 "] Non-blocking socket mode set", thread_id);
142142

143143
size_t received_bytes = 0;
144144
int body_index = -1;
@@ -174,7 +174,7 @@ size_t download_test(NetworkInterface *interface, const unsigned char *data, siz
174174
if (body_index < 0) {
175175
continue;
176176
} else {
177-
tr_info("[NET-%d] Found body index: %d", thread_id, body_index);
177+
tr_info("[NET-%" PRIu32 "] Found body index: %d", thread_id, body_index);
178178

179179
/* remove header before comparison */
180180
memmove(receive_buffer, &receive_buffer[body_index + 4], result - body_index - 4);
@@ -194,7 +194,7 @@ size_t download_test(NetworkInterface *interface, const unsigned char *data, siz
194194
speed = float(received_bytes) / timer.read();
195195
percent = float(received_bytes) * 100 / float(data_length);
196196
time_left = (data_length - received_bytes) / speed;
197-
tr_info("[NET-%d] Received bytes: %u, (%.2f%%, %.2fKB/s, ETA: %02d:%02d:%02d)",
197+
tr_info("[NET-%" PRIu32 "] Received bytes: %u, (%.2f%%, %.2fKB/s, ETA: %02" PRIu32 ":%02" PRIu32 ":%02" PRIu32 ")",
198198
thread_id, received_bytes, percent, speed / 1024,
199199
time_left / 3600, (time_left / 60) % 60, time_left % 60);
200200
}
@@ -205,7 +205,7 @@ size_t download_test(NetworkInterface *interface, const unsigned char *data, siz
205205

206206
timer.stop();
207207
float f_received_bytes = float(received_bytes);
208-
tr_info("[NET-%d] Downloaded: %.2fKB (%.2fKB/s, %.2f secs)", thread_id,
208+
tr_info("[NET-%" PRIu32 "] Downloaded: %.2fKB (%.2fKB/s, %.2f secs)", thread_id,
209209
f_received_bytes / 1024.,
210210
f_received_bytes / (timer.read() * 1024.),
211211
timer.read());

TESTS/integration/net-single/main.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ static control_t setup_network(const size_t call_count)
7272
}
7373
}
7474
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, err);
75-
tr_info("[NET] IP address is '%s'", interface->get_ip_address());
76-
tr_info("[NET] MAC address is '%s'", interface->get_mac_address());
75+
7776
return CaseNext;
7877
}
7978

TESTS/integration/net-threaded/main.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ static control_t setup_network(const size_t call_count)
7272
}
7373
}
7474
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, err);
75-
tr_info("[NET] IP address is '%s'", net->get_ip_address());
76-
tr_info("[NET] MAC address is '%s'", net->get_mac_address());
75+
7776
return CaseNext;
7877
}
7978

TESTS/integration/stress-net-fs/main.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ static control_t setup_network(const size_t call_count)
7878
}
7979
}
8080
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, err);
81-
tr_info("[NET] IP address is '%s'", interface->get_ip_address());
82-
tr_info("[NET] MAC address is '%s'", interface->get_mac_address());
81+
8382
return CaseNext;
8483
}
8584

@@ -113,7 +112,7 @@ void file_fn(size_t buffer)
113112
{
114113
uint32_t thread_id = core_util_atomic_incr_u32(&thread_counter, 1);
115114
char filename[255] = { 0 };
116-
snprintf(filename, 255, "mbed-file-test-%d.txt", thread_id);
115+
snprintf(filename, 255, "mbed-file-test-%" PRIu32 ".txt", thread_id);
117116
file_test_write(filename, 0, story, sizeof(story), buffer);
118117
file_test_read(filename, 0, story, sizeof(story), buffer);
119118
}

0 commit comments

Comments
 (0)