Skip to content

Commit 23ada5c

Browse files
committed
try to get abort texts from GH
1 parent 97c37ef commit 23ada5c

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

test/mip_tap_test.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,16 @@ static const char *s_ca_cert =
6666

6767
static int s_num_tests = 0;
6868

69+
#define ABORT() \
70+
usleep(500000); /* 500 ms, GH print reason */ \
71+
abort();
72+
6973
#define ASSERT(expr) \
7074
do { \
7175
s_num_tests++; \
7276
if (!(expr)) { \
7377
printf("FAILURE %s:%d: %s\n", __FILE__, __LINE__, #expr); \
74-
usleep(500000); /* 500 ms, GH print reason */ \
75-
abort(); \
78+
ABORT(); \
7679
} \
7780
} while (0)
7881

@@ -317,18 +320,19 @@ int main(void) {
317320
ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
318321
if (ioctl(fd, TUNSETIFF, (void *) &ifr) < 0) {
319322
MG_ERROR(("Failed to setup TAP interface: %s", ifr.ifr_name));
320-
abort(); // return EXIT_FAILURE;
323+
ABORT(); // return EXIT_FAILURE;
321324
}
322325
#else
323326
ifr.ifr_flags = (short) (IFF_UP | IFF_BROADCAST | IFF_MULTICAST);
324327
if (ioctl(fd, TUNSIFMODE, (void *) &ifr) < 0) {
325328
MG_ERROR(("Failed to setup TAP interface: %s", ifr.ifr_name));
326-
abort(); // return EXIT_FAILURE;
329+
ABORT(); // return EXIT_FAILURE;
327330
}
328331
#endif
329332
fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK); // Non-blocking mode
330333

331334
MG_INFO(("Opened TAP interface: %s", iface));
335+
usleep(200000); // 200 ms
332336

333337
// Events
334338
struct mg_mgr mgr; // Event manager
@@ -361,6 +365,7 @@ int main(void) {
361365

362366
mg_tcpip_init(&mgr, &mif);
363367
MG_INFO(("Init done, starting main loop"));
368+
usleep(200000); // 200 ms
364369

365370
// Stack initialization, Network configuration (DHCP lease, ...)
366371
#if MIPTAPTEST_USING_DHCP == 0

0 commit comments

Comments
 (0)