diff --git a/interfaces/innerkits/client/appspawn_client.h b/interfaces/innerkits/client/appspawn_client.h index b979e2b6385059c68faf21d10917388e73bb166b..20edaf469e090c1c09f55563778991689e9dd6a4 100644 --- a/interfaces/innerkits/client/appspawn_client.h +++ b/interfaces/innerkits/client/appspawn_client.h @@ -29,6 +29,9 @@ extern "C" { #ifdef ASAN_DETECTOR #define TIMEOUT_DEF 60 #define ASAN_TIMEOUT 60 +#elif APPSPAWN_TEST +#define TIMEOUT_DEF 2 +#define ASAN_TIMEOUT 2 #else #define TIMEOUT_DEF 2 #define ASAN_TIMEOUT 10 diff --git a/test/mock/app_spawn_stub.cpp b/test/mock/app_spawn_stub.cpp index 5de78bf44ed9a0c48bbe465625b96bb6b2fe8494..df47d8422f107b07c924af223bb5fa5650fab764 100644 --- a/test/mock/app_spawn_stub.cpp +++ b/test/mock/app_spawn_stub.cpp @@ -120,21 +120,11 @@ void SetDeveloperMode(bool mode) int GetParameter(const char *key, const char *def, char *value, uint32_t len) { - static uint32_t count = 0; - count++; if (strcmp(key, "startup.appspawn.cold.boot") == 0) { return strcpy_s(value, len, "true") == 0 ? strlen("true") : -1; } if (strcmp(key, "persist.appspawn.reqMgr.timeout") == 0) { - const char *tmp = def; - if ((count % 3) == 0) { // 3 test - return -1; - } else if ((count % 3) == 1) { // 3 test - tmp = "a"; - } else { - tmp = "5"; - } - return strcpy_s(value, len, tmp) == 0 ? strlen(tmp) : -1; + return strcpy_s(value, len, "2") == 0 ? strlen("2") : -1; // #ifdef APPSPAWN_TEST #define ASAN_TIMEOUT 2 } if (strcmp(key, "const.security.developermode.state") == 0) { return g_developerMode ? (strcpy_s(value, len, "true") == 0 ? strlen("true") : -1) : -1;