|
18 | 18 | #include "m2mobject_stub.h"
|
19 | 19 | #include "m2mobjectinstance_stub.h"
|
20 | 20 | #include "m2mresource_stub.h"
|
| 21 | +#include "m2mresourcebase_stub.h" |
21 | 22 | #include "m2mresourceinstance_stub.h"
|
22 | 23 | #include "m2mbase_stub.h"
|
23 | 24 | #include "nsdlaccesshelper_stub.h"
|
@@ -209,12 +210,12 @@ void Test_M2MSecurity::test_resource_value_int()
|
209 | 210 | m2mresourceinstance_stub::bool_value = true;
|
210 | 211 |
|
211 | 212 | uint8_t value[] = {"10"};
|
212 |
| - //m2mresourceinstance_stub::value = (uint8_t*)malloc((uint32_t)sizeof(value)); |
| 213 | + //m2mresourcebase_stub::value = (uint8_t*)malloc((uint32_t)sizeof(value)); |
213 | 214 | uint8_t size = 0;
|
214 |
| - m2mresourceinstance_stub::value = String::convert_integer_to_array(10,size); |
215 |
| - /*memset(m2mresourceinstance_stub::value,0,(uint32_t)size); |
216 |
| - memcpy(m2mresourceinstance_stub::value, 10, size);*/ |
217 |
| - m2mresourceinstance_stub::int_value = (uint16_t)size; |
| 215 | + m2mresourcebase_stub::value = String::convert_integer_to_array(10,size); |
| 216 | + /*memset(m2mresourcebase_stub::value,0,(uint32_t)size); |
| 217 | + memcpy(m2mresourcebase_stub::value, 10, size);*/ |
| 218 | + m2mresourcebase_stub::int_value = (uint16_t)size; |
218 | 219 |
|
219 | 220 | m2mobjectinstance_stub::resource = new M2MResource(*m2mobject_stub::inst,
|
220 | 221 | "name",
|
@@ -254,18 +255,18 @@ void Test_M2MSecurity::test_resource_value_int()
|
254 | 255 | delete m2mobjectinstance_stub::resource;
|
255 | 256 | m2mobjectinstance_stub::resource = NULL;
|
256 | 257 |
|
257 |
| - free(m2mresourceinstance_stub::value); |
258 |
| - m2mresourceinstance_stub::value = NULL; |
| 258 | + free(m2mresourcebase_stub::value); |
| 259 | + m2mresourcebase_stub::value = NULL; |
259 | 260 | }
|
260 | 261 |
|
261 | 262 | void Test_M2MSecurity::test_resource_value_string()
|
262 | 263 | {
|
263 | 264 | m2mresourceinstance_stub::bool_value = true;
|
264 | 265 | String test = "string";
|
265 | 266 | uint8_t value[] = {"string"};
|
266 |
| - m2mresourceinstance_stub::value = (uint8_t*)malloc((uint32_t)sizeof(value)); |
267 |
| - memset(m2mresourceinstance_stub::value,0,(uint32_t)sizeof(value)); |
268 |
| - memcpy(m2mresourceinstance_stub::value,value,sizeof(value)); |
| 267 | + m2mresourcebase_stub::value = (uint8_t*)malloc((uint32_t)sizeof(value)); |
| 268 | + memset(m2mresourcebase_stub::value,0,(uint32_t)sizeof(value)); |
| 269 | + memcpy(m2mresourcebase_stub::value,value,sizeof(value)); |
269 | 270 | m2mresourceinstance_stub::int_value = (uint16_t)sizeof(value);
|
270 | 271 |
|
271 | 272 | m2mobjectinstance_stub::resource = new M2MResource(*m2mobject_stub::inst,
|
@@ -293,21 +294,21 @@ void Test_M2MSecurity::test_resource_value_string()
|
293 | 294 | delete m2mobjectinstance_stub::resource;
|
294 | 295 | m2mobjectinstance_stub::resource = NULL;
|
295 | 296 |
|
296 |
| - free(m2mresourceinstance_stub::value); |
297 |
| - m2mresourceinstance_stub::value = NULL; |
| 297 | + free(m2mresourcebase_stub::value); |
| 298 | + m2mresourcebase_stub::value = NULL; |
298 | 299 | }
|
299 | 300 |
|
300 | 301 | void Test_M2MSecurity::test_resource_value_buffer()
|
301 | 302 | {
|
302 |
| - m2mresourceinstance_stub::bool_value = true; |
| 303 | + m2mresourcebase_stub::bool_value = true; |
303 | 304 |
|
304 | 305 | uint8_t value[] = {"buffer"};
|
305 | 306 | uint8_t *out_value = NULL;
|
306 | 307 |
|
307 |
| - m2mresourceinstance_stub::value = (uint8_t*)malloc((uint32_t)sizeof(value)); |
308 |
| - memset(m2mresourceinstance_stub::value,0,(uint32_t)sizeof(value)); |
309 |
| - memcpy(m2mresourceinstance_stub::value,value,sizeof(value)); |
310 |
| - m2mresourceinstance_stub::int_value = (uint16_t)sizeof(value); |
| 308 | + m2mresourcebase_stub::value = (uint8_t*)malloc((uint32_t)sizeof(value)); |
| 309 | + memset(m2mresourcebase_stub::value,0,(uint32_t)sizeof(value)); |
| 310 | + memcpy(m2mresourcebase_stub::value,value,sizeof(value)); |
| 311 | + m2mresourcebase_stub::int_value = (uint16_t)sizeof(value); |
311 | 312 |
|
312 | 313 | m2mobjectinstance_stub::resource = new M2MResource(*m2mobject_stub::inst,
|
313 | 314 | "name",
|
@@ -343,8 +344,8 @@ void Test_M2MSecurity::test_resource_value_buffer()
|
343 | 344 | delete m2mobjectinstance_stub::resource;
|
344 | 345 | m2mobjectinstance_stub::resource = NULL;
|
345 | 346 |
|
346 |
| - free(m2mresourceinstance_stub::value); |
347 |
| - m2mresourceinstance_stub::value = NULL; |
| 347 | + free(m2mresourcebase_stub::value); |
| 348 | + m2mresourcebase_stub::value = NULL; |
348 | 349 | }
|
349 | 350 |
|
350 | 351 | void Test_M2MSecurity::test_is_resource_present()
|
|
0 commit comments