!7711 fix tdd testcases for srtring cache

Merge pull request !7711 from shilei91/master
This commit is contained in:
openharmony_ci 2024-06-07 03:17:38 +00:00 committed by Gitee
commit b73cf5d7c4
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 5 additions and 5 deletions

View File

@ -134,7 +134,7 @@ protected:
void JSNApiTests::RegisterStringCacheTable()
{
constexpr uint32_t STRING_CACHE_TABLE_SIZE = 1000;
constexpr uint32_t STRING_CACHE_TABLE_SIZE = 100;
auto res = ExternalStringCache::RegisterStringCacheTable(vm_, STRING_CACHE_TABLE_SIZE);
if (isStringCacheTableCreated_) {
ASSERT_FALSE(res);
@ -1245,14 +1245,14 @@ HWTEST_F_L0(JSNApiTests, NapiExternalStringCacheTest001)
HWTEST_F_L0(JSNApiTests, NapiExternalStringCacheTest002)
{
constexpr uint32_t STRING_CACHE_TABLE_SIZE = 3000;
constexpr uint32_t STRING_CACHE_TABLE_SIZE = 300;
isStringCacheTableCreated_ = ExternalStringCache::RegisterStringCacheTable(vm_, STRING_CACHE_TABLE_SIZE);
ASSERT_FALSE(isStringCacheTableCreated_);
}
HWTEST_F_L0(JSNApiTests, NapiExternalStringCacheTest003)
{
constexpr uint32_t STRING_CACHE_TABLE_SIZE = 1000;
constexpr uint32_t STRING_CACHE_TABLE_SIZE = 100;
isStringCacheTableCreated_ = ExternalStringCache::RegisterStringCacheTable(vm_, STRING_CACHE_TABLE_SIZE);
ASSERT_TRUE(isStringCacheTableCreated_);
}
@ -1260,7 +1260,7 @@ HWTEST_F_L0(JSNApiTests, NapiExternalStringCacheTest003)
HWTEST_F_L0(JSNApiTests, NapiExternalStringCacheTest004)
{
RegisterStringCacheTable();
constexpr uint32_t PROPERTY_INDEX = 1001;
constexpr uint32_t PROPERTY_INDEX = 101;
constexpr char property[] = "hello";
auto res = ExternalStringCache::SetCachedString(vm_, property, PROPERTY_INDEX);
ASSERT_FALSE(res);

View File

@ -132,7 +132,7 @@ public:
inline bool CreateStringCacheTable(uint32_t size)
{
constexpr int32_t MAX_SIZE = 2000;
constexpr int32_t MAX_SIZE = 150;
if ((size == 0) || (size > MAX_SIZE) || (externalRegisteredStringTable_ != nullptr)) {
LOG_ECMA(ERROR) << "invalid size of the string cache table or the table has been registered.";
LOG_ECMA(ERROR) << "Currently, maximum size of the table is " << MAX_SIZE;