File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -41,15 +41,25 @@ static void test_csum(void) {
41
41
// UDP and TCP checksum calc funcions use the same basic calls as ipcsum()
42
42
}
43
43
44
+ static bool executed = false;
45
+
46
+ static void mif_fn (struct mg_tcpip_if * ifp , int ev , void * ev_data ) {
47
+ if (ev == MG_TCPIP_EV_ST_CHG )
48
+ ASSERT (* (uint8_t * ) ev_data == MG_TCPIP_STATE_READY );
49
+ executed = true;
50
+ (void ) ifp ;
51
+ }
52
+
44
53
static void test_statechange (void ) {
45
- char tx [1540 ];
46
54
struct mg_tcpip_if iface ;
47
55
memset (& iface , 0 , sizeof (iface ));
48
56
iface .ip = mg_htonl (0x01020304 );
49
57
iface .state = MG_TCPIP_STATE_READY ;
50
- iface .tx .buf = tx , iface .tx .len = sizeof (tx );
51
58
iface .driver = & mg_tcpip_driver_mock ;
59
+ iface .fn = mif_fn ;
52
60
onstatechange (& iface );
61
+ ASSERT (executed == true);
62
+ executed = false;
53
63
}
54
64
55
65
static void ph (struct mg_connection * c , int ev , void * ev_data ) {
You can’t perform that action at this time.
0 commit comments