• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 {
66   const char *value = GetDeviceType();
67   printf("Device Type=%s\n", value);
68   AssertNotEmpty(value);
69 };
70 
71 /**
72  * @tc.name      : testGetDeviceTypeFun002
73  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_0200
74  * @tc.desc      : test obtaining device info DeviceType that less than 32
75  * characters.
76  */
77 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
78                testGetDeviceTypeFun002,
79                Function | MediumTest | Level1)
80 {
81   const char *value = GetDeviceType();
82   printf("Device Type=%s\n", value);
83   TEST_ASSERT_NOT_NULL(value);
84   if (value != NULL)
85   {
86     TEST_ASSERT_TRUE(strlen(value) <= 32);
87   }
88 };
89 
90 /**
91  * @tc.name      : testGetManufactureFun001
92  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_0300
93  * @tc.desc      : test obtaining device info Manufacture is not null.
94  */
95 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
96                testGetManufactureFun001,
97                Function | MediumTest | Level1)
98 {
99   const char *value = GetManufacture();
100   printf("Manufacture=%s\n", value);
101   AssertNotEmpty(value);
102 };
103 
104 /**
105  * @tc.name      : testGetManufactureFun002
106  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_0400
107  * @tc.desc      : test obtaining device info Manufacture that less than 32
108  * characters.
109  */
110 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
111                testGetManufactureFun002,
112                Function | MediumTest | Level1)
113 {
114   const char *value = GetManufacture();
115   printf("Manufacture=%s\n", value);
116   TEST_ASSERT_NOT_NULL(value);
117   if (value != NULL)
118   {
119     TEST_ASSERT_TRUE(strlen(value) <= 32);
120   }
121 };
122 
123 /**
124  * @tc.name      : testGetBrandFun001
125  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_0500
126  * @tc.desc      : test obtaining device info Brand is not null.
127  */
128 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
129                testGetBrandFun001,
130                Function | MediumTest | Level1)
131 {
132   const char *value = GetBrand();
133   printf("Brand=%s\n", value);
134   AssertNotEmpty(value);
135 };
136 
137 /**
138  * @tc.name      : testGetBrandFun002
139  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_0600
140  * @tc.desc      : test obtaining device info Brand that less than 32
141  * characters.
142  */
143 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
144                testGetBrandFun002,
145                Function | MediumTest | Level1)
146 {
147   const char *value = GetBrand();
148   printf("Brand=%s\n", value);
149   TEST_ASSERT_NOT_NULL(value);
150   if (value != NULL)
151   {
152     TEST_ASSERT_TRUE(strlen(value) <= 32);
153   }
154 };
155 
156 /**
157  * @tc.name      : testGetMarketNameFun001
158  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_0700
159  * @tc.desc      : test obtaining device info MarketName is not null.
160  */
161 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
162                testGetMarketNameFun001,
163                Function | MediumTest | Level1)
164 {
165   const char *value = GetMarketName();
166   printf("Market Name=%s\n", value);
167   AssertNotEmpty(value);
168 };
169 
170 /**
171  * @tc.name      : testGetMarketNameFun002
172  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_0800
173  * @tc.desc      : test obtaining device info MarketName that less than 32
174  * characters.
175  */
176 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
177                testGetMarketNameFun002,
178                Function | MediumTest | Level1)
179 {
180   const char *value = GetMarketName();
181   printf("Market Name=%s\n", value);
182   TEST_ASSERT_NOT_NULL(value);
183   if (value != NULL)
184   {
185     TEST_ASSERT_TRUE(strlen(value) <= 32);
186   }
187 };
188 
189 /**
190  * @tc.name      : testGetProductSeriesFun001
191  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_0900
192  * @tc.desc      : test obtaining device info ProductSeries is not null.
193  */
194 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
195                testGetProductSeriesFun001,
196                Function | MediumTest | Level1)
197 {
198   const char *value = GetProductSeries();
199   printf("Product Series=%s\n", value);
200   AssertNotEmpty(value);
201 };
202 
203 /**
204  * @tc.name      : testGetProductSeriesFun002
205  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_1000
206  * @tc.desc      : test obtaining device info ProductSeries that less than 32
207  * characters.
208  */
209 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
210                testGetProductSeriesFun002,
211                Function | MediumTest | Level1)
212 {
213   const char *value = GetProductSeries();
214   printf("Product Series=%s\n", value);
215   TEST_ASSERT_NOT_NULL(value);
216   if (value != NULL)
217   {
218     TEST_ASSERT_TRUE(strlen(value) <= 32);
219   }
220 };
221 
222 /**
223  * @tc.name      : testGetProductModelFun001
224  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_1100
225  * @tc.desc      : test obtaining device info ProductModel is not null.
226  */
227 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
228                testGetProductModelFun001,
229                Function | MediumTest | Level1)
230 {
231   const char *value = GetProductModel();
232   printf("Product Model=%s\n", value);
233   AssertNotEmpty(value);
234 };
235 
236 /**
237  * @tc.name      : testGetProductModelFun002
238  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_1200
239  * @tc.desc      : test obtaining device info ProductModel that less than 32
240  * characters.
241  */
242 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
243                testGetProductModelFun002,
244                Function | MediumTest | Level1)
245 {
246   const char *value = GetProductModel();
247   printf("Product Model=%s\n", value);
248   TEST_ASSERT_NOT_NULL(value);
249   if (value != NULL)
250   {
251     TEST_ASSERT_TRUE(strlen(value) <= 32);
252   }
253 };
254 
255 /**
256  * @tc.name      : testGetHardwareModel001
257  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_1300
258  * @tc.desc      : test obtaining device info HardwareModel is not null.
259  */
260 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
261                testGetHardwareModel001,
262                Function | MediumTest | Level1)
263 {
264   const char *value = GetHardwareModel();
265   printf("Hardware Model=%s\n", value);
266   AssertNotEmpty(value);
267 };
268 
269 /**
270  * @tc.name      : testGetHardwareModel002
271  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_1400
272  * @tc.desc      : test obtaining device info HardwareModel that less than 32
273  * characters.
274  */
275 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
276                testGetHardwareModel002,
277                Function | MediumTest | Level1)
278 {
279   const char *value = GetHardwareModel();
280   printf("Hardware Model=%s\n", value);
281   TEST_ASSERT_NOT_NULL(value);
282   if (value != NULL)
283   {
284     TEST_ASSERT_TRUE(strlen(value) <= 32);
285   }
286 };
287 
288 /**
289  * @tc.name      : testGetSerialFun001
290  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_1500
291  * @tc.desc      : test obtaining device info Serial is not null.
292  */
293 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
294                testGetSerialFun001,
295                Function | MediumTest | Level1)
296 {
297   const char *value = GetSerial();
298   printf("Serial=%s\n", value);
299   AssertNotEmpty(value);
300 };
301 
302 /**
303  * @tc.name      : testGetSerialFun002
304  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_1600
305  * @tc.desc      : test obtaining device info Serial that less than 64
306  * characters.
307  */
308 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
309                testGetSerialFun002,
310                Function | MediumTest | Level1)
311 {
312   const char *value = GetSerial();
313   printf("Serial=%s\n", value);
314   TEST_ASSERT_NOT_NULL(value);
315   if (value != NULL)
316   {
317     TEST_ASSERT_TRUE(strlen(value) <= 64);
318   }
319 };
320 
321 /**
322  * @tc.name      : testGetOSFullNameFun001
323  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_1700
324  * @tc.desc      : test obtaining device info OSFullName is not null.
325  */
326 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
327                testGetOSFullNameFun001,
328                Function | MediumTest | Level1)
329 {
330   const char *value = GetOSFullName();
331   printf("Os Name=%s\n", value);
332   AssertNotEmpty(value);
333 };
334 
335 /**
336  * @tc.name      : testGetOSFullNameFun002
337  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_1800
338  * @tc.desc      : test obtaining device info OSFullName that less than 64
339  * characters.
340  */
341 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
342                testGetOSFullNameFun002,
343                Function | MediumTest | Level1)
344 {
345   const char *value = GetOSFullName();
346   printf("Os Name=%s\n", value);
347   TEST_ASSERT_NOT_NULL(value);
348   if (value != NULL)
349   {
350     TEST_ASSERT_TRUE(strlen(value) <= 64);
351   }
352 };
353 
354 /**
355  * @tc.name      : testGetDisplayVersionFun001
356  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_1900
357  * @tc.desc      : test obtaining device info DisplayVersion is not null.
358  */
359 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
360                testGetDisplayVersionFun001,
361                Function | MediumTest | Level1)
362 {
363   const char *value = GetDisplayVersion();
364   printf("Display Version=%s\n", value);
365   AssertNotEmpty(value);
366 };
367 
368 /**
369  * @tc.name      : testGetDisplayVersionFun002
370  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_2000
371  * @tc.desc      : test obtaining device info DisplayVersion that less than 64
372  * characters.
373  */
374 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
375                testGetDisplayVersionFun002,
376                Function | MediumTest | Level1)
377 {
378   const char *value = GetDisplayVersion();
379   printf("Display Version=%s\n", value);
380   TEST_ASSERT_NOT_NULL(value);
381   if (value != NULL)
382   {
383     TEST_ASSERT_TRUE(strlen(value) <= 64);
384   }
385 };
386 
387 /**
388  * @tc.name      : testGetBootloaderVersionFun001
389  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_2100
390  * @tc.desc      : test obtaining device info BootloaderVersion is not null.
391  */
392 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
393                testGetBootloaderVersionFun001,
394                Function | MediumTest | Level1)
395 {
396   const char *value = GetBootloaderVersion();
397   printf("Bootloader Version=%s\n", value);
398   AssertNotEmpty(value);
399 };
400 
401 /**
402  * @tc.name      : testGetBootloaderVersionFun002
403  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_2200
404  * @tc.desc      : test obtaining device info BootloaderVersion that less
405  * than 64 characters.
406  */
407 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
408                testGetBootloaderVersionFun002,
409                Function | MediumTest | Level1)
410 {
411   const char *value = GetBootloaderVersion();
412   printf("Bootloader Version=%s\n", value);
413   TEST_ASSERT_NOT_NULL(value);
414   if (value != NULL)
415   {
416     TEST_ASSERT_TRUE(strlen(value) <= 64);
417   }
418 };
419 
420 /**
421  * @tc.name      : testGetSecurityPatchTagFun001
422  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_2300
423  * @tc.desc      : test obtaining device info SecurityPatchTag is not null.
424  */
425 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
426                testGetSecurityPatchTagFun001,
427                Function | MediumTest | Level1)
428 {
429   const char *value = GetSecurityPatchTag();
430   printf("Secure Patch Level=%s\n", value);
431   AssertNotEmpty(value);
432 };
433 
434 /**
435  * @tc.name      : testGetSecurityPatchTagFun002
436  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_2400
437  * @tc.desc      : test obtaining device info SecurityPatchTag that less
438  * than 64 characters.
439  */
440 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
441                testGetSecurityPatchTagFun002,
442                Function | MediumTest | Level1)
443 {
444   const char *value = GetSecurityPatchTag();
445   printf("Secure Patch Level=%s\n", value);
446   TEST_ASSERT_NOT_NULL(value);
447   if (value != NULL)
448   {
449     TEST_ASSERT_TRUE(strlen(value) <= 64);
450   }
451 };
452 
453 /**
454  * @tc.name      : testGetSecurityPatchTagFun003
455  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_2500
456  * @tc.desc      : test obtaining device info SecurityPatchTag which format is
457  * yy-mm-dd
458  */
459 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
460                testGetSecurityPatchTagFun003,
461                Function | MediumTest | Level1)
462 {
463   const char *value = GetSecurityPatchTag();
464   printf("Secure Patch Level=%s\n", value);
465 
466   int year, month, day;
467   const int RET_SUCCESS = 0;
468   int ret = sscanf_s(value, "%04d\/%02d\/%02d", &year, &month, &day);
469   if (ret < RET_SUCCESS)
470   {
471     TEST_ASSERT_TRUE(ret >= 0);
472   }
473   printf("%04d\/%02d\/%02d\n", year, month, day);
474 
475   TEST_ASSERT_TRUE(year > 1900 && year < 2056);
476   TEST_ASSERT_TRUE(month <= 12 && month > 0);
477   TEST_ASSERT_TRUE(day <= 31 && day > 0);
478 
479   char str[10] = {0};
480   ret = sprintf_s(str, sizeof(str) + 1, "%d\/%02d\/%02d", year, month, day);
481   if (ret < RET_SUCCESS)
482   {
483     TEST_ASSERT_TRUE(ret >= 0);
484   }
485   printf("str=%s\n", str);
486   TEST_ASSERT_EQUAL_STRING(str, value);
487 };
488 
489 /**
490  * @tc.name      : testGetAbiListFun001
491  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_2600
492  * @tc.desc      : test obtaining device info AbiList is not null.
493  */
494 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
495                testGetAbiListFun001,
496                Function | MediumTest | Level1)
497 {
498   const char *value = GetAbiList();
499   printf("Abi List=%s\n", value);
500   AssertNotEmpty(value);
501 };
502 
503 /**
504  * @tc.name      : testGetAbiListFun002
505  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_2700
506  * @tc.desc      : test obtaining device info AbiList that less than 64
507  * characters.
508  */
509 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
510                testGetAbiListFun002,
511                Function | MediumTest | Level1)
512 {
513   const char *value = GetAbiList();
514   printf("Abi List=%s\n", value);
515   TEST_ASSERT_NOT_NULL(value);
516   if (value != NULL)
517   {
518     TEST_ASSERT_TRUE(strlen(value) <= 64);
519   }
520 };
521 
522 /**
523  * @tc.name      : testGetSdkApiVersionFun001
524  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_2800
525  * @tc.desc      : test obtaining device info SdkApiVersion is not null.
526  */
527 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
528                testGetSdkApiVersionFun001,
529                Function | MediumTest | Level1)
530 {
531   int value = GetSdkApiVersion();
532   printf("Sdk Api Level=%d\n", value);
533   TEST_ASSERT_TRUE(value > 0);
534 };
535 
536 /**
537  * @tc.name      : testGetFirstApiVersionFun001
538  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_2900
539  * @tc.desc      : test obtaining device info FirstApiVersion is not null.
540  */
541 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
542                testGetFirstApiVersionFun001,
543                Function | MediumTest | Level1)
544 {
545   int value = GetFirstApiVersion();
546   printf("First Api Level=%d\n", value);
547   TEST_ASSERT_TRUE(value > 0);
548 };
549 
550 /**
551  * @tc.name      : testGetIncrementalVersionFun001
552  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_3000
553  * @tc.desc      : test obtaining device info IncrementalVersion is not null.
554  */
555 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
556                testGetIncrementalVersionFun001,
557                Function | MediumTest | Level1)
558 {
559   const char *value = GetIncrementalVersion();
560   printf("Incremental Version=%s\n", value);
561   AssertNotEmpty(value);
562 };
563 
564 /**
565  * @tc.name      : testGetVersionIdFun001
566  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_3100
567  * @tc.desc      : test obtaining device info VersionId is not null.
568  */
569 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
570                testGetVersionIdFun001,
571                Function | MediumTest | Level1)
572 {
573   const char *value = GetVersionId();
574   printf("Version Id=%s\n", value);
575   AssertNotEmpty(value);
576 };
577 
578 /**
579  * @tc.name      : testGetVersionIdFun002
580  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_3200
581  * @tc.desc      : test obtaining device info VersionId that less than 127
582  * characters.
583  */
584 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
585                testGetVersionIdFun002,
586                Function | MediumTest | Level1)
587 {
588   const char *value = GetVersionId();
589   printf("Version Id=%s\n", value);
590   TEST_ASSERT_NOT_NULL(value);
591   if (value != NULL)
592   {
593     TEST_ASSERT_TRUE(strlen(value) <= 127);
594   }
595 };
596 
597 /**
598  * @tc.name      : testGetBuildTypeFun001
599  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_3300
600  * @tc.desc      : test obtaining device info BuildType is not null.
601  */
602 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
603                testGetBuildTypeFun001,
604                Function | MediumTest | Level1)
605 {
606   const char *value = GetBuildType();
607   printf("Build Type=%s\n", value);
608   AssertNotEmpty(value);
609 };
610 
611 /**
612  * @tc.name      : testGetBuildTypeFun002
613  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_3400
614  * @tc.desc      : test obtaining device info BuildType that less than 32
615  * characters.
616  */
617 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
618                testGetBuildTypeFun002,
619                Function | MediumTest | Level1)
620 {
621   const char *value = GetBuildType();
622   printf("Build Type=%s\n", value);
623   TEST_ASSERT_NOT_NULL(value);
624   if (value != NULL)
625   {
626     TEST_ASSERT_TRUE(strlen(value) <= 32);
627   }
628 };
629 
630 /**
631  * @tc.name      : testGetBuildUserFun001
632  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_3500
633  * @tc.desc      : test obtaining device info BuildUser is not null.
634  */
635 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
636                testGetBuildUserFun001,
637                Function | MediumTest | Level1)
638 {
639   const char *value = GetBuildUser();
640   printf("Build User=%s\n", value);
641   AssertNotEmpty(value);
642 };
643 
644 /**
645  * @tc.name      : testGetBuildUserFun002
646  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_3600
647  * @tc.desc      : test obtaining device info BuildUser that less than 32
648  * characters.
649  */
650 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
651                testGetBuildUserFun002,
652                Function | MediumTest | Level1)
653 {
654   const char *value = GetBuildUser();
655   printf("Build User=%s\n", value);
656   TEST_ASSERT_NOT_NULL(value);
657   if (value != NULL)
658   {
659     TEST_ASSERT_TRUE(strlen(value) <= 32);
660   }
661 };
662 
663 /**
664  * @tc.name      : testGetBuildHostFun001
665  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_3700
666  * @tc.desc      : test obtaining device info BuildHost is not null.
667  */
668 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
669                testGetBuildHostFun001,
670                Function | MediumTest | Level1)
671 {
672   const char *value = GetBuildHost();
673   printf("Build Host=%s\n", value);
674   AssertNotEmpty(value);
675 };
676 
677 /**
678  * @tc.name      : testGetBuildHostFun002
679  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_3800
680  * @tc.desc      : test obtaining device info BuildHost that less than 32
681  * characters.
682  */
683 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
684                testGetBuildHostFun002,
685                Function | MediumTest | Level1)
686 {
687   const char *value = GetBuildHost();
688   printf("Build Host=%s\n", value);
689   TEST_ASSERT_NOT_NULL(value);
690   if (value != NULL)
691   {
692     TEST_ASSERT_TRUE(strlen(value) <= 32);
693   }
694 };
695 
696 /**
697  * @tc.name      : testGetBuildTimeFun001
698  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_3900
699  * @tc.desc      : test obtaining device info BuildTime is not null.
700  */
701 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
702                testGetBuildTimeFun001,
703                Function | MediumTest | Level1)
704 {
705   const char *value = GetBuildTime();
706   printf("Build Time=%s\n", value);
707   AssertNotEmpty(value);
708 };
709 
710 /**
711  * @tc.name      : testGetBuildTimeFun002
712  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_4000
713  * @tc.desc      : test obtaining device info BuildTime that less than 32
714  * characters.
715  */
716 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
717                testGetBuildTimeFun002,
718                Function | MediumTest | Level1)
719 {
720   const char *value = GetBuildTime();
721   printf("Build Time=%s\n", value);
722   TEST_ASSERT_NOT_NULL(value);
723   if (value != NULL)
724   {
725     TEST_ASSERT_TRUE(strlen(value) <= 32);
726   }
727 };
728 
729 /**
730  * @tc.name      : testGetSoftwareModelFun001
731  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_4100
732  * @tc.desc      : test obtaining device info SoftwareModel is not null.
733  */
734 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
735                testGetSoftwareModelFun001,
736                Function | MediumTest | Level1)
737 {
738   const char *value = GetSoftwareModel();
739   printf("Software Model=%s\n", value);
740   AssertNotEmpty(value);
741 };
742 
743 /**
744  * @tc.name      : testGetSoftwareModelFun002
745  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_4200
746  * @tc.desc      : test obtaining device info SoftwareModel that less than 32
747  * characters.
748  */
749 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
750                testGetSoftwareModelFun002,
751                Function | MediumTest | Level1)
752 {
753   const char *value = GetSoftwareModel();
754   printf("Software Model=%s\n", value);
755   TEST_ASSERT_NOT_NULL(value);
756   if (value != NULL)
757   {
758     TEST_ASSERT_TRUE(strlen(value) <= 32);
759   }
760 };
761 
762 /**
763  * @tc.name      : testGetBuildRootHashFun001
764  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_4500
765  * @tc.desc      : test obtaining device info BuildRootHash is not null.
766  */
767 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
768                testGetBuildRootHashFun001,
769                Function | MediumTest | Level1)
770 {
771   const char *value = GetBuildRootHash();
772   printf("Build Root Hash=%s\n", value);
773   TEST_ASSERT_NOT_NULL(value);
774 };
775 
776 /**
777  * @tc.name      : testGetHardwareProfileFun001
778  * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_4600
779  * @tc.desc      : test obtaining device info HardwareProfile is not null.
780  */
781 LITE_TEST_CASE(DeviceInfoFuncTestSuite,
782                testGetHardwareProfileFun001,
783                Function | MediumTest | Level1)
784 {
785   const char *value = GetHardwareProfile();
786   printf("Hardware Profile=%s\n", value);
787   AssertNotEmpty(value);
788 };
789 
790 RUN_TEST_SUITE(DeviceInfoFuncTestSuite);
791