fix:EcmaVm_021_Test~ end Refactoring

Signed-off-by: qijinquan <qijinquan@kaihong.com>
This commit is contained in:
qijinquan 2024-04-25 09:54:53 +08:00
parent 33fff2371a
commit 43b5f0ab24
39 changed files with 39 additions and 985 deletions

View File

@ -20,7 +20,7 @@
using namespace panda::ecmascript;
namespace panda::test {
class EcmaStringTest : public testing::Test {
class EcmaStringTest : public BaseTestWithScope<false> {
public:
static void SetUpTestCase()
{
@ -32,25 +32,6 @@ public:
EXPECT_TRUE(EcmaString::CanBeCompressed(arrayU16Comp, sizeof(arrayU16Comp) / sizeof(arrayU16Comp[0])));
EXPECT_FALSE(EcmaString::CanBeCompressed(arrayU16NotComp, sizeof(arrayU16Comp) / sizeof(arrayU16Comp[0])));
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
TestHelper::CreateEcmaVMWithScope(ecmaVMPtr, thread, scope);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(ecmaVMPtr, scope);
}
EcmaVM *ecmaVMPtr {nullptr};
ecmascript::EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
};
/*

View File

@ -19,25 +19,7 @@
using namespace panda::ecmascript;
namespace panda::test {
class EcmaVMTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
}
void TearDown() override
{
}
class EcmaVMTest : public BaseTestWithOutScope {
};
/*

View File

@ -19,25 +19,7 @@
using namespace panda::ecmascript;
namespace panda::test {
class FrameTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
}
void TearDown() override
{
}
class FrameTest : public BaseTestWithOutScope {
};
/*

View File

@ -28,18 +28,8 @@ using namespace panda;
using namespace panda::ecmascript;
namespace panda::test {
class GCTest : public testing::Test {
class GCTest : public BaseTestWithScope<false> {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
JSRuntimeOptions options;
@ -52,15 +42,6 @@ public:
heap->GetConcurrentMarker()->EnableConcurrentMarking(EnableConcurrentMarkType::ENABLE);
heap->GetSweeper()->EnableConcurrentSweep(EnableConcurrentSweepType::ENABLE);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
ecmascript::EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
};
HWTEST_F_L0(GCTest, FullGCOne)

View File

@ -27,18 +27,8 @@ using namespace panda;
using namespace panda::ecmascript;
namespace panda::test {
class GCTest : public testing::Test {
class GCTest : public BaseTestWithScope<false> {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
JSRuntimeOptions options;
@ -51,15 +41,6 @@ public:
heap->GetConcurrentMarker()->EnableConcurrentMarking(EnableConcurrentMarkType::ENABLE);
heap->GetSweeper()->EnableConcurrentSweep(EnableConcurrentSweepType::ENABLE);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
ecmascript::EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
};
HWTEST_F_L0(GCTest, NativeGCTestConcurrentMarkDisabled)

View File

@ -27,18 +27,8 @@ using namespace panda;
using namespace panda::ecmascript;
namespace panda::test {
class GCTest : public testing::Test {
class GCTest : public BaseTestWithScope<false> {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
JSRuntimeOptions options;
@ -51,15 +41,6 @@ public:
heap->GetConcurrentMarker()->EnableConcurrentMarking(EnableConcurrentMarkType::ENABLE);
heap->GetSweeper()->EnableConcurrentSweep(EnableConcurrentSweepType::ENABLE);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
ecmascript::EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
};
HWTEST_F_L0(GCTest, HighSensitiveForceExpand)

View File

@ -21,31 +21,7 @@
using namespace panda::ecmascript;
namespace panda::test {
class GlobalDictionaryTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
TestHelper::CreateEcmaVMWithScope(instance, thread, scope);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
class GlobalDictionaryTest : public BaseTestWithScope<false> {
};
/**

View File

@ -20,42 +20,7 @@
using namespace panda::ecmascript;
namespace panda::test {
class JSCollatorTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
JSRuntimeOptions options;
#if PANDA_TARGET_LINUX
// for consistency requirement, use ohos_icu4j/data as icu-data-path
options.SetIcuDataPath(ICU_PATH);
#endif
options.SetEnableForceGC(true);
instance = JSNApi::CreateEcmaVM(options);
instance->SetEnableForceGC(true);
ASSERT_TRUE(instance != nullptr) << "Cannot create EcmaVM";
thread = instance->GetJSThread();
thread->ManagedCodeBegin();
scope = new EcmaHandleScope(thread);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
ecmascript::EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
class JSCollatorTest : public BaseTestWithScope<true> {
};
/**

View File

@ -22,30 +22,7 @@
using namespace panda::ecmascript;
namespace panda::test {
class JSDataViewTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
TestHelper::CreateEcmaVMWithScope(instance, thread, scope);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
ecmascript::EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
class JSDataViewTest : public BaseTestWithScope<false> {
};
/*

View File

@ -23,31 +23,7 @@
using namespace panda::ecmascript;
namespace panda::test {
class JSDateTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
TestHelper::CreateEcmaVMWithScope(instance, thread, scope);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
ecmascript::EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
class JSDateTest : public BaseTestWithScope<false> {
};
JSDate *JSDateCreate(JSThread *thread)

View File

@ -27,42 +27,7 @@ using namespace panda::ecmascript::base;
using LocaleHelper = panda::ecmascript::intl::LocaleHelper;
namespace panda::test {
class JSDateTimeFormatTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
JSRuntimeOptions options;
#if PANDA_TARGET_LINUX
// for consistency requirement, use ohos_icu4j/data as icu-data-path
options.SetIcuDataPath(ICU_PATH);
#endif
options.SetEnableForceGC(true);
instance = JSNApi::CreateEcmaVM(options);
instance->SetEnableForceGC(true);
ASSERT_TRUE(instance != nullptr) << "Cannot create EcmaVM";
thread = instance->GetJSThread();
thread->ManagedCodeBegin();
scope = new EcmaHandleScope(thread);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
class JSDateTimeFormatTest : public BaseTestWithScope<true> {
};
void SetDateOptionsTest(JSThread *thread, JSHandle<JSObject> &optionsObj,

View File

@ -27,42 +27,7 @@ using namespace panda::ecmascript::base;
using LocaleHelper = panda::ecmascript::intl::LocaleHelper;
namespace panda::test {
class JSDateTimeFormatTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
JSRuntimeOptions options;
#if PANDA_TARGET_LINUX
// for consistency requirement, use ohos_icu4j/data as icu-data-path
options.SetIcuDataPath(ICU_PATH);
#endif
options.SetEnableForceGC(true);
instance = JSNApi::CreateEcmaVM(options);
instance->SetEnableForceGC(true);
ASSERT_TRUE(instance != nullptr) << "Cannot create EcmaVM";
thread = instance->GetJSThread();
thread->ManagedCodeBegin();
scope = new EcmaHandleScope(thread);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
class JSDateTimeFormatTest : public BaseTestWithScope<true> {
};
JSHandle<JSDateTimeFormat> CreateDateTimeFormatTest(JSThread *thread, icu::Locale icuLocale, JSHandle<JSObject> options)

View File

@ -26,31 +26,7 @@ using namespace panda;
using namespace panda::ecmascript;
namespace panda::test {
class JSHClassTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
TestHelper::CreateEcmaVMWithScope(instance, thread, scope);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
class JSHClassTest : public BaseTestWithScope<false> {
};
HWTEST_F_L0(JSHClassTest, InitializeClass)

View File

@ -31,31 +31,7 @@ using namespace panda;
using namespace panda::ecmascript;
namespace panda::test {
class JSIteratorTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
TestHelper::CreateEcmaVMWithScope(instance, thread, scope);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
ecmascript::EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
class JSIteratorTest : public BaseTestWithScope<false> {
};
HWTEST_F_L0(JSIteratorTest, GetIterator)

View File

@ -24,42 +24,7 @@
using namespace panda::ecmascript;
namespace panda::test {
class JSListFormatTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
JSRuntimeOptions options;
#if PANDA_TARGET_LINUX
// for consistency requirement, use ohos_icu4j/data/icudt67l.dat as icu-data-path
options.SetIcuDataPath(ICU_PATH);
#endif
options.SetEnableForceGC(true);
instance = JSNApi::CreateEcmaVM(options);
instance->SetEnableForceGC(true);
ASSERT_TRUE(instance != nullptr) << "Cannot create EcmaVM";
thread = instance->GetJSThread();
thread->ManagedCodeBegin();
scope = new EcmaHandleScope(thread);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
ecmascript::EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
class JSListFormatTest : public BaseTestWithScope<true> {
};
HWTEST_F_L0(JSListFormatTest, Set_Get_IcuListFormatter_001)

View File

@ -24,42 +24,7 @@
using namespace panda::ecmascript;
namespace panda::test {
class JSLocaleTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
JSRuntimeOptions options;
#if PANDA_TARGET_LINUX
// for consistency requirement, use ohos_icu4j/data as icu-data-path
options.SetIcuDataPath(ICU_PATH);
#endif
options.SetEnableForceGC(true);
instance = JSNApi::CreateEcmaVM(options);
instance->SetEnableForceGC(true);
ASSERT_TRUE(instance != nullptr) << "Cannot create EcmaVM";
thread = instance->GetJSThread();
thread->ManagedCodeBegin();
scope = new EcmaHandleScope(thread);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
ecmascript::EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
class JSLocaleTest : public BaseTestWithScope<true> {
};
void CreateLanguageIterator(std::vector<std::string>& languageTemp)

View File

@ -30,31 +30,7 @@ using namespace panda::ecmascript;
using namespace panda::ecmascript::base;
namespace panda::test {
class MemControllerTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
TestHelper::CreateEcmaVMWithScope(instance, thread, scope);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
class MemControllerTest : public BaseTestWithScope<false> {
};
HWTEST_F_L0(MemControllerTest, AllocationVerify)

View File

@ -27,31 +27,7 @@ namespace panda::test {
constexpr size_t HUGE_OBJECT_CAPACITY = 1024_MB;
class MemMapAllocatorTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
TestHelper::CreateEcmaVMWithScope(instance, thread, scope);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
class MemMapAllocatorTest : public BaseTestWithScope<false> {
};
HWTEST_F_L0(MemMapAllocatorTest, GetMemFromList)

View File

@ -27,31 +27,7 @@ using namespace panda::ecmascript;
using FunctionPtr = void (*)(panda::ecmascript::JSHandle<EcmaString> &);
namespace panda::test {
class NativePointerTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
TestHelper::CreateEcmaVMWithScope(instance, thread, scope);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
ecmascript::EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
class NativePointerTest : public BaseTestWithScope<false> {
};
HWTEST_F_L0(NativePointerTest, Print)

View File

@ -32,31 +32,7 @@ using namespace panda;
using namespace panda::ecmascript;
namespace panda::test {
class ObjectFactoryTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
TestHelper::CreateEcmaVMWithScope(instance, thread, scope);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
ecmascript::EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
class ObjectFactoryTest : public BaseTestWithScope<false> {
};
JSHandle<GlobalEnv> GetGlobal(JSThread *thread)

View File

@ -26,31 +26,7 @@
using namespace panda::ecmascript;
namespace panda::test {
class ObjectOperatorTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
TestHelper::CreateEcmaVMWithScope(instance, thread, scope);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
ecmascript::EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
class ObjectOperatorTest : public BaseTestWithScope<false> {
};
HWTEST_F_L0(ObjectOperatorTest, SetAttr)

View File

@ -26,31 +26,7 @@
using namespace panda::ecmascript;
namespace panda::test {
class ObjectOperatorTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
TestHelper::CreateEcmaVMWithScope(instance, thread, scope);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
ecmascript::EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
class ObjectOperatorTest : public BaseTestWithScope<false> {
};
JSTaggedValue TestDefinedSetter([[maybe_unused]] EcmaRuntimeCallInfo *argv)

View File

@ -26,31 +26,7 @@
using namespace panda::ecmascript;
namespace panda::test {
class ObjectOperatorTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
TestHelper::CreateEcmaVMWithScope(instance, thread, scope);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
ecmascript::EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
class ObjectOperatorTest : public BaseTestWithScope<false> {
};
JSTaggedValue TestDefinedSetter([[maybe_unused]] EcmaRuntimeCallInfo *argv)

View File

@ -26,32 +26,8 @@
using namespace panda;
using namespace panda::ecmascript;
namespace panda::test {
class RBTreeNodeTest : public testing::Test {
class RBTreeNodeTest : public BaseTestWithScope<false> {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
TestHelper::CreateEcmaVMWithScope(instance, thread, scope);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
JSHandle<GlobalEnv> GetGlobalEnv()
{
EcmaVM *ecma = thread->GetEcmaVM();

View File

@ -30,18 +30,8 @@
using namespace panda::ecmascript;
namespace panda::test {
class ReadOnlySpaceTest : public testing::Test {
class ReadOnlySpaceTest : public BaseTestWithScope<false> {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
InitializeLogger();
@ -57,15 +47,7 @@ public:
ecmascript::Log::Initialize(runtimeOptions);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
JSThread *thread {nullptr};
ObjectFactory *factory {nullptr};
EcmaVM *instance {nullptr};
ecmascript::EcmaHandleScope *scope {nullptr};
};
static sigjmp_buf g_env;

View File

@ -24,30 +24,7 @@
using namespace panda::ecmascript;
namespace panda::test {
class SymbolTableTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
TestHelper::CreateEcmaVMWithScope(instance, thread, scope);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
ecmascript::EcmaHandleScope *scope {nullptr};
EcmaVM *instance {nullptr};
JSThread *thread {nullptr};
class SymbolTableTest : public BaseTestWithScope<false> {
};
HWTEST_F_L0(SymbolTableTest, GetKeyIndex)

View File

@ -20,31 +20,7 @@
using namespace panda::ecmascript;
namespace panda::test {
class TaggedArrayTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
TestHelper::CreateEcmaVMWithScope(instance, thread, scope);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
class TaggedArrayTest : public BaseTestWithScope<false> {
};
static JSObject *JSArrayTestCreate(JSThread *thread)

View File

@ -22,31 +22,7 @@ using namespace panda;
using namespace panda::ecmascript;
namespace panda::test {
class TaggedDictionaryTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
TestHelper::CreateEcmaVMWithScope(instance, thread, scope);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
class TaggedDictionaryTest : public BaseTestWithScope<false> {
};
static JSHandle<GlobalEnv> GetGlobalEnv(JSThread *thread)

View File

@ -21,31 +21,7 @@ using namespace panda;
using namespace panda::ecmascript;
namespace panda::test {
class TaggedHashArrayTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
TestHelper::CreateEcmaVMWithScope(instance, thread, scope);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
class TaggedHashArrayTest : public BaseTestWithScope<false> {
};
/**

View File

@ -29,32 +29,8 @@ using namespace panda;
using namespace panda::ecmascript;
namespace panda::test {
class TaggedTreeTest : public testing::Test {
class TaggedTreeTest : public BaseTestWithScope<false> {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
TestHelper::CreateEcmaVMWithScope(instance, thread, scope);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
JSHandle<GlobalEnv> GetGlobalEnv()
{
EcmaVM *ecma = thread->GetEcmaVM();

View File

@ -30,31 +30,7 @@
using namespace panda::ecmascript;
namespace panda::test {
class JSTaggedValueTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
TestHelper::CreateEcmaVMWithScope(instance, thread, scope);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
ecmascript::EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
class JSTaggedValueTest : public BaseTestWithScope<false> {
};
HWTEST_F_L0(JSTaggedValueTest, Double)

View File

@ -21,31 +21,7 @@ using namespace panda;
using namespace panda::ecmascript;
namespace panda::test {
class TemplateMapTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
TestHelper::CreateEcmaVMWithScope(instance, thread, scope);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
ecmascript::EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
class TemplateMapTest : public BaseTestWithScope<false> {
};
/*

View File

@ -24,31 +24,7 @@ using namespace panda::ecmascript;
namespace panda::test {
using BuiltinsString = ecmascript::builtins::BuiltinsString;
class TemplateStringTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
TestHelper::CreateEcmaVMWithScope(instance, thread, scope);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
class TemplateStringTest : public BaseTestWithScope<false> {
};
/*

View File

@ -24,33 +24,14 @@
using namespace panda::ecmascript;
namespace panda::test {
class ThrowOOMErrorTest : public testing::Test {
class ThrowOOMErrorTest : public BaseTestWithScope<false> {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
TestHelper::CreateEcmaVMWithScope(instance, thread, scope);
thread->GetEcmaVM()->SetEnableForceGC(false);
const_cast<Heap *>(thread->GetEcmaVM()->GetHeap())->SetMarkType(MarkType::MARK_FULL);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
JSThread *thread {nullptr};
EcmaVM *instance {nullptr};
ecmascript::EcmaHandleScope *scope {nullptr};
};
HWTEST_F_L0(ThrowOOMErrorTest, ThrowNonMovableOOMError)

View File

@ -24,31 +24,7 @@
using namespace panda::ecmascript;
namespace panda::test {
class TransitionsDictionaryTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
TestHelper::CreateEcmaVMWithScope(instance, thread, scope);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
class TransitionsDictionaryTest : public BaseTestWithScope<false> {
};
HWTEST_F_L0(TransitionsDictionaryTest, IsMatch)

View File

@ -20,31 +20,7 @@ using namespace panda;
using namespace panda::ecmascript;
namespace panda::test {
class WaiterListTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
TestHelper::CreateEcmaVMWithScope(instance, thread, scope);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
class WaiterListTest : public BaseTestWithScope<false> {
};
static WaiterListNode *CreateListNode(JSThread *thread, uint32_t bufferLength)

View File

@ -23,31 +23,7 @@
using namespace panda::ecmascript;
namespace panda::test {
class WeakRefOldGCTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
TestHelper::CreateEcmaVMWithScope(instance, thread, scope);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
class WeakRefOldGCTest : public BaseTestWithScope<false> {
};
static JSObject *JSObjectTestCreate(JSThread *thread)

View File

@ -23,31 +23,7 @@
using namespace panda::ecmascript;
namespace panda::test {
class WeakRefSemiGCTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
TestHelper::CreateEcmaVMWithScope(instance, thread, scope);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
class WeakRefSemiGCTest : public BaseTestWithScope<false> {
};
static JSObject *JSObjectTestCreate(JSThread *thread)

View File

@ -21,31 +21,7 @@ using namespace panda;
using namespace panda::ecmascript;
namespace panda::test {
class WeakVectorTest : public testing::Test {
public:
static void SetUpTestCase()
{
GTEST_LOG_(INFO) << "SetUpTestCase";
}
static void TearDownTestCase()
{
GTEST_LOG_(INFO) << "TearDownCase";
}
void SetUp() override
{
TestHelper::CreateEcmaVMWithScope(instance, thread, scope);
}
void TearDown() override
{
TestHelper::DestroyEcmaVMWithScope(instance, scope);
}
EcmaVM *instance {nullptr};
EcmaHandleScope *scope {nullptr};
JSThread *thread {nullptr};
class WeakVectorTest : public BaseTestWithScope<false> {
};
/**