forked from LiteOS/LiteOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_agenttiny.h
158 lines (143 loc) · 6.11 KB
/
test_agenttiny.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
#ifndef TEST_AGENTTINY_H_
#define TEST_AGENTTINY_H_
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include "los_base.h"
#include "los_task.ph"
#include "los_typedef.h"
#include "los_sys.h"
#include "atiny_lwm2m/agenttiny.h"
#include "osdepends/atiny_osdep.h"
#include <cmockery.h>
//#include "regresstest.h"
#include "atiny_lwm2m/agenttiny.h"
#include "liblwm2m.h"
#include "object_comm.h"
#define TEST_LOG printf("Atiny_Test_Log : %s : %d \n",__FUNCTION__, __LINE__)
//#define TEST_LWM2M_SERVER_IP "192.168.1.102" //leshan server
//#define TEST_LWM2M_SERVER_DTLS_IP "192.168.1.102"
#define TEST_LWM2M_SERVER_IP "180.101.147.115" // dianxin
#define TEST_LWM2M_SERVER_DTLS_IP "180.101.147.115"
#define TEST_LWM2M_SERVER_IP_INVALID "not server ip"
#define TEST_LWM2M_SERVER_PORT "5683"
#define TEST_LWM2M_SERVER_DTLS_PORT "5684"
#define TEST_LWM2M_SERVER_DTLS_PORT_INVALID "not a port"
#define TEST_LWM2M_SERVER_PSK_ID "6666dtls"
#define TEST_LWM2M_SERVER_PSK_ID_INVALID "not a psk id"
#define TEST_LWM2M_SERVER_PSK_INVALID "not a psk"
#define DEFAULT_EP_NAME "6666wifi"
#define DEFAULT_EP_NAME_S "6666dtls"
#define DEFAULT_MFT "lwm2mFota"
#define DEFAULT_DEV_TYPE "lwm2mFota"
extern void *test_phandle;
extern char TEST_LWM2M_SERVER_PSK[16];
extern char otherPSK[4];
extern int is_reg_ok();
extern int It_Los_Atiny_Init(void);
extern int It_Los_Atiny_Bind(void);
extern int It_Los_Atiny_Data_Report(void);
typedef struct
{
lwm2m_context_t *lwm2m_context;
atiny_param_t atiny_params;
client_data_t client_data;
lwm2m_object_t *obj_array[8];
int atiny_quit;
int reconnect_flag;
void *quit_sem;
int reboot_flag;
uint8_t *recv_buffer;
} handle_data_t;
//const UnitTest tests;
extern int test_agenttyiny(void);
/********* atiny_init **********/
extern void It_Los_Atiny_Init_000(void **state);
extern void It_Los_Atiny_Init_001(void **state);
extern void It_Los_Atiny_Init_002(void **state);
extern void It_Los_Atiny_Init_003(void **state);
extern void It_Los_Atiny_Init_004(void **state);
extern void It_Los_Atiny_Init_005(void **state);
extern void It_Los_Atiny_Init_006(void **state);
extern void It_Los_Atiny_Init_007(void **state);
extern void It_Los_Atiny_Init_008(void **state);
extern void It_Los_Atiny_Init_009(void **state);
extern void It_Los_Atiny_Init_010(void **state);
extern void It_Los_Atiny_Init_011(void **state);
extern void It_Los_Atiny_Init_012(void **state);
extern void It_Los_Atiny_Init_013(void **state);
extern void It_Los_Atiny_Init_014(void **state);
extern void It_Los_Atiny_Init_015(void **state);
extern void It_Los_Atiny_Init_016(void **state);
extern void It_Los_Atiny_Init_017(void **state);
extern void It_Los_Atiny_Init_018(void **state);
extern void It_Los_Atiny_Init_019(void **state);
extern void It_Los_Atiny_Init_020(void **state);
extern void It_Los_Atiny_Init_021(void **state);
extern void It_Los_Atiny_Init_022(void **state);
extern void It_Los_Atiny_Init_023(void **state);
extern void It_Los_Atiny_Init_024(void **state);
extern void It_Los_Atiny_Init_025(void **state);
extern void It_Los_Atiny_Init_026(void **state);
extern void It_Los_Atiny_Init_027(void **state);
extern void It_Los_Atiny_Init_028(void **state);
extern void It_Los_Atiny_Init_029(void **state);
extern void It_Los_Atiny_Init_030(void **state);
extern void It_Los_Atiny_Init_031(void **state);
extern void It_Los_Atiny_Init_032(void **state);
extern void It_Los_Atiny_Init_033(void **state);
extern void It_Los_Atiny_Init_034(void **state);
extern void It_Los_Atiny_Init_035(void **state);
extern void It_Los_Atiny_Init_036(void **state);
extern void It_Los_Atiny_Init_037(void **state);
/********* atiny_bind **********/
extern void It_Los_Atiny_Bind_000(void **state);
extern void It_Los_Atiny_Bind_001(void **state);
extern void It_Los_Atiny_Bind_002(void **state);
extern void It_Los_Atiny_Bind_003(void **state);
extern void It_Los_Atiny_Bind_004(void **state);
extern void It_Los_Atiny_Bind_005(void **state);
extern void It_Los_Atiny_Bind_006(void **state);
extern void It_Los_Atiny_Bind_007(void **state);
extern void It_Los_Atiny_Bind_008(void **state);
extern void It_Los_Atiny_Bind_009(void **state);
extern void It_Los_Atiny_Bind_010(void **state);
extern void It_Los_Atiny_Bind_011(void **state);
extern void It_Los_Atiny_Bind_012(void **state);
extern void It_Los_Atiny_Bind_013(void **state);
extern void It_Los_Atiny_Bind_014(void **state);
extern void It_Los_Atiny_Bind_015(void **state);
extern void It_Los_Atiny_Bind_016(void **state);
extern void It_Los_Atiny_Bind_017(void **state);
extern void It_Los_Atiny_Bind_018(void **state);
extern void It_Los_Atiny_Bind_019(void **state);
extern void It_Los_Atiny_Bind_020(void **state);
extern void It_Los_Atiny_Bind_021(void **state);
extern void It_Los_Atiny_Bind_022(void **state);
extern void It_Los_Atiny_Bind_023(void **state);
extern void It_Los_Atiny_Bind_024(void **state);
extern void It_Los_Atiny_Bind_025(void **state);
extern void It_Los_Atiny_Bind_026(void **state);
extern void It_Los_Atiny_Bind_030(void **state);
extern void It_Los_Atiny_Bind_031(void **state);
extern void It_Los_Atiny_Bind_032(void **state);
extern void It_Los_Atiny_Bind_033(void **state);
extern void It_Los_Atiny_Bind_034(void **state);
extern void It_Los_Atiny_Bind_035(void **state);
extern void It_Los_Atiny_Bind_036(void **state);
extern void It_Los_Atiny_Bind_037(void **state);
extern void It_Los_Atiny_Bind_038(void **state);
extern void It_Los_Atiny_Bind_039(void **state);
extern void It_Los_Atiny_Bind_040(void **state);
extern void It_Los_Atiny_Bind_041(void **state);
extern void It_Los_Atiny_Bind_042(void **state);
extern void It_Los_Atiny_Bind_043(void **state);
extern void It_Los_Atiny_Bind_044(void **state);
extern void It_Los_Atiny_Data_Report_000(void **state);
extern void It_Los_Atiny_Data_Report_001(void **state);
extern void It_Los_Atiny_Data_Report_002(void **state);
extern void It_Los_Atiny_Data_Report_003(void **state);
extern void It_Los_Atiny_Data_Report_004(void **state);
extern void It_Los_Atiny_Data_Report_005(void **state);
extern void It_Los_Atiny_Data_Report_006(void **state);
#endif