deviceinfo_func_test.c 22.0 KB
Newer Older
L
leiyuqian 已提交
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
/*
 * Copyright (c) 2020-2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <securec.h>
#include "hctest.h"
#include "ohos_types.h"
#include "parameter.h"
#include "parameter_utils.h"

#define MAX_LEN 128
#define INVALID_LEN 2
#define COMMON_ERROR (-1)
#define INVALID_PARAMETER (-9)

27
static const char *g_defSysParam = "data of sys param ***...";
L
leiyuqian 已提交
28 29 30 31 32 33 34 35 36 37 38 39 40 41

/**
 * @tc.desc      : register a test suite, this suite is used to test basic flow
 * and interface dependency
 * @param        : subsystem name is utils
 * @param        : module name is parameter
 * @param        : test suit name is DeviceInfoFuncTestSuite
 */
LITE_TEST_SUIT(startup, deviceinfo, DeviceInfoFuncTestSuite);

/**
 * @tc.setup     : setup for all testcases
 * @return       : setup result, TRUE is success, FALSE is fail
 */
42
static BOOL DeviceInfoFuncTestSuiteSetUp(void)
43
{
44
  return TRUE;
L
leiyuqian 已提交
45 46 47 48 49 50
}

/**
 * @tc.teardown  : teardown for all testcases
 * @return       : teardown result, TRUE is success, FALSE is fail
 */
51
static BOOL DeviceInfoFuncTestSuiteTearDown(void)
52
{
53 54
  printf("+--------------------------------------------+\n");
  return TRUE;
L
leiyuqian 已提交
55 56 57 58 59 60 61 62 63
}

/**
 * @tc.name      : testGetDeviceTypeFun001
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_0100
 * @tc.desc      : test obtaining device info DeviceType is not null.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetDeviceTypeFun001,
64 65 66 67 68
               Function | MediumTest | Level1)
{
  const char *value = GetDeviceType();
  printf("Device Type=%s\n", value);
  AssertNotEmpty(value);
L
leiyuqian 已提交
69 70 71 72 73 74 75 76 77 78
};

/**
 * @tc.name      : testGetDeviceTypeFun002
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_0200
 * @tc.desc      : test obtaining device info DeviceType that less than 32
 * characters.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetDeviceTypeFun002,
79 80 81 82 83 84 85 86 87
               Function | MediumTest | Level1)
{
  const char *value = GetDeviceType();
  printf("Device Type=%s\n", value);
  TEST_ASSERT_NOT_NULL(value);
  if (value != NULL)
  {
    TEST_ASSERT_TRUE(strlen(value) <= 32);
  }
L
leiyuqian 已提交
88 89 90 91 92 93 94 95 96
};

/**
 * @tc.name      : testGetManufactureFun001
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_0300
 * @tc.desc      : test obtaining device info Manufacture is not null.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetManufactureFun001,
97 98 99 100 101
               Function | MediumTest | Level1)
{
  const char *value = GetManufacture();
  printf("Manufacture=%s\n", value);
  AssertNotEmpty(value);
L
leiyuqian 已提交
102 103 104 105 106 107 108 109 110 111
};

/**
 * @tc.name      : testGetManufactureFun002
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_0400
 * @tc.desc      : test obtaining device info Manufacture that less than 32
 * characters.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetManufactureFun002,
112 113 114 115 116 117 118 119 120
               Function | MediumTest | Level1)
{
  const char *value = GetManufacture();
  printf("Manufacture=%s\n", value);
  TEST_ASSERT_NOT_NULL(value);
  if (value != NULL)
  {
    TEST_ASSERT_TRUE(strlen(value) <= 32);
  }
L
leiyuqian 已提交
121 122 123 124 125 126 127 128 129
};

/**
 * @tc.name      : testGetBrandFun001
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_0500
 * @tc.desc      : test obtaining device info Brand is not null.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetBrandFun001,
130 131 132 133 134
               Function | MediumTest | Level1)
{
  const char *value = GetBrand();
  printf("Brand=%s\n", value);
  AssertNotEmpty(value);
L
leiyuqian 已提交
135 136 137 138 139 140 141 142 143 144
};

/**
 * @tc.name      : testGetBrandFun002
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_0600
 * @tc.desc      : test obtaining device info Brand that less than 32
 * characters.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetBrandFun002,
145 146 147 148 149 150 151 152 153
               Function | MediumTest | Level1)
{
  const char *value = GetBrand();
  printf("Brand=%s\n", value);
  TEST_ASSERT_NOT_NULL(value);
  if (value != NULL)
  {
    TEST_ASSERT_TRUE(strlen(value) <= 32);
  }
L
leiyuqian 已提交
154 155 156 157 158 159 160 161 162
};

/**
 * @tc.name      : testGetMarketNameFun001
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_0700
 * @tc.desc      : test obtaining device info MarketName is not null.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetMarketNameFun001,
163 164 165 166 167
               Function | MediumTest | Level1)
{
  const char *value = GetMarketName();
  printf("Market Name=%s\n", value);
  AssertNotEmpty(value);
L
leiyuqian 已提交
168 169 170 171 172 173 174 175 176 177
};

/**
 * @tc.name      : testGetMarketNameFun002
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_0800
 * @tc.desc      : test obtaining device info MarketName that less than 32
 * characters.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetMarketNameFun002,
178 179 180 181 182 183 184 185 186
               Function | MediumTest | Level1)
{
  const char *value = GetMarketName();
  printf("Market Name=%s\n", value);
  TEST_ASSERT_NOT_NULL(value);
  if (value != NULL)
  {
    TEST_ASSERT_TRUE(strlen(value) <= 32);
  }
L
leiyuqian 已提交
187 188 189 190 191 192 193 194 195
};

/**
 * @tc.name      : testGetProductSeriesFun001
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_0900
 * @tc.desc      : test obtaining device info ProductSeries is not null.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetProductSeriesFun001,
196 197 198 199 200
               Function | MediumTest | Level1)
{
  const char *value = GetProductSeries();
  printf("Product Series=%s\n", value);
  AssertNotEmpty(value);
L
leiyuqian 已提交
201 202 203 204 205 206 207 208 209 210
};

/**
 * @tc.name      : testGetProductSeriesFun002
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_1000
 * @tc.desc      : test obtaining device info ProductSeries that less than 32
 * characters.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetProductSeriesFun002,
211 212 213 214 215 216 217 218 219
               Function | MediumTest | Level1)
{
  const char *value = GetProductSeries();
  printf("Product Series=%s\n", value);
  TEST_ASSERT_NOT_NULL(value);
  if (value != NULL)
  {
    TEST_ASSERT_TRUE(strlen(value) <= 32);
  }
L
leiyuqian 已提交
220 221 222 223 224 225 226 227 228
};

/**
 * @tc.name      : testGetProductModelFun001
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_1100
 * @tc.desc      : test obtaining device info ProductModel is not null.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetProductModelFun001,
229 230 231 232 233
               Function | MediumTest | Level1)
{
  const char *value = GetProductModel();
  printf("Product Model=%s\n", value);
  AssertNotEmpty(value);
L
leiyuqian 已提交
234 235 236 237 238 239 240 241 242 243
};

/**
 * @tc.name      : testGetProductModelFun002
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_1200
 * @tc.desc      : test obtaining device info ProductModel that less than 32
 * characters.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetProductModelFun002,
244 245 246 247 248 249 250 251 252
               Function | MediumTest | Level1)
{
  const char *value = GetProductModel();
  printf("Product Model=%s\n", value);
  TEST_ASSERT_NOT_NULL(value);
  if (value != NULL)
  {
    TEST_ASSERT_TRUE(strlen(value) <= 32);
  }
L
leiyuqian 已提交
253 254 255 256 257 258 259 260 261
};

/**
 * @tc.name      : testGetHardwareModel001
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_1300
 * @tc.desc      : test obtaining device info HardwareModel is not null.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetHardwareModel001,
262 263 264 265 266
               Function | MediumTest | Level1)
{
  const char *value = GetHardwareModel();
  printf("Hardware Model=%s\n", value);
  AssertNotEmpty(value);
L
leiyuqian 已提交
267 268 269 270 271 272 273 274 275 276
};

/**
 * @tc.name      : testGetHardwareModel002
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_1400
 * @tc.desc      : test obtaining device info HardwareModel that less than 32
 * characters.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetHardwareModel002,
277 278 279 280 281 282 283 284 285
               Function | MediumTest | Level1)
{
  const char *value = GetHardwareModel();
  printf("Hardware Model=%s\n", value);
  TEST_ASSERT_NOT_NULL(value);
  if (value != NULL)
  {
    TEST_ASSERT_TRUE(strlen(value) <= 32);
  }
L
leiyuqian 已提交
286 287 288 289 290 291 292 293 294
};

/**
 * @tc.name      : testGetSerialFun001
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_1500
 * @tc.desc      : test obtaining device info Serial is not null.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetSerialFun001,
295 296 297 298 299
               Function | MediumTest | Level1)
{
  const char *value = GetSerial();
  printf("Serial=%s\n", value);
  AssertNotEmpty(value);
L
leiyuqian 已提交
300 301 302 303 304 305 306 307 308 309
};

/**
 * @tc.name      : testGetSerialFun002
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_1600
 * @tc.desc      : test obtaining device info Serial that less than 64
 * characters.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetSerialFun002,
310 311 312 313 314 315 316 317 318
               Function | MediumTest | Level1)
{
  const char *value = GetSerial();
  printf("Serial=%s\n", value);
  TEST_ASSERT_NOT_NULL(value);
  if (value != NULL)
  {
    TEST_ASSERT_TRUE(strlen(value) <= 64);
  }
L
leiyuqian 已提交
319 320 321 322 323 324 325 326 327
};

/**
 * @tc.name      : testGetOSFullNameFun001
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_1700
 * @tc.desc      : test obtaining device info OSFullName is not null.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetOSFullNameFun001,
328 329 330 331 332
               Function | MediumTest | Level1)
{
  const char *value = GetOSFullName();
  printf("Os Name=%s\n", value);
  AssertNotEmpty(value);
L
leiyuqian 已提交
333 334 335 336 337 338 339 340 341 342
};

/**
 * @tc.name      : testGetOSFullNameFun002
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_1800
 * @tc.desc      : test obtaining device info OSFullName that less than 64
 * characters.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetOSFullNameFun002,
343 344 345 346 347 348 349 350 351
               Function | MediumTest | Level1)
{
  const char *value = GetOSFullName();
  printf("Os Name=%s\n", value);
  TEST_ASSERT_NOT_NULL(value);
  if (value != NULL)
  {
    TEST_ASSERT_TRUE(strlen(value) <= 64);
  }
L
leiyuqian 已提交
352 353 354 355 356 357 358 359 360
};

/**
 * @tc.name      : testGetDisplayVersionFun001
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_1900
 * @tc.desc      : test obtaining device info DisplayVersion is not null.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetDisplayVersionFun001,
361 362 363 364 365
               Function | MediumTest | Level1)
{
  const char *value = GetDisplayVersion();
  printf("Display Version=%s\n", value);
  AssertNotEmpty(value);
L
leiyuqian 已提交
366 367 368 369 370 371 372 373 374 375
};

/**
 * @tc.name      : testGetDisplayVersionFun002
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_2000
 * @tc.desc      : test obtaining device info DisplayVersion that less than 64
 * characters.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetDisplayVersionFun002,
376 377 378 379 380 381 382 383 384
               Function | MediumTest | Level1)
{
  const char *value = GetDisplayVersion();
  printf("Display Version=%s\n", value);
  TEST_ASSERT_NOT_NULL(value);
  if (value != NULL)
  {
    TEST_ASSERT_TRUE(strlen(value) <= 64);
  }
L
leiyuqian 已提交
385 386 387 388 389 390 391 392 393
};

/**
 * @tc.name      : testGetBootloaderVersionFun001
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_2100
 * @tc.desc      : test obtaining device info BootloaderVersion is not null.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetBootloaderVersionFun001,
394 395 396 397 398
               Function | MediumTest | Level1)
{
  const char *value = GetBootloaderVersion();
  printf("Bootloader Version=%s\n", value);
  AssertNotEmpty(value);
L
leiyuqian 已提交
399 400 401 402 403 404 405 406 407 408
};

/**
 * @tc.name      : testGetBootloaderVersionFun002
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_2200
 * @tc.desc      : test obtaining device info BootloaderVersion that less
 * than 64 characters.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetBootloaderVersionFun002,
409 410 411 412 413 414 415 416 417
               Function | MediumTest | Level1)
{
  const char *value = GetBootloaderVersion();
  printf("Bootloader Version=%s\n", value);
  TEST_ASSERT_NOT_NULL(value);
  if (value != NULL)
  {
    TEST_ASSERT_TRUE(strlen(value) <= 64);
  }
L
leiyuqian 已提交
418 419 420 421 422 423 424 425 426
};

/**
 * @tc.name      : testGetSecurityPatchTagFun001
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_2300
 * @tc.desc      : test obtaining device info SecurityPatchTag is not null.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetSecurityPatchTagFun001,
427 428 429 430 431
               Function | MediumTest | Level1)
{
  const char *value = GetSecurityPatchTag();
  printf("Secure Patch Level=%s\n", value);
  AssertNotEmpty(value);
L
leiyuqian 已提交
432 433 434 435 436 437 438 439 440 441
};

/**
 * @tc.name      : testGetSecurityPatchTagFun002
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_2400
 * @tc.desc      : test obtaining device info SecurityPatchTag that less
 * than 64 characters.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetSecurityPatchTagFun002,
442 443 444 445 446 447 448 449 450
               Function | MediumTest | Level1)
{
  const char *value = GetSecurityPatchTag();
  printf("Secure Patch Level=%s\n", value);
  TEST_ASSERT_NOT_NULL(value);
  if (value != NULL)
  {
    TEST_ASSERT_TRUE(strlen(value) <= 64);
  }
L
leiyuqian 已提交
451 452 453 454 455 456 457 458 459 460
};

/**
 * @tc.name      : testGetSecurityPatchTagFun003
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_2500
 * @tc.desc      : test obtaining device info SecurityPatchTag which format is
 * yy-mm-dd
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetSecurityPatchTagFun003,
461 462 463 464
               Function | MediumTest | Level1)
{
  const char *value = GetSecurityPatchTag();
  printf("Secure Patch Level=%s\n", value);
L
leiyuqian 已提交
465

466 467 468 469 470 471 472 473
  int year, month, day;
  const int RET_SUCCESS = 0;
  int ret = sscanf_s(value, "%04d-%02d-%02d", &year, &month, &day);
  if (ret < RET_SUCCESS)
  {
    TEST_ASSERT_TRUE(ret >= 0);
  }
  printf("%04d-%02d-%02d\n", year, month, day);
L
leiyuqian 已提交
474

475 476 477
  TEST_ASSERT_TRUE(year > 1900 && year < 2056);
  TEST_ASSERT_TRUE(month <= 12 && month > 0);
  TEST_ASSERT_TRUE(day <= 31 && day > 0);
L
leiyuqian 已提交
478

479
  char str[10] = {0};
N
nan-xiansen 已提交
480
  ret = sprintf_s(str, sizeof(str) + 1, "%d-%02d-%02d", year, month, day);
481 482 483 484 485 486
  if (ret < RET_SUCCESS)
  {
    TEST_ASSERT_TRUE(ret >= 0);
  }
  printf("str=%s\n", str);
  TEST_ASSERT_EQUAL_STRING(str, value);
L
leiyuqian 已提交
487 488 489 490 491 492 493 494 495
};

/**
 * @tc.name      : testGetAbiListFun001
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_2600
 * @tc.desc      : test obtaining device info AbiList is not null.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetAbiListFun001,
496 497 498 499 500
               Function | MediumTest | Level1)
{
  const char *value = GetAbiList();
  printf("Abi List=%s\n", value);
  AssertNotEmpty(value);
L
leiyuqian 已提交
501 502 503 504 505 506 507 508 509 510
};

/**
 * @tc.name      : testGetAbiListFun002
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_2700
 * @tc.desc      : test obtaining device info AbiList that less than 64
 * characters.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetAbiListFun002,
511 512 513 514 515 516 517 518 519
               Function | MediumTest | Level1)
{
  const char *value = GetAbiList();
  printf("Abi List=%s\n", value);
  TEST_ASSERT_NOT_NULL(value);
  if (value != NULL)
  {
    TEST_ASSERT_TRUE(strlen(value) <= 64);
  }
L
leiyuqian 已提交
520 521 522 523 524 525 526 527 528
};

/**
 * @tc.name      : testGetSdkApiVersionFun001
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_2800
 * @tc.desc      : test obtaining device info SdkApiVersion is not null.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetSdkApiVersionFun001,
529 530 531 532 533
               Function | MediumTest | Level1)
{
  int value = GetSdkApiVersion();
  printf("Sdk Api Level=%d\n", value);
  TEST_ASSERT_TRUE(value > 0);
L
leiyuqian 已提交
534 535 536 537 538 539 540 541 542
};

/**
 * @tc.name      : testGetFirstApiVersionFun001
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_2900
 * @tc.desc      : test obtaining device info FirstApiVersion is not null.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetFirstApiVersionFun001,
543 544 545 546 547
               Function | MediumTest | Level1)
{
  int value = GetFirstApiVersion();
  printf("First Api Level=%d\n", value);
  TEST_ASSERT_TRUE(value > 0);
L
leiyuqian 已提交
548 549 550 551 552 553 554 555 556
};

/**
 * @tc.name      : testGetIncrementalVersionFun001
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_3000
 * @tc.desc      : test obtaining device info IncrementalVersion is not null.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetIncrementalVersionFun001,
557 558 559 560 561
               Function | MediumTest | Level1)
{
  const char *value = GetIncrementalVersion();
  printf("Incremental Version=%s\n", value);
  AssertNotEmpty(value);
L
leiyuqian 已提交
562 563 564 565 566 567 568 569 570
};

/**
 * @tc.name      : testGetVersionIdFun001
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_3100
 * @tc.desc      : test obtaining device info VersionId is not null.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetVersionIdFun001,
571 572 573 574 575
               Function | MediumTest | Level1)
{
  const char *value = GetVersionId();
  printf("Version Id=%s\n", value);
  AssertNotEmpty(value);
L
leiyuqian 已提交
576 577 578 579 580 581 582 583 584 585
};

/**
 * @tc.name      : testGetVersionIdFun002
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_3200
 * @tc.desc      : test obtaining device info VersionId that less than 127
 * characters.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetVersionIdFun002,
586 587 588 589 590 591 592 593 594
               Function | MediumTest | Level1)
{
  const char *value = GetVersionId();
  printf("Version Id=%s\n", value);
  TEST_ASSERT_NOT_NULL(value);
  if (value != NULL)
  {
    TEST_ASSERT_TRUE(strlen(value) <= 127);
  }
L
leiyuqian 已提交
595 596 597 598 599 600 601 602 603
};

/**
 * @tc.name      : testGetBuildTypeFun001
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_3300
 * @tc.desc      : test obtaining device info BuildType is not null.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetBuildTypeFun001,
604 605 606 607 608
               Function | MediumTest | Level1)
{
  const char *value = GetBuildType();
  printf("Build Type=%s\n", value);
  AssertNotEmpty(value);
L
leiyuqian 已提交
609 610 611 612 613 614 615 616 617 618
};

/**
 * @tc.name      : testGetBuildTypeFun002
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_3400
 * @tc.desc      : test obtaining device info BuildType that less than 32
 * characters.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetBuildTypeFun002,
619 620 621 622 623 624 625 626 627
               Function | MediumTest | Level1)
{
  const char *value = GetBuildType();
  printf("Build Type=%s\n", value);
  TEST_ASSERT_NOT_NULL(value);
  if (value != NULL)
  {
    TEST_ASSERT_TRUE(strlen(value) <= 32);
  }
L
leiyuqian 已提交
628 629 630 631 632 633 634 635 636
};

/**
 * @tc.name      : testGetBuildUserFun001
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_3500
 * @tc.desc      : test obtaining device info BuildUser is not null.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetBuildUserFun001,
637 638 639 640 641
               Function | MediumTest | Level1)
{
  const char *value = GetBuildUser();
  printf("Build User=%s\n", value);
  AssertNotEmpty(value);
L
leiyuqian 已提交
642 643 644 645 646 647 648 649 650 651
};

/**
 * @tc.name      : testGetBuildUserFun002
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_3600
 * @tc.desc      : test obtaining device info BuildUser that less than 32
 * characters.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetBuildUserFun002,
652 653 654 655 656 657 658 659 660
               Function | MediumTest | Level1)
{
  const char *value = GetBuildUser();
  printf("Build User=%s\n", value);
  TEST_ASSERT_NOT_NULL(value);
  if (value != NULL)
  {
    TEST_ASSERT_TRUE(strlen(value) <= 32);
  }
L
leiyuqian 已提交
661 662 663 664 665 666 667 668 669
};

/**
 * @tc.name      : testGetBuildHostFun001
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_3700
 * @tc.desc      : test obtaining device info BuildHost is not null.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetBuildHostFun001,
670 671 672 673 674
               Function | MediumTest | Level1)
{
  const char *value = GetBuildHost();
  printf("Build Host=%s\n", value);
  AssertNotEmpty(value);
L
leiyuqian 已提交
675 676 677 678 679 680 681 682 683 684
};

/**
 * @tc.name      : testGetBuildHostFun002
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_3800
 * @tc.desc      : test obtaining device info BuildHost that less than 32
 * characters.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetBuildHostFun002,
685 686 687 688 689 690 691 692 693
               Function | MediumTest | Level1)
{
  const char *value = GetBuildHost();
  printf("Build Host=%s\n", value);
  TEST_ASSERT_NOT_NULL(value);
  if (value != NULL)
  {
    TEST_ASSERT_TRUE(strlen(value) <= 32);
  }
L
leiyuqian 已提交
694 695 696 697 698 699 700 701 702
};

/**
 * @tc.name      : testGetBuildTimeFun001
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_3900
 * @tc.desc      : test obtaining device info BuildTime is not null.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetBuildTimeFun001,
703 704 705 706 707
               Function | MediumTest | Level1)
{
  const char *value = GetBuildTime();
  printf("Build Time=%s\n", value);
  AssertNotEmpty(value);
L
leiyuqian 已提交
708 709 710 711 712 713 714 715 716 717
};

/**
 * @tc.name      : testGetBuildTimeFun002
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_4000
 * @tc.desc      : test obtaining device info BuildTime that less than 32
 * characters.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetBuildTimeFun002,
718 719 720 721 722 723 724 725 726
               Function | MediumTest | Level1)
{
  const char *value = GetBuildTime();
  printf("Build Time=%s\n", value);
  TEST_ASSERT_NOT_NULL(value);
  if (value != NULL)
  {
    TEST_ASSERT_TRUE(strlen(value) <= 32);
  }
L
leiyuqian 已提交
727 728 729 730 731 732 733 734 735
};

/**
 * @tc.name      : testGetSoftwareModelFun001
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_4100
 * @tc.desc      : test obtaining device info SoftwareModel is not null.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetSoftwareModelFun001,
736 737 738 739 740
               Function | MediumTest | Level1)
{
  const char *value = GetSoftwareModel();
  printf("Software Model=%s\n", value);
  AssertNotEmpty(value);
L
leiyuqian 已提交
741 742 743 744 745 746 747 748 749 750
};

/**
 * @tc.name      : testGetSoftwareModelFun002
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_4200
 * @tc.desc      : test obtaining device info SoftwareModel that less than 32
 * characters.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetSoftwareModelFun002,
751 752 753 754 755 756 757 758 759
               Function | MediumTest | Level1)
{
  const char *value = GetSoftwareModel();
  printf("Software Model=%s\n", value);
  TEST_ASSERT_NOT_NULL(value);
  if (value != NULL)
  {
    TEST_ASSERT_TRUE(strlen(value) <= 32);
  }
L
leiyuqian 已提交
760 761 762 763 764 765 766 767 768
};

/**
 * @tc.name      : testGetBuildRootHashFun001
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_4500
 * @tc.desc      : test obtaining device info BuildRootHash is not null.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetBuildRootHashFun001,
769 770 771 772 773
               Function | MediumTest | Level1)
{
  const char *value = GetBuildRootHash();
  printf("Build Root Hash=%s\n", value);
  TEST_ASSERT_NOT_NULL(value);
L
leiyuqian 已提交
774 775 776 777 778 779 780 781 782
};

/**
 * @tc.name      : testGetHardwareProfileFun001
 * @tc.number    : SUB_STARTUP_MINI_DEVICEINFO_FUN_4600
 * @tc.desc      : test obtaining device info HardwareProfile is not null.
 */
LITE_TEST_CASE(DeviceInfoFuncTestSuite,
               testGetHardwareProfileFun001,
783 784 785 786 787
               Function | MediumTest | Level1)
{
  const char *value = GetHardwareProfile();
  printf("Hardware Profile=%s\n", value);
  AssertNotEmpty(value);
L
leiyuqian 已提交
788 789 790
};

RUN_TEST_SUITE(DeviceInfoFuncTestSuite);