parameter_func_test.c 29.3 KB
Newer Older
W
wenjun 已提交
1
/*
M
mamingshuai 已提交
2
 * Copyright (c) 2020-2021 Huawei Device Co., Ltd.
W
wenjun 已提交
3 4 5 6 7 8 9 10 11 12 13 14 15
 * 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.
 */

M
mamingshuai 已提交
16
#include "ohos_types.h"
W
wenjun 已提交
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
#include <securec.h>
#include "hctest.h"
#include "parameter.h"
#include "parameter_utils.h"

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

static const char* g_defSysParam = "data of sys param ***...";

/**
 * @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 ParameterFuncTestSuite
 */
LITE_TEST_SUIT(utils, parameter, ParameterFuncTestSuite);

/**
 * @tc.setup     : setup for all testcases
 * @return       : setup result, TRUE is success, FALSE is fail
 */
static BOOL ParameterFuncTestSuiteSetUp(void)
{
    return TRUE;
}

/**
 * @tc.teardown  : teardown for all testcases
 * @return       : teardown result, TRUE is success, FALSE is fail
 */
static BOOL ParameterFuncTestSuiteTearDown(void)
{
    printf("+-------------------------------------------+\n");
    return TRUE;
}

/**
M
mamingshuai 已提交
57 58
 * @tc.number    : SUB_UTILS_PARAMETER_0100
 * @tc.name      : Obtaining system parameter ProductType
W
wenjun 已提交
59 60
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
61
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara001, Function | MediumTest | Level1)
W
wenjun 已提交
62 63 64 65 66 67 68 69
{
    char* value = GetProductType();
    printf("Product Type=%s\n", value);
    IsEmpty(value);
    free(value);
};

/**
M
mamingshuai 已提交
70 71
 * @tc.number    : SUB_UTILS_PARAMETER_0200
 * @tc.name      : Obtaining system parameter Manufacture
W
wenjun 已提交
72 73
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
74
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara002, Function | MediumTest | Level1)
W
wenjun 已提交
75 76 77 78 79 80 81 82
{
    char* value = GetManufacture();
    printf("Manufacture=%s\n", value);
    IsEmpty(value);
    free(value);
};

/**
M
mamingshuai 已提交
83 84
 * @tc.number    : SUB_UTILS_PARAMETER_0300
 * @tc.name      : Obtaining system parameter Brand
W
wenjun 已提交
85 86
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
87
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara003, Function | MediumTest | Level1)
W
wenjun 已提交
88 89 90 91 92 93 94 95
{
    char* value = GetBrand();
    printf("Brand=%s\n", value);
    IsEmpty(value);
    free(value);
};

/**
M
mamingshuai 已提交
96 97
 * @tc.number    : SUB_UTILS_PARAMETER_0400
 * @tc.name      : Obtaining system parameter MarketName
W
wenjun 已提交
98 99
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
100
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara004, Function | MediumTest | Level1)
W
wenjun 已提交
101 102 103 104 105 106 107 108
{
    char* value = GetMarketName();
    printf("Market Name=%s\n", value);
    IsEmpty(value);
    free(value);
};

/**
M
mamingshuai 已提交
109 110
 * @tc.number    : SUB_UTILS_PARAMETER_0500
 * @tc.name      : Obtaining system parameter ProductSeries
W
wenjun 已提交
111 112
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
113
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara005, Function | MediumTest | Level1)
W
wenjun 已提交
114 115 116 117 118 119 120 121
{
    char* value = GetProductSeries();
    printf("Product Series=%s\n", value);
    IsEmpty(value);
    free(value);
};

/**
M
mamingshuai 已提交
122 123
 * @tc.number    : SUB_UTILS_PARAMETER_0600
 * @tc.name      : Obtaining system parameter ProductModel
W
wenjun 已提交
124 125
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
126
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara006, Function | MediumTest | Level1)
W
wenjun 已提交
127 128 129 130 131 132 133 134
{
    char* value = GetProductModel();
    printf("Product Model=%s\n", value);
    IsEmpty(value);
    free(value);
};

/**
M
mamingshuai 已提交
135 136
 * @tc.number    : SUB_UTILS_PARAMETER_0700
 * @tc.name      : Obtaining system parameter HardwareModel
W
wenjun 已提交
137 138
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
139
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara007, Function | MediumTest | Level1)
W
wenjun 已提交
140 141 142 143 144 145 146 147
{
    char* value = GetHardwareModel();
    printf("Hardware Model=%s\n", value);
    IsEmpty(value);
    free(value);
};

/**
M
mamingshuai 已提交
148 149
 * @tc.number    : SUB_UTILS_PARAMETER_0800
 * @tc.name      : Obtaining system parameter HardwareProfile
W
wenjun 已提交
150 151
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
152
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara008, Function | MediumTest | Level1)
W
wenjun 已提交
153 154 155 156 157 158 159 160
{
    char* value = GetHardwareProfile();
    printf("Hardware Profile=%s\n", value);
    IsEmpty(value);
    free(value);
};

/**
M
mamingshuai 已提交
161 162
 * @tc.number    : SUB_UTILS_PARAMETER_0900
 * @tc.name      : Obtaining system parameter Serial
W
wenjun 已提交
163 164
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
165
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara009, Function | MediumTest | Level1)
W
wenjun 已提交
166 167 168 169 170 171 172 173 174 175 176 177 178
{
    char* value = GetSerial();
    printf("Serial=%s\n", value);
    if (value == NULL) {
        printf("The serial number needs to be written\n");
        TEST_IGNORE();
    } else {
        TEST_ASSERT_EQUAL_INT(1, 1);
    }
    free(value);
};

/**
M
mamingshuai 已提交
179 180
 * @tc.number    : SUB_UTILS_PARAMETER_1000
 * @tc.name      : Obtaining system parameter OsName
W
wenjun 已提交
181 182
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
183
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara010, Function | MediumTest | Level1)
W
wenjun 已提交
184 185 186 187 188 189 190 191
{
    char* value = GetOsName();
    printf("Os Name=%s\n", value);
    IsEmpty(value);
    free(value);
};

/**
M
mamingshuai 已提交
192 193
 * @tc.number    : SUB_UTILS_PARAMETER_1100
 * @tc.name      : Obtaining system parameter DisplayVersion
W
wenjun 已提交
194 195
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
196
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara011, Function | MediumTest | Level1)
W
wenjun 已提交
197 198 199 200 201 202 203 204
{
    char* value = GetDisplayVersion();
    printf("Display Version=%s\n", value);
    IsEmpty(value);
    free(value);
};

/**
M
mamingshuai 已提交
205 206
 * @tc.number    : SUB_UTILS_PARAMETER_1200
 * @tc.name      : Obtaining system parameter BootloaderVersion
W
wenjun 已提交
207 208
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
209
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara012, Function | MediumTest | Level1)
W
wenjun 已提交
210 211 212 213 214 215 216 217
{
    char* value = GetBootloaderVersion();
    printf("Bootloader Version=%s\n", value);
    IsEmpty(value);
    free(value);
};

/**
M
mamingshuai 已提交
218 219
 * @tc.number    : SUB_UTILS_PARAMETER_1300
 * @tc.name      : Obtaining system parameter SecurityPatchTag
W
wenjun 已提交
220 221
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
222
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara013, Function | MediumTest | Level1)
W
wenjun 已提交
223 224 225 226 227 228 229 230
{
    char* value = GetSecurityPatchTag();
    printf("Secure Patch Level=%s\n", value);
    IsEmpty(value);
    free(value);
};

/**
M
mamingshuai 已提交
231 232
 * @tc.number    : SUB_UTILS_PARAMETER_1400
 * @tc.name      : Obtaining system parameter AbiList
W
wenjun 已提交
233 234
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
235
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara014, Function | MediumTest | Level1)
W
wenjun 已提交
236 237 238 239 240 241 242 243
{
    char* value = GetAbiList();
    printf("Abi List=%s\n", value);
    IsEmpty(value);
    free(value);
};

/**
M
mamingshuai 已提交
244 245
 * @tc.number    : SUB_UTILS_PARAMETER_1500
 * @tc.name      : Obtaining system parameter FirstApiLevel
W
wenjun 已提交
246 247
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
248
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara015, Function | MediumTest | Level1)
W
wenjun 已提交
249 250 251 252 253 254 255 256
{
    char* value = GetFirstApiLevel();
    printf("First Api Level=%s\n", value);
    IsEmpty(value);
    free(value);
};

/**
M
mamingshuai 已提交
257 258
 * @tc.number    : SUB_UTILS_PARAMETER_1600
 * @tc.name      : Obtaining system parameter IncrementalVersion
W
wenjun 已提交
259 260
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
261
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara016, Function | MediumTest | Level1)
W
wenjun 已提交
262 263 264 265 266 267 268 269
{
    char* value = GetIncrementalVersion();
    printf("Incremental Version=%s\n", value);
    IsEmpty(value);
    free(value);
};

/**
M
mamingshuai 已提交
270 271
 * @tc.number    : SUB_UTILS_PARAMETER_1700
 * @tc.name      : Obtaining system parameter VersionId
W
wenjun 已提交
272 273
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
274
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara017, Function | MediumTest | Level1)
W
wenjun 已提交
275 276 277 278 279 280 281 282
{
    char* value = GetVersionId();
    printf("Version Id=%s\n", value);
    IsEmpty(value);
    free(value);
};

/**
M
mamingshuai 已提交
283 284
 * @tc.number    : SUB_UTILS_PARAMETER_1800
 * @tc.name      : Obtaining system parameter BuildType
W
wenjun 已提交
285 286
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
287
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara018, Function | MediumTest | Level1)
W
wenjun 已提交
288 289 290 291 292 293 294 295
{
    char* value = GetBuildType();
    printf("Build Type=%s\n", value);
    IsEmpty(value);
    free(value);
};

/**
M
mamingshuai 已提交
296 297
 * @tc.number    : SUB_UTILS_PARAMETER_1900
 * @tc.name      : Obtaining system parameter BuildUser
W
wenjun 已提交
298 299
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
300
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara019, Function | MediumTest | Level1)
W
wenjun 已提交
301 302 303 304 305 306 307 308
{
    char* value = GetBuildUser();
    printf("Build User=%s\n", value);
    IsEmpty(value);
    free(value);
};

/**
M
mamingshuai 已提交
309 310
 * @tc.number    : SUB_UTILS_PARAMETER_2000
 * @tc.name      : Obtaining system parameter BuildHost
W
wenjun 已提交
311 312
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
313
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara020, Function | MediumTest | Level1)
W
wenjun 已提交
314 315 316 317 318 319 320 321
{
    char* value = GetBuildHost();
    printf("Build Host=%s\n", value);
    IsEmpty(value);
    free(value);
};

/**
M
mamingshuai 已提交
322 323
 * @tc.number    : SUB_UTILS_PARAMETER_2100
 * @tc.name      : Obtaining system parameter BuildTime
W
wenjun 已提交
324 325
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
326
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara021, Function | MediumTest | Level1)
W
wenjun 已提交
327 328 329 330 331 332 333 334
{
    char* value = GetBuildTime();
    printf("Build Time=%s\n", value);
    IsEmpty(value);
    free(value);
};

/**
M
mamingshuai 已提交
335 336
 * @tc.number    : SUB_UTILS_PARAMETER_2200
 * @tc.name      : Obtaining system parameter BuildRootHash
W
wenjun 已提交
337 338
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
339
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara022, Function | MediumTest | Level1)
W
wenjun 已提交
340 341 342 343 344 345 346 347
{
    char* value = GetBuildRootHash();
    printf("Build Root Hash=%s\n", value);
    IsEmpty(value);
    free(value);
};

/**
M
mamingshuai 已提交
348 349
 * @tc.number    : SUB_UTILS_PARAMETER_2300
 * @tc.name      : Obtaining system parameter SoftwareModel
W
wenjun 已提交
350 351
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
352
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara023, Function | MediumTest | Level1)
W
wenjun 已提交
353 354 355 356 357 358 359 360
{
    char* value = GetSoftwareModel();
    printf("Software Model=%s\n", value);
    IsEmpty(value);
    free(value);
};

/**
M
mamingshuai 已提交
361 362
 * @tc.number    : SUB_UTILS_PARAMETER_2400
 * @tc.name      : Obtaining system parameter SdkApiLevel
W
wenjun 已提交
363 364
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
365
LITE_TEST_CASE(ParameterFuncTestSuite, testObtainSysPara024, Function | MediumTest | Level1)
W
wenjun 已提交
366 367 368 369 370 371 372 373
{
    char* value = GetSdkApiLevel();
    printf("Sdk Api Level=%s\n", value);
    IsEmpty(value);
    free(value);
};

/**
M
mamingshuai 已提交
374 375
 * @tc.number    : SUB_UTILS_PARAMETER_2500
 * @tc.name      : SetParameter parameter legal test
W
wenjun 已提交
376 377
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
378
LITE_TEST_CASE(ParameterFuncTestSuite, testSetParameter001, Function | MediumTest | Level1)
W
wenjun 已提交
379 380 381 382
{
    int ret;

    char key[] = "rw.sys.version_606";
M
mamingshuai 已提交
383
    char value[] = "OEM-10.1.0";
W
wenjun 已提交
384 385 386 387 388
    ret = SetParameter(key, value);
    TEST_ASSERT_EQUAL_INT(0, ret);
};

/**
M
mamingshuai 已提交
389 390
 * @tc.number    : SUB_UTILS_PARAMETER_2600
 * @tc.name      : SetParameter parameter legal test with Special characters
W
wenjun 已提交
391 392
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
393
LITE_TEST_CASE(ParameterFuncTestSuite, testSetParameter002, Function | MediumTest | Level1)
W
wenjun 已提交
394 395 396 397 398 399 400 401 402 403
{
    int ret;

    char key[] = "_._..__...___";
    char value[] = "!@#¥%……&*()——+~《》?,。、“‘;:、12345767890";
    ret = SetParameter(key, value);
    TEST_ASSERT_EQUAL_INT(0, ret);
};

/**
M
mamingshuai 已提交
404 405
 * @tc.number    : SUB_UTILS_PARAMETER_2700
 * @tc.name      : SetParameter parameter legal test using key with only lowercase
W
wenjun 已提交
406 407
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
408
LITE_TEST_CASE(ParameterFuncTestSuite, testSetParameter003, Function | MediumTest | Level1)
W
wenjun 已提交
409 410 411 412 413 414 415 416 417 418
{
    int ret;

    char key[] = "keywithonlylowercase";
    char value[] = "test key with only lowercase";
    ret = SetParameter(key, value);
    TEST_ASSERT_EQUAL_INT(0, ret);
};

/**
M
mamingshuai 已提交
419 420
 * @tc.number    : SUB_UTILS_PARAMETER_2800
 * @tc.name      : SetParameter parameter legal test using key with only number
W
wenjun 已提交
421 422
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
423
LITE_TEST_CASE(ParameterFuncTestSuite, testSetParameter004, Function | MediumTest | Level1)
W
wenjun 已提交
424 425 426 427 428 429 430 431 432 433
{
    int ret;

    char key[] = "202006060602";
    char value[] = "test key with only number";
    ret = SetParameter(key, value);
    TEST_ASSERT_EQUAL_INT(0, ret);
};

/**
M
mamingshuai 已提交
434 435
 * @tc.number    : SUB_UTILS_PARAMETER_2900
 * @tc.name      : SetParameter parameter legal test using key and value with maximum length
W
wenjun 已提交
436 437
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
438
LITE_TEST_CASE(ParameterFuncTestSuite, testSetParameter005, Function | MediumTest | Level1)
W
wenjun 已提交
439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454
{
    int ret;

    char key1[] = "rw.sys.version.version.version.";
    char value1[] = "set with key = 31";
    ret = SetParameter(key1, value1);
    TEST_ASSERT_EQUAL_INT(0, ret);

    char key2[] = "rw.sys.version.version";
    char value2[] = "abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890\
abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrs";
    ret = SetParameter(key2, value2);
    TEST_ASSERT_EQUAL_INT(0, ret);
};

/**
M
mamingshuai 已提交
455 456
 * @tc.number    : SUB_UTILS_PARAMETER_3000
 * @tc.name      : SetParameter parameter illegal test when key is nullptr and value is nullptr
W
wenjun 已提交
457 458
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
459
LITE_TEST_CASE(ParameterFuncTestSuite, testSetParameter006, Function | MediumTest | Level1)
W
wenjun 已提交
460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478
{
    int ret;

    char value[] = "test with null";
    ret = SetParameter(NULL, value);
    if ((ret == COMMON_ERROR) || (ret == INVALID_PARAMETER))
    {
        TEST_ASSERT_EQUAL_INT(1, 1);
    }

    char key[] = "rw.sys.version";
    ret = SetParameter(key, NULL);
    if ((ret == COMMON_ERROR) || (ret == INVALID_PARAMETER))
    {
        TEST_ASSERT_EQUAL_INT(1, 1);
    }
};

/**
M
mamingshuai 已提交
479 480
 * @tc.number    : SUB_UTILS_PARAMETER_3100
 * @tc.name      : SetParameter parameter illegal test when key is NULL and value is NULL
W
wenjun 已提交
481 482
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
483
LITE_TEST_CASE(ParameterFuncTestSuite, testSetParameter007, Function | MediumTest | Level1)
W
wenjun 已提交
484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502
{
    int ret;

    char value[] = "test with null";
    ret = SetParameter("\0", value);
    if ((ret == COMMON_ERROR) || (ret == INVALID_PARAMETER))
    {
        TEST_ASSERT_EQUAL_INT(1, 1);
    }

    char key[] = "rw.sys.version";
    ret = SetParameter(key, "\0");
    if ((ret == COMMON_ERROR) || (ret == INVALID_PARAMETER))
    {
        TEST_ASSERT_EQUAL_INT(1, 1);
    }
};

/**
M
mamingshuai 已提交
503 504
 * @tc.number    : SUB_UTILS_PARAMETER_3200
 * @tc.name      : SetParameter parameter illegal test when key len is 32 or more than 32 bytes
W
wenjun 已提交
505 506
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
507
LITE_TEST_CASE(ParameterFuncTestSuite, testSetParameter008, Function | MediumTest | Level1)
W
wenjun 已提交
508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528
{
    int ret;

    char key1[] = "rw.sys.version.version.version.v";
    char value1[] = "set with key = 32";
    ret = SetParameter(key1, value1);
    if ((ret == COMMON_ERROR) || (ret == INVALID_PARAMETER))
    {
        TEST_ASSERT_EQUAL_INT(1, 1);
    }

    char key2[] = "rw.sys.version.version.version.version";
    char value2[] = "set with key > 32";
    ret = SetParameter(key2, value2);
    if ((ret == COMMON_ERROR) || (ret == INVALID_PARAMETER))
    {
        TEST_ASSERT_EQUAL_INT(1, 1);
    }
};

/**
M
mamingshuai 已提交
529 530
 * @tc.number    : SUB_UTILS_PARAMETER_3300
 * @tc.name      : SetParameter parameter illegal test using key with uppercase
W
wenjun 已提交
531 532
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
533
LITE_TEST_CASE(ParameterFuncTestSuite, testSetParameter009, Function | MediumTest | Level1)
W
wenjun 已提交
534 535 536 537 538 539 540 541 542 543 544 545 546
{
    int ret;

    char key[] = "Rw.Sys.Version.Version";
    char value[] = "set value with uppercase";
    ret = SetParameter(key, value);
    if ((ret == COMMON_ERROR) || (ret == INVALID_PARAMETER))
    {
        TEST_ASSERT_EQUAL_INT(1, 1);
    }
};

/**
M
mamingshuai 已提交
547 548
 * @tc.number    : SUB_UTILS_PARAMETER_3400
 * @tc.name      : SetParameter parameter illegal test using key with blank
W
wenjun 已提交
549 550
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
551
LITE_TEST_CASE(ParameterFuncTestSuite, testSetParameter010, Function | MediumTest | Level1)
W
wenjun 已提交
552 553 554 555 556 557 558 559 560 561 562 563 564
{
    int ret;

    char key[] = "rw sys version version";
    char value[] = "set value with blank";
    ret = SetParameter(key, value);
    if ((ret == COMMON_ERROR) || (ret == INVALID_PARAMETER))
    {
        TEST_ASSERT_EQUAL_INT(1, 1);
    }
};

/**
M
mamingshuai 已提交
565 566
 * @tc.number    : SUB_UTILS_PARAMETER_3500
 * @tc.name      : SetParameter parameter illegal test using key with invalid special characters
W
wenjun 已提交
567 568
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
569
LITE_TEST_CASE(ParameterFuncTestSuite, testSetParameter011, Function | MediumTest | Level1)
W
wenjun 已提交
570 571 572 573 574 575 576 577 578 579 580 581 582
{
    int ret;

    char key[] = "rw+sys&version%version*";
    char value[] = "set value with special characters";
    ret = SetParameter(key, value);
    if ((ret == COMMON_ERROR) || (ret == INVALID_PARAMETER))
    {
        TEST_ASSERT_EQUAL_INT(1, 1);
    }
};

/**
M
mamingshuai 已提交
583 584
 * @tc.number    : SUB_UTILS_PARAMETER_3600
 * @tc.name      : SetParameter parameter illegal test when value length is 128 or more than 128 bytes
W
wenjun 已提交
585 586
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
587
LITE_TEST_CASE(ParameterFuncTestSuite, testSetParameter012, Function | MediumTest | Level1)
W
wenjun 已提交
588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610
{
    int ret;

    char key1[] = "rw.sys.version.version1";
    char value1[] = "abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890\
abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrst";
    ret = SetParameter(key1, value1);
    if ((ret == COMMON_ERROR) || (ret == INVALID_PARAMETER))
    {
        TEST_ASSERT_EQUAL_INT(1, 1);
    }

    char key2[] = "rw.sys.version.version2";
    char value2[] = "abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890\
abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890";
    ret = SetParameter(key2, value2);
    if ((ret == COMMON_ERROR) || (ret == INVALID_PARAMETER))
    {
        TEST_ASSERT_EQUAL_INT(1, 1);
    }
};

/**
M
mamingshuai 已提交
611 612
 * @tc.number    : SUB_UTILS_PARAMETER_3700
 * @tc.name      : SetParameter parameter legal test when value contains only blanks
W
wenjun 已提交
613 614
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
615
LITE_TEST_CASE(ParameterFuncTestSuite, testSetParameter013, Function | MediumTest | Level1)
W
wenjun 已提交
616 617 618 619 620 621 622 623 624 625
{
    int ret;

    char key[] = "key_for_blank_value";
    char value[] = "                         ";
    ret = SetParameter(key, value);
    TEST_ASSERT_EQUAL_INT(0, ret);
};

/**
M
mamingshuai 已提交
626 627
 * @tc.number    : SUB_UTILS_PARAMETER_3800
 * @tc.name      : GetParameter parameter legal test
W
wenjun 已提交
628 629
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
630
LITE_TEST_CASE(ParameterFuncTestSuite, testGetParameter001, Function | MediumTest | Level1)
W
wenjun 已提交
631 632 633 634
{
    int ret;

    char key[] = "rw.sys.version_606";
M
mamingshuai 已提交
635
    char rightVal[] = "OEM-10.1.0";
W
wenjun 已提交
636 637 638 639
    char value[MAX_LEN] = {0};
    SetParameter(key, rightVal);
    ret = GetParameter(key, g_defSysParam, value, MAX_LEN);
    TEST_ASSERT_EQUAL_INT(strlen(rightVal), ret);
M
mamingshuai 已提交
640
    TEST_ASSERT_EQUAL_STRING(rightVal, value);
W
wenjun 已提交
641 642 643
};

/**
M
mamingshuai 已提交
644 645
 * @tc.number    : SUB_UTILS_PARAMETER_3900
 * @tc.name      : GetParameter parameter legal test with Special characters
W
wenjun 已提交
646 647
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
648
LITE_TEST_CASE(ParameterFuncTestSuite, testGetParameter002, Function | MediumTest | Level1)
W
wenjun 已提交
649 650 651 652 653 654 655 656 657
{
    int ret;

    char key[] = "_._..__...___";
    char rightVal[] = "!@#¥%……&*()——+~《》?,。、“‘;:、12345767890";
    char value[MAX_LEN] = {0};
    SetParameter(key, rightVal);
    ret = GetParameter(key, g_defSysParam, value, MAX_LEN);
    TEST_ASSERT_EQUAL_INT(strlen(rightVal), ret);
M
mamingshuai 已提交
658
    TEST_ASSERT_EQUAL_STRING(rightVal, value);
W
wenjun 已提交
659 660 661
};

/**
M
mamingshuai 已提交
662 663
 * @tc.number    : SUB_UTILS_PARAMETER_4000
 * @tc.name      : GetParameter parameter legal test using key with only lowercase
W
wenjun 已提交
664 665
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
666
LITE_TEST_CASE(ParameterFuncTestSuite, testGetParameter003, Function | MediumTest | Level1)
W
wenjun 已提交
667 668 669 670 671 672 673 674 675
{
    int ret;

    char key[] = "keywithonlylowercase";
    char rightVal[] = "test key with only lowercase";
    char value[MAX_LEN] = {0};
    SetParameter(key, rightVal);
    ret = GetParameter(key, g_defSysParam, value, MAX_LEN);
    TEST_ASSERT_EQUAL_INT(strlen(rightVal), ret);
M
mamingshuai 已提交
676
    TEST_ASSERT_EQUAL_STRING(rightVal, value);
W
wenjun 已提交
677 678 679
};

/**
M
mamingshuai 已提交
680 681
 * @tc.number    : SUB_UTILS_PARAMETER_4100
 * @tc.name      : GetParameter parameter legal test using key with only number
W
wenjun 已提交
682 683
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
684
LITE_TEST_CASE(ParameterFuncTestSuite, testGetParameter004, Function | MediumTest | Level1)
W
wenjun 已提交
685 686 687 688 689 690 691 692 693
{
    int ret;

    char key[] = "202006060602";
    char rightVal[] = "test key with only number";
    char value[MAX_LEN] = {0};
    SetParameter(key, rightVal);
    ret = GetParameter(key, g_defSysParam, value, MAX_LEN);
    TEST_ASSERT_EQUAL_INT(strlen(rightVal), ret);
M
mamingshuai 已提交
694
    TEST_ASSERT_EQUAL_STRING(rightVal, value);
W
wenjun 已提交
695 696 697
};

/**
M
mamingshuai 已提交
698 699
 * @tc.number    : SUB_UTILS_PARAMETER_4200
 * @tc.name      : GetParameter parameter legal test when defaut value point is nullptr
W
wenjun 已提交
700 701
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
702
LITE_TEST_CASE(ParameterFuncTestSuite, testGetParameter005, Function | MediumTest | Level1)
W
wenjun 已提交
703 704 705 706
{
    int ret;

    char key[] = "rw.sys.version_606";
M
mamingshuai 已提交
707
    char rightVal[] = "OEM-10.1.0";
W
wenjun 已提交
708 709 710 711
    char value[MAX_LEN] = {0};
    SetParameter(key, rightVal);
    ret = GetParameter(key, NULL, value, MAX_LEN);
    TEST_ASSERT_EQUAL_INT(strlen(rightVal), ret);
M
mamingshuai 已提交
712
    TEST_ASSERT_EQUAL_STRING(rightVal, value);
W
wenjun 已提交
713 714 715
};

/**
M
mamingshuai 已提交
716 717
 * @tc.number    : SUB_UTILS_PARAMETER_4300
 * @tc.name      : GetParameter parameter legal test when the key is not exist
W
wenjun 已提交
718 719
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
720
LITE_TEST_CASE(ParameterFuncTestSuite, testGetParameter006, Function | MediumTest | Level1)
W
wenjun 已提交
721 722 723 724 725 726 727
{
    int ret;

    char key[] = "none.exist.key";
    char value[MAX_LEN] = {0};
    ret = GetParameter(key, g_defSysParam, value, MAX_LEN);
    TEST_ASSERT_EQUAL_INT(strlen(g_defSysParam), ret);
M
mamingshuai 已提交
728
    TEST_ASSERT_EQUAL_STRING(g_defSysParam, value);
W
wenjun 已提交
729 730 731
};

/**
M
mamingshuai 已提交
732 733
 * @tc.number    : SUB_UTILS_PARAMETER_4400
 * @tc.name      : GetParameter parameter legal test using key and value with maximum length
W
wenjun 已提交
734 735
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
736
LITE_TEST_CASE(ParameterFuncTestSuite, testGetParameter007, Function | MediumTest | Level1)
W
wenjun 已提交
737 738 739 740 741 742 743 744 745
{
    int ret;

    char key1[] = "rw.sys.version.version.version.";
    char rightVal1[] = "set with key = 31";
    char value1[MAX_LEN] = {0};
    SetParameter(key1, rightVal1);
    ret = GetParameter(key1, g_defSysParam, value1, MAX_LEN);
    TEST_ASSERT_EQUAL_INT(strlen(rightVal1), ret);
M
mamingshuai 已提交
746
    TEST_ASSERT_EQUAL_STRING(rightVal1, value1);
W
wenjun 已提交
747 748 749 750 751 752 753 754

    char key2[] = "rw.sys.version.version";
    char rightVal2[] = "abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890\
abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrs";
    char value2[MAX_LEN] = {0};
    SetParameter(key2, rightVal2);
    ret = GetParameter(key2, g_defSysParam, value2, MAX_LEN);
    TEST_ASSERT_EQUAL_INT(strlen(rightVal2), ret);
M
mamingshuai 已提交
755
    TEST_ASSERT_EQUAL_STRING(rightVal2, value2);
W
wenjun 已提交
756 757 758
};

/**
M
mamingshuai 已提交
759 760
 * @tc.number    : SUB_UTILS_PARAMETER_4500
 * @tc.name      : GetParameter parameter illegal test with invalid value length
W
wenjun 已提交
761 762
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
763
LITE_TEST_CASE(ParameterFuncTestSuite, testGetParameter008, Function | MediumTest | Level1)
W
wenjun 已提交
764 765 766 767
{
    int ret;

    char key[] = "rw.sys.version_606";
M
mamingshuai 已提交
768
    char rightVal[] = "OEM-10.1.0";
W
wenjun 已提交
769 770 771 772 773 774 775 776 777 778
    char value[INVALID_LEN] = {0};
    SetParameter(key, rightVal);
    ret = GetParameter(key, g_defSysParam, value, INVALID_LEN);
    if ((ret == COMMON_ERROR) || (ret == INVALID_PARAMETER))
    {
        TEST_ASSERT_EQUAL_INT(1, 1);
    }
};

/**
M
mamingshuai 已提交
779 780
 * @tc.number    : SUB_UTILS_PARAMETER_4600
 * @tc.name      : GetParameter parameter illegal test when value point is nullptr
W
wenjun 已提交
781 782
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
783
LITE_TEST_CASE(ParameterFuncTestSuite, testGetParameter009, Function | MediumTest | Level1)
W
wenjun 已提交
784 785 786 787
{
    int ret;

    char key[] = "rw.sys.version_606";
M
mamingshuai 已提交
788
    char rightVal[] = "OEM-10.1.0";
W
wenjun 已提交
789 790 791 792 793 794 795 796 797
    SetParameter(key, rightVal);
    ret = GetParameter(key, g_defSysParam, NULL, MAX_LEN);
    if ((ret == COMMON_ERROR) || (ret == INVALID_PARAMETER))
    {
        TEST_ASSERT_EQUAL_INT(1, 1);
    }
};

/**
M
mamingshuai 已提交
798 799
 * @tc.number    : SUB_UTILS_PARAMETER_4700
 * @tc.name      : GetParameter parameter illegal test when key is not exist and value len is invalid
W
wenjun 已提交
800 801
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
802
LITE_TEST_CASE(ParameterFuncTestSuite, testGetParameter010, Function | MediumTest | Level1)
W
wenjun 已提交
803 804 805 806 807 808 809 810 811 812
{
    int ret;

    char key[] = "none.exist.key";
    char value[INVALID_LEN] = {0};
    ret = GetParameter(key, g_defSysParam, value, INVALID_LEN);
    TEST_ASSERT_EQUAL_INT(-1, ret);
};

/**
M
mamingshuai 已提交
813 814
 * @tc.number    : SUB_UTILS_PARAMETER_4800
 * @tc.name      : GetParameter parameter illegal test when key is not exist and defaut value point is nullptr
W
wenjun 已提交
815 816
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
817
LITE_TEST_CASE(ParameterFuncTestSuite, testGetParameter011, Function | MediumTest | Level1)
W
wenjun 已提交
818 819 820 821 822 823 824 825 826 827
{
    int ret;

    char key[] = "none.exist.key";
    char value[MAX_LEN] = {0};
    ret = GetParameter(key, NULL, value, MAX_LEN);
    TEST_ASSERT_EQUAL_INT(-1, ret);
};

/**
M
mamingshuai 已提交
828 829
 * @tc.number    : SUB_UTILS_PARAMETER_4900
 * @tc.name      : GetParameter parameter illegal test when key len is 32 bytes
W
wenjun 已提交
830 831
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
832
LITE_TEST_CASE(ParameterFuncTestSuite, testGetParameter012, Function | MediumTest | Level1)
W
wenjun 已提交
833 834 835 836 837 838 839 840 841 842 843 844 845
{
    int ret;

    char key[] = "rw.sys.version.version.version.v";
    char value[MAX_LEN] = {0};
    ret = GetParameter(key, g_defSysParam, value, MAX_LEN);
    if ((ret == COMMON_ERROR) || (ret == INVALID_PARAMETER))
    {
        TEST_ASSERT_EQUAL_INT(1, 1);
    }
};

/**
M
mamingshuai 已提交
846 847
 * @tc.number    : SUB_UTILS_PARAMETER_5000
 * @tc.name      : GetParameter parameter illegal test when key len is more than 32 bytes
W
wenjun 已提交
848 849
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
850
LITE_TEST_CASE(ParameterFuncTestSuite, testGetParameter013, Function | MediumTest | Level1)
W
wenjun 已提交
851 852 853 854 855 856 857 858 859 860 861 862 863
{
    int ret;

    char key[] = "rw.sys.version.version.version.version";
    char value[MAX_LEN] = {0};
    ret = GetParameter(key, g_defSysParam, value, MAX_LEN);
    if ((ret == COMMON_ERROR) || (ret == INVALID_PARAMETER))
    {
        TEST_ASSERT_EQUAL_INT(1, 1);
    }
};

/**
M
mamingshuai 已提交
864 865
 * @tc.number    : SUB_UTILS_PARAMETER_5100
 * @tc.name      : GetParameter parameter illegal test when key is nullptr
W
wenjun 已提交
866 867
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
868
LITE_TEST_CASE(ParameterFuncTestSuite, testGetParameter014, Function | MediumTest | Level1)
W
wenjun 已提交
869 870 871 872 873 874 875 876 877 878 879 880
{
    int ret;

    char value[MAX_LEN] = {0};
    ret = GetParameter(NULL, g_defSysParam, value, MAX_LEN);
    if ((ret == COMMON_ERROR) || (ret == INVALID_PARAMETER))
    {
        TEST_ASSERT_EQUAL_INT(1, 1);
    }
};

/**
M
mamingshuai 已提交
881 882
 * @tc.number    : SUB_UTILS_PARAMETER_5200
 * @tc.name      : GetParameter parameter illegal test using key with uppercase
W
wenjun 已提交
883 884
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
885
LITE_TEST_CASE(ParameterFuncTestSuite, testGetParameter015, Function | MediumTest | Level1)
W
wenjun 已提交
886 887 888 889 890 891 892 893 894 895 896 897 898
{
    int ret;

    char key[] = "Rw.Sys.Version.Version";
    char value[MAX_LEN] = {0};
    ret = GetParameter(key, g_defSysParam, value, MAX_LEN);
    if ((ret == COMMON_ERROR) || (ret == INVALID_PARAMETER))
    {
        TEST_ASSERT_EQUAL_INT(1, 1);
    }
};

/**
M
mamingshuai 已提交
899 900
 * @tc.number    : SUB_UTILS_PARAMETER_5300
 * @tc.name      : GetParameter parameter illegal test using key with blank
W
wenjun 已提交
901 902
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
903
LITE_TEST_CASE(ParameterFuncTestSuite, testGetParameter016, Function | MediumTest | Level1)
W
wenjun 已提交
904 905 906 907 908 909 910 911 912 913 914 915 916
{
    int ret;

    char key[] = "rw sys version version";
    char value[MAX_LEN] = {0};
    ret = GetParameter(key, g_defSysParam, value, MAX_LEN);
    if ((ret == COMMON_ERROR) || (ret == INVALID_PARAMETER))
    {
        TEST_ASSERT_EQUAL_INT(1, 1);
    }
};

/**
M
mamingshuai 已提交
917 918
 * @tc.number    : SUB_UTILS_PARAMETER_5400
 * @tc.name      : GetParameter parameter illegal test using key with invalid special characters
W
wenjun 已提交
919 920
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
921
LITE_TEST_CASE(ParameterFuncTestSuite, testGetParameter017, Function | MediumTest | Level1)
W
wenjun 已提交
922 923 924 925 926 927 928 929 930 931 932 933 934
{
    int ret;

    char key[] = "rw+sys&version%version*";
    char value[MAX_LEN] = {0};
    ret = GetParameter(key, g_defSysParam, value, MAX_LEN);
    if ((ret == COMMON_ERROR) || (ret == INVALID_PARAMETER))
    {
        TEST_ASSERT_EQUAL_INT(1, 1);
    }
};

/**
M
mamingshuai 已提交
935 936
 * @tc.number    : SUB_UTILS_PARAMETER_5500
 * @tc.name      : GetParameter parameter illegal test when key is NULL
W
wenjun 已提交
937 938
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
939
LITE_TEST_CASE(ParameterFuncTestSuite, testGetParameter018, Function | MediumTest | Level1)
W
wenjun 已提交
940 941 942 943 944 945 946 947 948 949 950 951
{
    int ret;

    char value[MAX_LEN] = {0};
    ret = GetParameter("\0", g_defSysParam, value, MAX_LEN);
    if ((ret == COMMON_ERROR) || (ret == INVALID_PARAMETER))
    {
        TEST_ASSERT_EQUAL_INT(1, 1);
    }
};

/**
M
mamingshuai 已提交
952 953
 * @tc.number    : SUB_UTILS_PARAMETER_5600
 * @tc.name      : GetParameter parameter legal test when value contains only blanks
W
wenjun 已提交
954 955
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
956
LITE_TEST_CASE(ParameterFuncTestSuite, testGetParameter019, Function | MediumTest | Level1)
W
wenjun 已提交
957 958 959 960 961 962 963 964 965
{
    int ret;

    char key[] = "key_for_blank_value";
    char rightVal[] = "                         ";
    char value[MAX_LEN] = {0};
    SetParameter(key, rightVal);
    ret = GetParameter(key, g_defSysParam, value, MAX_LEN);
    TEST_ASSERT_EQUAL_INT(strlen(rightVal), ret);
M
mamingshuai 已提交
966
    TEST_ASSERT_EQUAL_STRING(rightVal, value);
W
wenjun 已提交
967 968 969
};

/**
M
mamingshuai 已提交
970
 * @tc.number    : SUB_UTILS_PARAMETER_5700
W
wenjun 已提交
971 972 973
 * @tc.name      : Update value of parameter legal test
 * @tc.desc      : [C- SOFTWARE -0200]
 */
M
mamingshuai 已提交
974
LITE_TEST_CASE(ParameterFuncTestSuite, testGetParameter020, Function | MediumTest | Level1)
W
wenjun 已提交
975 976 977 978
{
    int ret;

    char key[] = "rw.sys.version_606";
M
mamingshuai 已提交
979
    char rightVal1[] = "OEM-10.1.0";
W
wenjun 已提交
980 981 982 983 984
    char value1[MAX_LEN] = {0};
    ret = SetParameter(key, rightVal1);
    TEST_ASSERT_EQUAL_INT(0, ret);
    ret = GetParameter(key, g_defSysParam, value1, MAX_LEN);
    TEST_ASSERT_EQUAL_INT(strlen(rightVal1), ret);
M
mamingshuai 已提交
985
    TEST_ASSERT_EQUAL_STRING(rightVal1, value1);
W
wenjun 已提交
986

M
mamingshuai 已提交
987
    char rightVal2[] = "update the value of OEM-10.1.0";
W
wenjun 已提交
988 989 990 991 992
    char value2[MAX_LEN] = {0};
    ret = SetParameter(key, rightVal2);
    TEST_ASSERT_EQUAL_INT(0, ret);
    ret = GetParameter(key, g_defSysParam, value2, MAX_LEN);
    TEST_ASSERT_EQUAL_INT(strlen(rightVal2), ret);
M
mamingshuai 已提交
993
    TEST_ASSERT_EQUAL_STRING(rightVal2, value2);
W
wenjun 已提交
994 995 996
};

RUN_TEST_SUITE(ParameterFuncTestSuite);