mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-18 07:58:13 +08:00
修改了Web后台的部分界面,增加了HAmqtt中的总电量传感器,后台新增mqtt上报频率设置
This commit is contained in:
68
mico-os/MiCO/net/LwIP/ver1.5.0/test/unit/udp/test_udp.c
Normal file
68
mico-os/MiCO/net/LwIP/ver1.5.0/test/unit/udp/test_udp.c
Normal file
@@ -0,0 +1,68 @@
|
||||
#include "test_udp.h"
|
||||
|
||||
#include "lwip/udp.h"
|
||||
#include "lwip/stats.h"
|
||||
|
||||
#if !LWIP_STATS || !UDP_STATS || !MEMP_STATS
|
||||
#error "This tests needs UDP- and MEMP-statistics enabled"
|
||||
#endif
|
||||
|
||||
/* Helper functions */
|
||||
static void
|
||||
udp_remove_all(void)
|
||||
{
|
||||
struct udp_pcb *pcb = udp_pcbs;
|
||||
struct udp_pcb *pcb2;
|
||||
|
||||
while(pcb != NULL) {
|
||||
pcb2 = pcb;
|
||||
pcb = pcb->next;
|
||||
udp_remove(pcb2);
|
||||
}
|
||||
fail_unless(lwip_stats.memp[MEMP_UDP_PCB].used == 0);
|
||||
}
|
||||
|
||||
/* Setups/teardown functions */
|
||||
|
||||
static void
|
||||
udp_setup(void)
|
||||
{
|
||||
udp_remove_all();
|
||||
}
|
||||
|
||||
static void
|
||||
udp_teardown(void)
|
||||
{
|
||||
udp_remove_all();
|
||||
}
|
||||
|
||||
|
||||
/* Test functions */
|
||||
|
||||
START_TEST(test_udp_new_remove)
|
||||
{
|
||||
struct udp_pcb* pcb;
|
||||
LWIP_UNUSED_ARG(_i);
|
||||
|
||||
fail_unless(lwip_stats.memp[MEMP_UDP_PCB].used == 0);
|
||||
|
||||
pcb = udp_new();
|
||||
fail_unless(pcb != NULL);
|
||||
if (pcb != NULL) {
|
||||
fail_unless(lwip_stats.memp[MEMP_UDP_PCB].used == 1);
|
||||
udp_remove(pcb);
|
||||
fail_unless(lwip_stats.memp[MEMP_UDP_PCB].used == 0);
|
||||
}
|
||||
}
|
||||
END_TEST
|
||||
|
||||
|
||||
/** Create the suite including all tests for this module */
|
||||
Suite *
|
||||
udp_suite(void)
|
||||
{
|
||||
testfunc tests[] = {
|
||||
TESTFUNC(test_udp_new_remove),
|
||||
};
|
||||
return create_suite("UDP", tests, sizeof(tests)/sizeof(testfunc), udp_setup, udp_teardown);
|
||||
}
|
||||
8
mico-os/MiCO/net/LwIP/ver1.5.0/test/unit/udp/test_udp.h
Normal file
8
mico-os/MiCO/net/LwIP/ver1.5.0/test/unit/udp/test_udp.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef LWIP_HDR_TEST_UDP_H__
|
||||
#define LWIP_HDR_TEST_UDP_H__
|
||||
|
||||
#include "../lwip_check.h"
|
||||
|
||||
Suite* udp_suite(void);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user