parameter_reli_test.c 14.4 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 16 17
 * 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"
L
leiyuqian 已提交
18
#include "ohos_types.h"
W
wenjun 已提交
19 20 21
#include "parameter.h"
#include "parameter_utils.h"

L
leiyuqian 已提交
22
#define QUERY_TIMES 50
W
wenjun 已提交
23 24

/**
L
leiyuqian 已提交
25 26
 * @tc.desc      : register a test suite, this suite is used to test basic flow
 * and interface dependency
W
wenjun 已提交
27 28 29 30 31 32 33 34 35 36
 * @param        : subsystem name is utils
 * @param        : module name is parameter
 * @param        : test suit name is ParameterReliTestSuite
 */
LITE_TEST_SUIT(utils, parameter, ParameterReliTestSuite);

/**
 * @tc.setup     : setup for all testcases
 * @return       : setup result, TRUE is success, FALSE is fail
 */
37
static BOOL ParameterReliTestSuiteSetUp(void)
38
{
W
wenjun 已提交
39 40 41 42 43 44 45
    return TRUE;
}

/**
 * @tc.teardown  : teardown for all testcases
 * @return       : teardown result, TRUE is success, FALSE is fail
 */
46
static BOOL ParameterReliTestSuiteTearDown(void)
47
{
W
wenjun 已提交
48 49 50 51 52
    printf("+-------------------------------------------+\n");
    return TRUE;
}

/**
M
mamingshuai 已提交
53 54
 * @tc.number    : SUB_UTILS_PARAMETER_5800
 * @tc.name      : Obtaining ProductType for multiple times
W
wenjun 已提交
55 56
 * @tc.desc      : [C- SOFTWARE -0200]
 */
L
leiyuqian 已提交
57 58 59
LITE_TEST_CASE(ParameterReliTestSuite,
               testObtainSysParaReli001,
               Function | MediumTest | Level1) {
L
lanxueyuan 已提交
60
    const char* value1 = GetDeviceType();
61
    AssertNotEmpty(value1);
L
leiyuqian 已提交
62 63
    for (int i = 0; i < QUERY_TIMES; i++) {
        const char* value = GetDeviceType();
W
wenjun 已提交
64
    }
L
lanxueyuan 已提交
65
    const char* value2 = GetDeviceType();
M
mamingshuai 已提交
66
    TEST_ASSERT_EQUAL_STRING(value1, value2);
W
wenjun 已提交
67 68 69
};

/**
M
mamingshuai 已提交
70 71
 * @tc.number    : SUB_UTILS_PARAMETER_5900
 * @tc.name      : Obtaining Manufacture for multiple times
W
wenjun 已提交
72 73
 * @tc.desc      : [C- SOFTWARE -0200]
 */
L
leiyuqian 已提交
74 75 76
LITE_TEST_CASE(ParameterReliTestSuite,
               testObtainSysParaReli002,
               Function | MediumTest | Level1) {
L
lanxueyuan 已提交
77
    const char* value1 = GetManufacture();
78
    AssertNotEmpty(value1);
L
leiyuqian 已提交
79 80
    for (int i = 0; i < QUERY_TIMES; i++) {
        const char* value = GetManufacture();
W
wenjun 已提交
81
    }
L
lanxueyuan 已提交
82
    const char* value2 = GetManufacture();
M
mamingshuai 已提交
83
    TEST_ASSERT_EQUAL_STRING(value1, value2);
W
wenjun 已提交
84 85 86
};

/**
M
mamingshuai 已提交
87 88
 * @tc.number    : SUB_UTILS_PARAMETER_6000
 * @tc.name      : Obtaining Brand for multiple times
W
wenjun 已提交
89 90
 * @tc.desc      : [C- SOFTWARE -0200]
 */
L
leiyuqian 已提交
91 92 93
LITE_TEST_CASE(ParameterReliTestSuite,
               testObtainSysParaReli003,
               Function | MediumTest | Level1) {
L
lanxueyuan 已提交
94
    const char* value1 = GetBrand();
95
    AssertNotEmpty(value1);
L
leiyuqian 已提交
96 97
    for (int i = 0; i < QUERY_TIMES; i++) {
        const char* value = GetBrand();
W
wenjun 已提交
98
    }
L
lanxueyuan 已提交
99
    const char* value2 = GetBrand();
M
mamingshuai 已提交
100
    TEST_ASSERT_EQUAL_STRING(value1, value2);
W
wenjun 已提交
101 102 103
};

/**
M
mamingshuai 已提交
104 105
 * @tc.number    : SUB_UTILS_PARAMETER_6100
 * @tc.name      : Obtaining MarketName for multiple times
W
wenjun 已提交
106 107
 * @tc.desc      : [C- SOFTWARE -0200]
 */
L
leiyuqian 已提交
108 109 110
LITE_TEST_CASE(ParameterReliTestSuite,
               testObtainSysParaReli004,
               Function | MediumTest | Level1) {
L
lanxueyuan 已提交
111
    const char* value1 = GetMarketName();
112
    AssertNotEmpty(value1);
L
leiyuqian 已提交
113 114
    for (int i = 0; i < QUERY_TIMES; i++) {
        const char* value = GetMarketName();
W
wenjun 已提交
115
    }
L
lanxueyuan 已提交
116
    const char* value2 = GetMarketName();
M
mamingshuai 已提交
117
    TEST_ASSERT_EQUAL_STRING(value1, value2);
W
wenjun 已提交
118 119 120
};

/**
M
mamingshuai 已提交
121 122
 * @tc.number    : SUB_UTILS_PARAMETER_6200
 * @tc.name      : Obtaining ProductSeries for multiple times
W
wenjun 已提交
123 124
 * @tc.desc      : [C- SOFTWARE -0200]
 */
L
leiyuqian 已提交
125 126 127
LITE_TEST_CASE(ParameterReliTestSuite,
               testObtainSysParaReli005,
               Function | MediumTest | Level1) {
L
lanxueyuan 已提交
128
    const char* value1 = GetProductSeries();
129
    AssertNotEmpty(value1);
L
leiyuqian 已提交
130 131
    for (int i = 0; i < QUERY_TIMES; i++) {
        const char* value = GetProductSeries();
W
wenjun 已提交
132
    }
L
lanxueyuan 已提交
133
    const char* value2 = GetProductSeries();
M
mamingshuai 已提交
134
    TEST_ASSERT_EQUAL_STRING(value1, value2);
W
wenjun 已提交
135 136 137
};

/**
M
mamingshuai 已提交
138 139
 * @tc.number    : SUB_UTILS_PARAMETER_6300
 * @tc.name      : Obtaining ProductModel for multiple times
W
wenjun 已提交
140 141
 * @tc.desc      : [C- SOFTWARE -0200]
 */
L
leiyuqian 已提交
142 143 144
LITE_TEST_CASE(ParameterReliTestSuite,
               testObtainSysParaReli006,
               Function | MediumTest | Level1) {
L
lanxueyuan 已提交
145
    const char* value1 = GetProductModel();
146
    AssertNotEmpty(value1);
L
leiyuqian 已提交
147 148
    for (int i = 0; i < QUERY_TIMES; i++) {
        const char* value = GetProductModel();
W
wenjun 已提交
149
    }
L
lanxueyuan 已提交
150
    const char* value2 = GetProductModel();
M
mamingshuai 已提交
151
    TEST_ASSERT_EQUAL_STRING(value1, value2);
W
wenjun 已提交
152 153 154
};

/**
M
mamingshuai 已提交
155 156
 * @tc.number    : SUB_UTILS_PARAMETER_6400
 * @tc.name      : Obtaining HardwareModel for multiple times
W
wenjun 已提交
157 158
 * @tc.desc      : [C- SOFTWARE -0200]
 */
L
leiyuqian 已提交
159 160 161
LITE_TEST_CASE(ParameterReliTestSuite,
               testObtainSysParaReli007,
               Function | MediumTest | Level1) {
L
lanxueyuan 已提交
162
    const char* value1 = GetHardwareModel();
163
    AssertNotEmpty(value1);
L
leiyuqian 已提交
164 165
    for (int i = 0; i < QUERY_TIMES; i++) {
        const char* value = GetHardwareModel();
W
wenjun 已提交
166
    }
L
lanxueyuan 已提交
167
    const char* value2 = GetHardwareModel();
M
mamingshuai 已提交
168
    TEST_ASSERT_EQUAL_STRING(value1, value2);
W
wenjun 已提交
169 170 171
};

/**
M
mamingshuai 已提交
172 173
 * @tc.number    : SUB_UTILS_PARAMETER_6500
 * @tc.name      : Obtaining HardwareProfile for multiple times
W
wenjun 已提交
174 175
 * @tc.desc      : [C- SOFTWARE -0200]
 */
L
leiyuqian 已提交
176 177 178
LITE_TEST_CASE(ParameterReliTestSuite,
               testObtainSysParaReli008,
               Function | MediumTest | Level1) {
L
lanxueyuan 已提交
179
    const char* value1 = GetHardwareProfile();
180
    AssertNotEmpty(value1);
L
leiyuqian 已提交
181 182
    for (int i = 0; i < QUERY_TIMES; i++) {
        const char* value = GetHardwareProfile();
W
wenjun 已提交
183
    }
L
lanxueyuan 已提交
184
    const char* value2 = GetHardwareProfile();
M
mamingshuai 已提交
185
    TEST_ASSERT_EQUAL_STRING(value1, value2);
W
wenjun 已提交
186 187 188
};

/**
M
mamingshuai 已提交
189 190
 * @tc.number    : SUB_UTILS_PARAMETER_6600
 * @tc.name      : Obtaining Serial for multiple times
W
wenjun 已提交
191 192
 * @tc.desc      : [C- SOFTWARE -0200]
 */
L
leiyuqian 已提交
193 194 195
LITE_TEST_CASE(ParameterReliTestSuite,
               testObtainSysParaReli009,
               Function | MediumTest | Level1) {
L
lanxueyuan 已提交
196
    const char* value1 = GetSerial();
W
wenjun 已提交
197 198 199
    if (value1 == NULL) {
        printf("The serial number needs to be written\n");
        TEST_IGNORE();
M
mamingshuai 已提交
200
    }
L
leiyuqian 已提交
201 202
    for (int i = 0; i < QUERY_TIMES; i++) {
        const char* value = GetSerial();
W
wenjun 已提交
203
    }
L
lanxueyuan 已提交
204
    const char* value2 = GetSerial();
M
mamingshuai 已提交
205
    TEST_ASSERT_EQUAL_STRING(value1, value2);
W
wenjun 已提交
206 207 208
};

/**
M
mamingshuai 已提交
209 210
 * @tc.number    : SUB_UTILS_PARAMETER_6700
 * @tc.name      : Obtaining OsName for multiple times
W
wenjun 已提交
211 212
 * @tc.desc      : [C- SOFTWARE -0200]
 */
L
leiyuqian 已提交
213 214 215
LITE_TEST_CASE(ParameterReliTestSuite,
               testObtainSysParaReli010,
               Function | MediumTest | Level1) {
L
lanxueyuan 已提交
216
    const char* value1 = GetOSFullName();
217
    AssertNotEmpty(value1);
L
leiyuqian 已提交
218 219
    for (int i = 0; i < QUERY_TIMES; i++) {
        const char* value = GetOSFullName();
W
wenjun 已提交
220
    }
L
lanxueyuan 已提交
221
    const char* value2 = GetOSFullName();
M
mamingshuai 已提交
222
    TEST_ASSERT_EQUAL_STRING(value1, value2);
W
wenjun 已提交
223 224 225
};

/**
M
mamingshuai 已提交
226 227
 * @tc.number    : SUB_UTILS_PARAMETER_6800
 * @tc.name      : Obtaining DisplayVersion for multiple times
W
wenjun 已提交
228 229
 * @tc.desc      : [C- SOFTWARE -0200]
 */
L
leiyuqian 已提交
230 231 232
LITE_TEST_CASE(ParameterReliTestSuite,
               testObtainSysParaReli011,
               Function | MediumTest | Level1) {
L
lanxueyuan 已提交
233
    const char* value1 = GetDisplayVersion();
234
    AssertNotEmpty(value1);
L
leiyuqian 已提交
235 236
    for (int i = 0; i < QUERY_TIMES; i++) {
        const char* value = GetDisplayVersion();
W
wenjun 已提交
237
    }
L
lanxueyuan 已提交
238
    const char* value2 = GetDisplayVersion();
M
mamingshuai 已提交
239
    TEST_ASSERT_EQUAL_STRING(value1, value2);
W
wenjun 已提交
240 241 242
};

/**
M
mamingshuai 已提交
243 244
 * @tc.number    : SUB_UTILS_PARAMETER_6900
 * @tc.name      : Obtaining BootloaderVersion for multiple times
W
wenjun 已提交
245 246
 * @tc.desc      : [C- SOFTWARE -0200]
 */
L
leiyuqian 已提交
247 248 249
LITE_TEST_CASE(ParameterReliTestSuite,
               testObtainSysParaReli012,
               Function | MediumTest | Level1) {
L
lanxueyuan 已提交
250
    const char* value1 = GetBootloaderVersion();
251
    AssertNotEmpty(value1);
L
leiyuqian 已提交
252 253
    for (int i = 0; i < QUERY_TIMES; i++) {
        const char* value = GetBootloaderVersion();
W
wenjun 已提交
254
    }
L
lanxueyuan 已提交
255
    const char* value2 = GetBootloaderVersion();
M
mamingshuai 已提交
256
    TEST_ASSERT_EQUAL_STRING(value1, value2);
W
wenjun 已提交
257 258 259
};

/**
M
mamingshuai 已提交
260 261
 * @tc.number    : SUB_UTILS_PARAMETER_7000
 * @tc.name      : Obtaining SecurityPatchTag for multiple times
W
wenjun 已提交
262 263
 * @tc.desc      : [C- SOFTWARE -0200]
 */
L
leiyuqian 已提交
264 265 266
LITE_TEST_CASE(ParameterReliTestSuite,
               testObtainSysParaReli013,
               Function | MediumTest | Level1) {
L
lanxueyuan 已提交
267
    const char* value1 = GetSecurityPatchTag();
268
    AssertNotEmpty(value1);
L
leiyuqian 已提交
269 270
    for (int i = 0; i < QUERY_TIMES; i++) {
        const char* value = GetSecurityPatchTag();
W
wenjun 已提交
271
    }
L
lanxueyuan 已提交
272
    const char* value2 = GetSecurityPatchTag();
M
mamingshuai 已提交
273
    TEST_ASSERT_EQUAL_STRING(value1, value2);
W
wenjun 已提交
274 275 276
};

/**
M
mamingshuai 已提交
277 278
 * @tc.number    : SUB_UTILS_PARAMETER_7100
 * @tc.name      : Obtaining AbiList for multiple times
W
wenjun 已提交
279 280
 * @tc.desc      : [C- SOFTWARE -0200]
 */
L
leiyuqian 已提交
281 282 283
LITE_TEST_CASE(ParameterReliTestSuite,
               testObtainSysParaReli014,
               Function | MediumTest | Level1) {
L
lanxueyuan 已提交
284
    const char* value1 = GetAbiList();
285
    AssertNotEmpty(value1);
L
leiyuqian 已提交
286 287
    for (int i = 0; i < QUERY_TIMES; i++) {
        const char* value = GetAbiList();
W
wenjun 已提交
288
    }
L
lanxueyuan 已提交
289
    const char* value2 = GetAbiList();
M
mamingshuai 已提交
290
    TEST_ASSERT_EQUAL_STRING(value1, value2);
W
wenjun 已提交
291 292 293
};

/**
M
mamingshuai 已提交
294 295
 * @tc.number    : SUB_UTILS_PARAMETER_7200
 * @tc.name      : Obtaining FirstApiLevel for multiple times
W
wenjun 已提交
296 297
 * @tc.desc      : [C- SOFTWARE -0200]
 */
L
leiyuqian 已提交
298 299 300
LITE_TEST_CASE(ParameterReliTestSuite,
               testObtainSysParaReli015,
               Function | MediumTest | Level1) {
L
lanxueyuan 已提交
301
    int value1 = GetFirstApiVersion();
302
    TEST_ASSERT_NOT_NULL(value1);
303
    TEST_ASSERT_TRUE((int)value1 == value1);
L
leiyuqian 已提交
304 305
    for (int i = 0; i < QUERY_TIMES; i++) {
        int value = GetFirstApiVersion();
W
wenjun 已提交
306
    }
L
lanxueyuan 已提交
307 308
    int value2 = GetFirstApiVersion();
    TEST_ASSERT_EQUAL_INT(value1, value2);
W
wenjun 已提交
309 310 311
};

/**
M
mamingshuai 已提交
312 313
 * @tc.number    : SUB_UTILS_PARAMETER_7300
 * @tc.name      : Obtaining IncrementalVersion for multiple times
W
wenjun 已提交
314 315
 * @tc.desc      : [C- SOFTWARE -0200]
 */
L
leiyuqian 已提交
316 317 318
LITE_TEST_CASE(ParameterReliTestSuite,
               testObtainSysParaReli016,
               Function | MediumTest | Level1) {
L
lanxueyuan 已提交
319
    const char* value1 = GetIncrementalVersion();
320
    AssertNotEmpty(value1);
L
leiyuqian 已提交
321 322
    for (int i = 0; i < QUERY_TIMES; i++) {
        const char* value = GetIncrementalVersion();
W
wenjun 已提交
323
    }
L
lanxueyuan 已提交
324
    const char* value2 = GetIncrementalVersion();
M
mamingshuai 已提交
325
    TEST_ASSERT_EQUAL_STRING(value1, value2);
W
wenjun 已提交
326 327 328
};

/**
M
mamingshuai 已提交
329 330
 * @tc.number    : SUB_UTILS_PARAMETER_7400
 * @tc.name      : Obtaining VersionId for multiple times
W
wenjun 已提交
331 332
 * @tc.desc      : [C- SOFTWARE -0200]
 */
L
leiyuqian 已提交
333 334 335
LITE_TEST_CASE(ParameterReliTestSuite,
               testObtainSysParaReli017,
               Function | MediumTest | Level1) {
L
lanxueyuan 已提交
336
    const char* value1 = GetVersionId();
337
    AssertNotEmpty(value1);
L
leiyuqian 已提交
338 339
    for (int i = 0; i < QUERY_TIMES; i++) {
        const char* value = GetVersionId();
W
wenjun 已提交
340
    }
L
lanxueyuan 已提交
341
    const char* value2 = GetVersionId();
M
mamingshuai 已提交
342
    TEST_ASSERT_EQUAL_STRING(value1, value2);
W
wenjun 已提交
343 344 345
};

/**
M
mamingshuai 已提交
346 347
 * @tc.number    : SUB_UTILS_PARAMETER_7500
 * @tc.name      : Obtaining BuildType for multiple times
W
wenjun 已提交
348 349
 * @tc.desc      : [C- SOFTWARE -0200]
 */
L
leiyuqian 已提交
350 351 352
LITE_TEST_CASE(ParameterReliTestSuite,
               testObtainSysParaReli018,
               Function | MediumTest | Level1) {
L
lanxueyuan 已提交
353
    const char* value1 = GetBuildType();
354
    AssertNotEmpty(value1);
L
leiyuqian 已提交
355 356
    for (int i = 0; i < QUERY_TIMES; i++) {
        const char* value = GetBuildType();
W
wenjun 已提交
357
    }
L
lanxueyuan 已提交
358
    const char* value2 = GetBuildType();
M
mamingshuai 已提交
359
    TEST_ASSERT_EQUAL_STRING(value1, value2);
W
wenjun 已提交
360 361 362
};

/**
M
mamingshuai 已提交
363 364
 * @tc.number    : SUB_UTILS_PARAMETER_7600
 * @tc.name      : Obtaining BuildUser for multiple times
W
wenjun 已提交
365 366
 * @tc.desc      : [C- SOFTWARE -0200]
 */
L
leiyuqian 已提交
367 368 369
LITE_TEST_CASE(ParameterReliTestSuite,
               testObtainSysParaReli019,
               Function | MediumTest | Level1) {
L
lanxueyuan 已提交
370
    const char* value1 = GetBuildUser();
371
    AssertNotEmpty(value1);
L
leiyuqian 已提交
372 373
    for (int i = 0; i < QUERY_TIMES; i++) {
        const char* value = GetBuildUser();
W
wenjun 已提交
374
    }
L
lanxueyuan 已提交
375
    const char* value2 = GetBuildUser();
M
mamingshuai 已提交
376
    TEST_ASSERT_EQUAL_STRING(value1, value2);
W
wenjun 已提交
377 378 379
};

/**
M
mamingshuai 已提交
380 381
 * @tc.number    : SUB_UTILS_PARAMETER_7700
 * @tc.name      : Obtaining BuildHost for multiple times
W
wenjun 已提交
382 383
 * @tc.desc      : [C- SOFTWARE -0200]
 */
L
leiyuqian 已提交
384 385 386
LITE_TEST_CASE(ParameterReliTestSuite,
               testObtainSysParaReli020,
               Function | MediumTest | Level1) {
L
lanxueyuan 已提交
387
    const char* value1 = GetBuildHost();
388
    AssertNotEmpty(value1);
L
leiyuqian 已提交
389 390
    for (int i = 0; i < QUERY_TIMES; i++) {
        const char* value = GetBuildHost();
W
wenjun 已提交
391
    }
L
lanxueyuan 已提交
392
    const char* value2 = GetBuildHost();
M
mamingshuai 已提交
393
    TEST_ASSERT_EQUAL_STRING(value1, value2);
W
wenjun 已提交
394 395 396
};

/**
M
mamingshuai 已提交
397 398
 * @tc.number    : SUB_UTILS_PARAMETER_7800
 * @tc.name      : Obtaining BuildTime for multiple times
W
wenjun 已提交
399 400
 * @tc.desc      : [C- SOFTWARE -0200]
 */
L
leiyuqian 已提交
401 402 403
LITE_TEST_CASE(ParameterReliTestSuite,
               testObtainSysParaReli021,
               Function | MediumTest | Level1) {
L
lanxueyuan 已提交
404
    const char* value1 = GetBuildTime();
405
    AssertNotEmpty(value1);
L
leiyuqian 已提交
406 407
    for (int i = 0; i < QUERY_TIMES; i++) {
        const char* value = GetBuildTime();
W
wenjun 已提交
408
    }
L
lanxueyuan 已提交
409
    const char* value2 = GetBuildTime();
M
mamingshuai 已提交
410
    TEST_ASSERT_EQUAL_STRING(value1, value2);
W
wenjun 已提交
411 412 413
};

/**
M
mamingshuai 已提交
414 415
 * @tc.number    : SUB_UTILS_PARAMETER_7900
 * @tc.name      : Obtaining BuildRootHash for multiple times
W
wenjun 已提交
416 417
 * @tc.desc      : [C- SOFTWARE -0200]
 */
L
leiyuqian 已提交
418 419 420
LITE_TEST_CASE(ParameterReliTestSuite,
               testObtainSysParaReli022,
               Function | MediumTest | Level1) {
L
lanxueyuan 已提交
421
    const char* value1 = GetBuildRootHash();
422
    TEST_ASSERT_NOT_NULL(value1);
L
leiyuqian 已提交
423 424
    for (int i = 0; i < QUERY_TIMES; i++) {
        const char* value = GetBuildRootHash();
W
wenjun 已提交
425
    }
L
lanxueyuan 已提交
426
    const char* value2 = GetBuildRootHash();
M
mamingshuai 已提交
427
    TEST_ASSERT_EQUAL_STRING(value1, value2);
W
wenjun 已提交
428 429 430
};

/**
M
mamingshuai 已提交
431 432
 * @tc.number    : SUB_UTILS_PARAMETER_8000
 * @tc.name      : Obtaining SoftwareModel for multiple times
W
wenjun 已提交
433 434
 * @tc.desc      : [C- SOFTWARE -0200]
 */
L
leiyuqian 已提交
435 436 437
LITE_TEST_CASE(ParameterReliTestSuite,
               testObtainSysParaReli023,
               Function | MediumTest | Level1) {
L
lanxueyuan 已提交
438
    const char* value1 = GetSoftwareModel();
439
    AssertNotEmpty(value1);
L
leiyuqian 已提交
440 441
    for (int i = 0; i < QUERY_TIMES; i++) {
        const char* value = GetSoftwareModel();
W
wenjun 已提交
442
    }
L
lanxueyuan 已提交
443
    const char* value2 = GetSoftwareModel();
M
mamingshuai 已提交
444
    TEST_ASSERT_EQUAL_STRING(value1, value2);
W
wenjun 已提交
445 446 447
};

/**
M
mamingshuai 已提交
448 449
 * @tc.number    : SUB_UTILS_PARAMETER_8100
 * @tc.name      : Obtaining SdkApiLevel for multiple times
W
wenjun 已提交
450 451
 * @tc.desc      : [C- SOFTWARE -0200]
 */
L
leiyuqian 已提交
452 453 454
LITE_TEST_CASE(ParameterReliTestSuite,
               testObtainSysParaReli024,
               Function | MediumTest | Level1) {
L
lanxueyuan 已提交
455
    int value1 = GetSdkApiVersion();
456
    TEST_ASSERT_NOT_NULL(value1);
457
    TEST_ASSERT_TRUE((int)value1 == value1);
L
leiyuqian 已提交
458 459
    for (int i = 0; i < QUERY_TIMES; i++) {
        int value = GetSdkApiVersion();
W
wenjun 已提交
460
    }
L
lanxueyuan 已提交
461 462
    int value2 = GetSdkApiVersion();
    TEST_ASSERT_EQUAL_INT(value1, value2);
W
wenjun 已提交
463 464 465
};

RUN_TEST_SUITE(ParameterReliTestSuite);