1 /*
2 * Copyright (c) 2020-2021 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #include <securec.h>
17 #include "hctest.h"
18 #include "ohos_types.h"
19 #include "parameter.h"
20 #include "parameter_utils.h"
21
22 #define MAX_LEN 128
23 #define INVALID_LEN 2
24 #define COMMON_ERROR (-1)
25 #define INVALID_PARAMETER (-9)
26
27 static const char* g_defSysParam = "data of sys param ***...";
28
29 /**
30 * @tc.desc : register a test suite, this suite is used to test basic flow
31 * and interface dependency
32 * @param : subsystem name is utils
33 * @param : module name is parameter
34 * @param : test suit name is DeviceInfoFuncTestSuite
35 */
36 LITE_TEST_SUIT(startup, deviceinfo, DeviceInfoFuncTestSuite);
37
38 /**
39 * @tc.setup : setup for all testcases
40 * @return : setup result, TRUE is success, FALSE is fail
41 */
DeviceInfoFuncTestSuiteSetUp(void)42 static BOOL DeviceInfoFuncTestSuiteSetUp(void)
43 {
44 return TRUE;
45 }
46
47 /**
48 * @tc.teardown : teardown for all testcases
49 * @return : teardown result, TRUE is success, FALSE is fail
50 */
DeviceInfoFuncTestSuiteTearDown(void)51 static BOOL DeviceInfoFuncTestSuiteTearDown(void)
52 {
53 printf("+--------------------------------------------+\n");
54 return TRUE;
55 }
56
57 /**
58 * @tc.name : testGetDeviceTypeFun001
59 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_0100
60 * @tc.desc : test obtaining device info DeviceType is not null.
61 */
62 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
63 testGetDeviceTypeFun001,
64 Function | MediumTest | Level1) {
65 const char* value = GetDeviceType();
66 printf("Device Type=%s\n", value);
67 AssertNotEmpty(value);
68 };
69
70 /**
71 * @tc.name : testGetDeviceTypeFun002
72 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_0200
73 * @tc.desc : test obtaining device info DeviceType that less than 32
74 * characters.
75 */
76 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
77 testGetDeviceTypeFun002,
78 Function | MediumTest | Level1) {
79 const char* value = GetDeviceType();
80 printf("Device Type=%s\n", value);
81 TEST_ASSERT_NOT_NULL(value);
82 if (value != NULL) {
83 TEST_ASSERT_TRUE(strlen(value) <= 32);
84 }
85 };
86
87 /**
88 * @tc.name : testGetManufactureFun001
89 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_0300
90 * @tc.desc : test obtaining device info Manufacture is not null.
91 */
92 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
93 testGetManufactureFun001,
94 Function | MediumTest | Level1) {
95 const char* value = GetManufacture();
96 printf("Manufacture=%s\n", value);
97 AssertNotEmpty(value);
98 };
99
100 /**
101 * @tc.name : testGetManufactureFun002
102 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_0400
103 * @tc.desc : test obtaining device info Manufacture that less than 32
104 * characters.
105 */
106 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
107 testGetManufactureFun002,
108 Function | MediumTest | Level1) {
109 const char* value = GetManufacture();
110 printf("Manufacture=%s\n", value);
111 TEST_ASSERT_NOT_NULL(value);
112 if (value != NULL) {
113 TEST_ASSERT_TRUE(strlen(value) <= 32);
114 }
115 };
116
117 /**
118 * @tc.name : testGetBrandFun001
119 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_0500
120 * @tc.desc : test obtaining device info Brand is not null.
121 */
122 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
123 testGetBrandFun001,
124 Function | MediumTest | Level1) {
125 const char* value = GetBrand();
126 printf("Brand=%s\n", value);
127 AssertNotEmpty(value);
128 };
129
130 /**
131 * @tc.name : testGetBrandFun002
132 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_0600
133 * @tc.desc : test obtaining device info Brand that less than 32
134 * characters.
135 */
136 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
137 testGetBrandFun002,
138 Function | MediumTest | Level1) {
139 const char* value = GetBrand();
140 printf("Brand=%s\n", value);
141 TEST_ASSERT_NOT_NULL(value);
142 if (value != NULL) {
143 TEST_ASSERT_TRUE(strlen(value) <= 32);
144 }
145 };
146
147 /**
148 * @tc.name : testGetMarketNameFun001
149 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_0700
150 * @tc.desc : test obtaining device info MarketName is not null.
151 */
152 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
153 testGetMarketNameFun001,
154 Function | MediumTest | Level1) {
155 const char* value = GetMarketName();
156 printf("Market Name=%s\n", value);
157 AssertNotEmpty(value);
158 };
159
160 /**
161 * @tc.name : testGetMarketNameFun002
162 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_0800
163 * @tc.desc : test obtaining device info MarketName that less than 32
164 * characters.
165 */
166 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
167 testGetMarketNameFun002,
168 Function | MediumTest | Level1) {
169 const char* value = GetMarketName();
170 printf("Market Name=%s\n", value);
171 TEST_ASSERT_NOT_NULL(value);
172 if (value != NULL) {
173 TEST_ASSERT_TRUE(strlen(value) <= 32);
174 }
175 };
176
177 /**
178 * @tc.name : testGetProductSeriesFun001
179 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_0900
180 * @tc.desc : test obtaining device info ProductSeries is not null.
181 */
182 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
183 testGetProductSeriesFun001,
184 Function | MediumTest | Level1) {
185 const char* value = GetProductSeries();
186 printf("Product Series=%s\n", value);
187 AssertNotEmpty(value);
188 };
189
190 /**
191 * @tc.name : testGetProductSeriesFun002
192 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_1000
193 * @tc.desc : test obtaining device info ProductSeries that less than 32
194 * characters.
195 */
196 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
197 testGetProductSeriesFun002,
198 Function | MediumTest | Level1) {
199 const char* value = GetProductSeries();
200 printf("Product Series=%s\n", value);
201 TEST_ASSERT_NOT_NULL(value);
202 if (value != NULL) {
203 TEST_ASSERT_TRUE(strlen(value) <= 32);
204 }
205 };
206
207 /**
208 * @tc.name : testGetProductModelFun001
209 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_1100
210 * @tc.desc : test obtaining device info ProductModel is not null.
211 */
212 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
213 testGetProductModelFun001,
214 Function | MediumTest | Level1) {
215 const char* value = GetProductModel();
216 printf("Product Model=%s\n", value);
217 AssertNotEmpty(value);
218 };
219
220 /**
221 * @tc.name : testGetProductModelFun002
222 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_1200
223 * @tc.desc : test obtaining device info ProductModel that less than 32
224 * characters.
225 */
226 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
227 testGetProductModelFun002,
228 Function | MediumTest | Level1) {
229 const char* value = GetProductModel();
230 printf("Product Model=%s\n", value);
231 TEST_ASSERT_NOT_NULL(value);
232 if (value != NULL) {
233 TEST_ASSERT_TRUE(strlen(value) <= 32);
234 }
235 };
236
237 /**
238 * @tc.name : testGetHardwareModel001
239 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_1300
240 * @tc.desc : test obtaining device info HardwareModel is not null.
241 */
242 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
243 testGetHardwareModel001,
244 Function | MediumTest | Level1) {
245 const char* value = GetHardwareModel();
246 printf("Hardware Model=%s\n", value);
247 AssertNotEmpty(value);
248 };
249
250 /**
251 * @tc.name : testGetHardwareModel002
252 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_1400
253 * @tc.desc : test obtaining device info HardwareModel that less than 32
254 * characters.
255 */
256 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
257 testGetHardwareModel002,
258 Function | MediumTest | Level1) {
259 const char* value = GetHardwareModel();
260 printf("Hardware Model=%s\n", value);
261 TEST_ASSERT_NOT_NULL(value);
262 if (value != NULL) {
263 TEST_ASSERT_TRUE(strlen(value) <= 32);
264 }
265 };
266
267 /**
268 * @tc.name : testGetSerialFun001
269 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_1500
270 * @tc.desc : test obtaining device info Serial is not null.
271 */
272 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
273 testGetSerialFun001,
274 Function | MediumTest | Level1) {
275 const char* value = GetSerial();
276 printf("Serial=%s\n", value);
277 AssertNotEmpty(value);
278 };
279
280 /**
281 * @tc.name : testGetSerialFun002
282 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_1600
283 * @tc.desc : test obtaining device info Serial that less than 64
284 * characters.
285 */
286 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
287 testGetSerialFun002,
288 Function | MediumTest | Level1) {
289 const char* value = GetSerial();
290 printf("Serial=%s\n", value);
291 TEST_ASSERT_NOT_NULL(value);
292 if (value != NULL) {
293 TEST_ASSERT_TRUE(strlen(value) <= 64);
294 }
295 };
296
297 /**
298 * @tc.name : testGetOSFullNameFun001
299 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_1700
300 * @tc.desc : test obtaining device info OSFullName is not null.
301 */
302 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
303 testGetOSFullNameFun001,
304 Function | MediumTest | Level1) {
305 const char* value = GetOSFullName();
306 printf("Os Name=%s\n", value);
307 AssertNotEmpty(value);
308 };
309
310 /**
311 * @tc.name : testGetOSFullNameFun002
312 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_1800
313 * @tc.desc : test obtaining device info OSFullName that less than 64
314 * characters.
315 */
316 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
317 testGetOSFullNameFun002,
318 Function | MediumTest | Level1) {
319 const char* value = GetOSFullName();
320 printf("Os Name=%s\n", value);
321 TEST_ASSERT_NOT_NULL(value);
322 if (value != NULL) {
323 TEST_ASSERT_TRUE(strlen(value) <= 64);
324 }
325 };
326
327 /**
328 * @tc.name : testGetDisplayVersionFun001
329 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_1900
330 * @tc.desc : test obtaining device info DisplayVersion is not null.
331 */
332 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
333 testGetDisplayVersionFun001,
334 Function | MediumTest | Level1) {
335 const char* value = GetDisplayVersion();
336 printf("Display Version=%s\n", value);
337 AssertNotEmpty(value);
338 };
339
340 /**
341 * @tc.name : testGetDisplayVersionFun002
342 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_2000
343 * @tc.desc : test obtaining device info DisplayVersion that less than 64
344 * characters.
345 */
346 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
347 testGetDisplayVersionFun002,
348 Function | MediumTest | Level1) {
349 const char* value = GetDisplayVersion();
350 printf("Display Version=%s\n", value);
351 TEST_ASSERT_NOT_NULL(value);
352 if (value != NULL) {
353 TEST_ASSERT_TRUE(strlen(value) <= 64);
354 }
355 };
356
357 /**
358 * @tc.name : testGetBootloaderVersionFun001
359 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_2100
360 * @tc.desc : test obtaining device info BootloaderVersion is not null.
361 */
362 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
363 testGetBootloaderVersionFun001,
364 Function | MediumTest | Level1) {
365 const char* value = GetBootloaderVersion();
366 printf("Bootloader Version=%s\n", value);
367 AssertNotEmpty(value);
368 };
369
370 /**
371 * @tc.name : testGetBootloaderVersionFun002
372 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_2200
373 * @tc.desc : test obtaining device info BootloaderVersion that less
374 * than 64 characters.
375 */
376 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
377 testGetBootloaderVersionFun002,
378 Function | MediumTest | Level1) {
379 const char* value = GetBootloaderVersion();
380 printf("Bootloader Version=%s\n", value);
381 TEST_ASSERT_NOT_NULL(value);
382 if (value != NULL) {
383 TEST_ASSERT_TRUE(strlen(value) <= 64);
384 }
385 };
386
387 /**
388 * @tc.name : testGetSecurityPatchTagFun001
389 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_2300
390 * @tc.desc : test obtaining device info SecurityPatchTag is not null.
391 */
392 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
393 testGetSecurityPatchTagFun001,
394 Function | MediumTest | Level1) {
395 const char* value = GetSecurityPatchTag();
396 printf("Secure Patch Level=%s\n", value);
397 AssertNotEmpty(value);
398 };
399
400 /**
401 * @tc.name : testGetSecurityPatchTagFun002
402 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_2400
403 * @tc.desc : test obtaining device info SecurityPatchTag that less
404 * than 64 characters.
405 */
406 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
407 testGetSecurityPatchTagFun002,
408 Function | MediumTest | Level1) {
409 const char* value = GetSecurityPatchTag();
410 printf("Secure Patch Level=%s\n", value);
411 TEST_ASSERT_NOT_NULL(value);
412 if (value != NULL) {
413 TEST_ASSERT_TRUE(strlen(value) <= 64);
414 }
415 };
416
417 /**
418 * @tc.name : testGetSecurityPatchTagFun003
419 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_2500
420 * @tc.desc : test obtaining device info SecurityPatchTag which format is
421 * yy-mm-dd
422 */
423 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
424 testGetSecurityPatchTagFun003,
425 Function | MediumTest | Level1) {
426 const char* value = GetSecurityPatchTag();
427 printf("Secure Patch Level=%s\n", value);
428
429 int year, month, day;
430 sscanf(value, "%04d\/%02d\/%02d", &year, &month, &day);
431 printf("%04d\/%02d\/%02d\n", year, month, day);
432
433 TEST_ASSERT_TRUE(year > 1900 && year < 2056);
434 TEST_ASSERT_TRUE(month <= 12 && month > 0);
435 TEST_ASSERT_TRUE(day <= 31 && day > 0);
436
437 char str[10] = {0};
438 sprintf(str, "%d\/%02d\/%02d", year, month, day);
439 printf("str=%s\n", str);
440 TEST_ASSERT_EQUAL_STRING(str, value);
441 };
442
443 /**
444 * @tc.name : testGetAbiListFun001
445 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_2600
446 * @tc.desc : test obtaining device info AbiList is not null.
447 */
448 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
449 testGetAbiListFun001,
450 Function | MediumTest | Level1) {
451 const char* value = GetAbiList();
452 printf("Abi List=%s\n", value);
453 AssertNotEmpty(value);
454 };
455
456 /**
457 * @tc.name : testGetAbiListFun002
458 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_2700
459 * @tc.desc : test obtaining device info AbiList that less than 64
460 * characters.
461 */
462 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
463 testGetAbiListFun002,
464 Function | MediumTest | Level1) {
465 const char* value = GetAbiList();
466 printf("Abi List=%s\n", value);
467 TEST_ASSERT_NOT_NULL(value);
468 if (value != NULL) {
469 TEST_ASSERT_TRUE(strlen(value) <= 64);
470 }
471 };
472
473 /**
474 * @tc.name : testGetSdkApiVersionFun001
475 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_2800
476 * @tc.desc : test obtaining device info SdkApiVersion is not null.
477 */
478 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
479 testGetSdkApiVersionFun001,
480 Function | MediumTest | Level1) {
481 int value = GetSdkApiVersion();
482 printf("Sdk Api Level=%d\n", value);
483 TEST_ASSERT_TRUE(value > 0);
484 };
485
486 /**
487 * @tc.name : testGetFirstApiVersionFun001
488 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_2900
489 * @tc.desc : test obtaining device info FirstApiVersion is not null.
490 */
491 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
492 testGetFirstApiVersionFun001,
493 Function | MediumTest | Level1) {
494 int value = GetFirstApiVersion();
495 printf("First Api Level=%d\n", value);
496 TEST_ASSERT_TRUE(value > 0);
497 };
498
499 /**
500 * @tc.name : testGetIncrementalVersionFun001
501 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_3000
502 * @tc.desc : test obtaining device info IncrementalVersion is not null.
503 */
504 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
505 testGetIncrementalVersionFun001,
506 Function | MediumTest | Level1) {
507 const char* value = GetIncrementalVersion();
508 printf("Incremental Version=%s\n", value);
509 AssertNotEmpty(value);
510 };
511
512 /**
513 * @tc.name : testGetVersionIdFun001
514 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_3100
515 * @tc.desc : test obtaining device info VersionId is not null.
516 */
517 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
518 testGetVersionIdFun001,
519 Function | MediumTest | Level1) {
520 const char* value = GetVersionId();
521 printf("Version Id=%s\n", value);
522 AssertNotEmpty(value);
523 };
524
525 /**
526 * @tc.name : testGetVersionIdFun002
527 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_3200
528 * @tc.desc : test obtaining device info VersionId that less than 127
529 * characters.
530 */
531 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
532 testGetVersionIdFun002,
533 Function | MediumTest | Level1) {
534 const char* value = GetVersionId();
535 printf("Version Id=%s\n", value);
536 TEST_ASSERT_NOT_NULL(value);
537 if (value != NULL) {
538 TEST_ASSERT_TRUE(strlen(value) <= 127);
539 }
540 };
541
542 /**
543 * @tc.name : testGetBuildTypeFun001
544 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_3300
545 * @tc.desc : test obtaining device info BuildType is not null.
546 */
547 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
548 testGetBuildTypeFun001,
549 Function | MediumTest | Level1) {
550 const char* value = GetBuildType();
551 printf("Build Type=%s\n", value);
552 AssertNotEmpty(value);
553 };
554
555 /**
556 * @tc.name : testGetBuildTypeFun002
557 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_3400
558 * @tc.desc : test obtaining device info BuildType that less than 32
559 * characters.
560 */
561 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
562 testGetBuildTypeFun002,
563 Function | MediumTest | Level1) {
564 const char* value = GetBuildType();
565 printf("Build Type=%s\n", value);
566 TEST_ASSERT_NOT_NULL(value);
567 if (value != NULL) {
568 TEST_ASSERT_TRUE(strlen(value) <= 32);
569 }
570 };
571
572 /**
573 * @tc.name : testGetBuildUserFun001
574 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_3500
575 * @tc.desc : test obtaining device info BuildUser is not null.
576 */
577 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
578 testGetBuildUserFun001,
579 Function | MediumTest | Level1) {
580 const char* value = GetBuildUser();
581 printf("Build User=%s\n", value);
582 AssertNotEmpty(value);
583 };
584
585 /**
586 * @tc.name : testGetBuildUserFun002
587 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_3600
588 * @tc.desc : test obtaining device info BuildUser that less than 32
589 * characters.
590 */
591 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
592 testGetBuildUserFun002,
593 Function | MediumTest | Level1) {
594 const char* value = GetBuildUser();
595 printf("Build User=%s\n", value);
596 TEST_ASSERT_NOT_NULL(value);
597 if (value != NULL) {
598 TEST_ASSERT_TRUE(strlen(value) <= 32);
599 }
600 };
601
602 /**
603 * @tc.name : testGetBuildHostFun001
604 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_3700
605 * @tc.desc : test obtaining device info BuildHost is not null.
606 */
607 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
608 testGetBuildHostFun001,
609 Function | MediumTest | Level1) {
610 const char* value = GetBuildHost();
611 printf("Build Host=%s\n", value);
612 AssertNotEmpty(value);
613 };
614
615 /**
616 * @tc.name : testGetBuildHostFun002
617 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_3800
618 * @tc.desc : test obtaining device info BuildHost that less than 32
619 * characters.
620 */
621 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
622 testGetBuildHostFun002,
623 Function | MediumTest | Level1) {
624 const char* value = GetBuildHost();
625 printf("Build Host=%s\n", value);
626 TEST_ASSERT_NOT_NULL(value);
627 if (value != NULL) {
628 TEST_ASSERT_TRUE(strlen(value) <= 32);
629 }
630 };
631
632 /**
633 * @tc.name : testGetBuildTimeFun001
634 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_3900
635 * @tc.desc : test obtaining device info BuildTime is not null.
636 */
637 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
638 testGetBuildTimeFun001,
639 Function | MediumTest | Level1) {
640 const char* value = GetBuildTime();
641 printf("Build Time=%s\n", value);
642 AssertNotEmpty(value);
643 };
644
645 /**
646 * @tc.name : testGetBuildTimeFun002
647 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_4000
648 * @tc.desc : test obtaining device info BuildTime that less than 32
649 * characters.
650 */
651 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
652 testGetBuildTimeFun002,
653 Function | MediumTest | Level1) {
654 const char* value = GetBuildTime();
655 printf("Build Time=%s\n", value);
656 TEST_ASSERT_NOT_NULL(value);
657 if (value != NULL) {
658 TEST_ASSERT_TRUE(strlen(value) <= 32);
659 }
660 };
661
662 /**
663 * @tc.name : testGetSoftwareModelFun001
664 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_4100
665 * @tc.desc : test obtaining device info SoftwareModel is not null.
666 */
667 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
668 testGetSoftwareModelFun001,
669 Function | MediumTest | Level1) {
670 const char* value = GetSoftwareModel();
671 printf("Software Model=%s\n", value);
672 AssertNotEmpty(value);
673 };
674
675 /**
676 * @tc.name : testGetSoftwareModelFun002
677 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_4200
678 * @tc.desc : test obtaining device info SoftwareModel that less than 32
679 * characters.
680 */
681 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
682 testGetSoftwareModelFun002,
683 Function | MediumTest | Level1) {
684 const char* value = GetSoftwareModel();
685 printf("Software Model=%s\n", value);
686 TEST_ASSERT_NOT_NULL(value);
687 if (value != NULL) {
688 TEST_ASSERT_TRUE(strlen(value) <= 32);
689 }
690 };
691
692 /**
693 * @tc.name : testGetBuildRootHashFun001
694 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_4500
695 * @tc.desc : test obtaining device info BuildRootHash is not null.
696 */
697 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
698 testGetBuildRootHashFun001,
699 Function | MediumTest | Level1) {
700 const char* value = GetBuildRootHash();
701 printf("Build Root Hash=%s\n", value);
702 TEST_ASSERT_NOT_NULL(value);
703 };
704
705 /**
706 * @tc.name : testGetHardwareProfileFun001
707 * @tc.number : SUB_STARTUP_MINI_DEVICEINFO_FUN_4600
708 * @tc.desc : test obtaining device info HardwareProfile is not null.
709 */
710 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
711 testGetHardwareProfileFun001,
712 Function | MediumTest | Level1) {
713 const char* value = GetHardwareProfile();
714 printf("Hardware Profile=%s\n", value);
715 AssertNotEmpty(value);
716 };
717
718 RUN_TEST_SUITE(DeviceInfoFuncTestSuite);
719