mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-10-07 08:03:29 +00:00
!7711 fix tdd testcases for srtring cache
Merge pull request !7711 from shilei91/master
This commit is contained in:
commit
b73cf5d7c4
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user