From b680cd0f812966480c16602615bb49a8c1add640 Mon Sep 17 00:00:00 2001 From: nan-xiansen Date: Tue, 21 Mar 2023 15:54:18 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90startup=E3=80=91=E3=80=90startup=5Flit?= =?UTF-8?q?e=E3=80=91GetSecurityPatchTag=E6=8E=A5=E5=8F=A3=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=80=BC=E6=A0=BC=E5=BC=8F=E5=8F=98=E6=9B=B4=E9=80=82?= =?UTF-8?q?=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nan-xiansen Change-Id: Icb634e7961317bdfde996a85b71e850f8e547a4e --- .../deviceinfo/src/main/js/test/DeviceInfoJsUnit.test.js | 4 ++-- startup_lite/syspara_hal/src/deviceinfo_func_test.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/startup/startup_standard/deviceinfo/src/main/js/test/DeviceInfoJsUnit.test.js b/startup/startup_standard/deviceinfo/src/main/js/test/DeviceInfoJsUnit.test.js index 308878966..a3b2f35fe 100644 --- a/startup/startup_standard/deviceinfo/src/main/js/test/DeviceInfoJsUnit.test.js +++ b/startup/startup_standard/deviceinfo/src/main/js/test/DeviceInfoJsUnit.test.js @@ -385,7 +385,7 @@ export default function DeviceInfoTest() { expect(securityPatchTagInfo).assertInstanceOf('String'); if (securityPatchTagInfo != "" && securityPatchTagInfo != null && securityPatchTagInfo != undefined) { - let str = /[\w-\.\(\)]/g; + let str = /[\w\/\.\(\)]/g; let arr = securityPatchTagInfo.match(str); let bufferstr = arr.join(''); console.info('the value of the bufferstr is :' + bufferstr); @@ -1571,7 +1571,7 @@ export default function DeviceInfoTest() { let securityPatchTagInfo = deviceinfo.securityPatchTag; console.info('the value of the deviceinfo securityPatchTag is :' + securityPatchTagInfo); - let reFormat = /^(\d{4})-(\d{2})-(\d{2})$/; + let reFormat = /^(\d{4})\/(\d{2})\/(\d{2})$/; let re = securityPatchTagInfo.match(reFormat); if (re != null) { diff --git a/startup_lite/syspara_hal/src/deviceinfo_func_test.c b/startup_lite/syspara_hal/src/deviceinfo_func_test.c index aa1004b7c..8f89b6d3b 100644 --- a/startup_lite/syspara_hal/src/deviceinfo_func_test.c +++ b/startup_lite/syspara_hal/src/deviceinfo_func_test.c @@ -465,12 +465,12 @@ LITE_TEST_CASE(DeviceInfoFuncTestSuite, int year, month, day; const int RET_SUCCESS = 0; - int ret = sscanf_s(value, "%04d-%02d-%02d", &year, &month, &day); + 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); + printf("%04d\/%02d\/%02d\n", year, month, day); TEST_ASSERT_TRUE(year > 1900 && year < 2056); TEST_ASSERT_TRUE(month <= 12 && month > 0); -- GitLab