diff --git a/tests/compiler/branch_elimination_ecma_test.cpp b/tests/compiler/branch_elimination_ecma_test.cpp index a9c36da158e462c80dca7f1ad31bd471adef9759..1565e80cd033883749cfcd474935516230a4e4a2 100644 --- a/tests/compiler/branch_elimination_ecma_test.cpp +++ b/tests/compiler/branch_elimination_ecma_test.cpp @@ -21,9 +21,10 @@ namespace panda::compiler { class IrBranchEliminationTest : public AsmTest { public: - IrBranchEliminationTest() {} + IrBranchEliminationTest() = default; }; +// NOLINTBEGIN(readability-magic-numbers) TEST_F(IrBranchEliminationTest, EliminateCompareAnyTypeVNDiffTypesTrue) { auto graph = CreateGraphDynStubWithDefaultRuntime(); @@ -94,7 +95,7 @@ TEST_F(IrBranchEliminationTest, EliminateCompareAnyTypeVNDiffTypesTrue) EXPECT_TRUE(GraphComparator().Compare(graph, graph_opt)); } -TEST_F(IrBranchEliminationTest, EliminateCompareAnyTypeVNDiffTypesFalse_1) +TEST_F(IrBranchEliminationTest, EliminateCompareAnyTypeVNDiffTypesFalse1) { auto graph = CreateGraphDynStubWithDefaultRuntime(); GRAPH(graph) @@ -142,7 +143,7 @@ TEST_F(IrBranchEliminationTest, EliminateCompareAnyTypeVNDiffTypesFalse_1) EXPECT_TRUE(GraphComparator().Compare(graph, graph_opt)); } -TEST_F(IrBranchEliminationTest, EliminateCompareAnyTypeVNDiffTypesFalse_2) +TEST_F(IrBranchEliminationTest, EliminateCompareAnyTypeVNDiffTypesFalse2) { auto graph = CreateGraphDynStubWithDefaultRuntime(); GRAPH(graph) @@ -190,7 +191,7 @@ TEST_F(IrBranchEliminationTest, EliminateCompareAnyTypeVNDiffTypesFalse_2) EXPECT_TRUE(GraphComparator().Compare(graph, graph_opt)); } -TEST_F(IrBranchEliminationTest, EliminateCompareAnyTypeVNEqTypesTrue_1) +TEST_F(IrBranchEliminationTest, EliminateCompareAnyTypeVNEqTypesTrue1) { auto graph = CreateGraphDynStubWithDefaultRuntime(); GRAPH(graph) @@ -260,7 +261,7 @@ TEST_F(IrBranchEliminationTest, EliminateCompareAnyTypeVNEqTypesTrue_1) EXPECT_TRUE(GraphComparator().Compare(graph, graph_opt)); } -TEST_F(IrBranchEliminationTest, EliminateCompareAnyTypeVNEqTypesTrue_2) +TEST_F(IrBranchEliminationTest, EliminateCompareAnyTypeVNEqTypesTrue2) { auto graph = CreateGraphDynStubWithDefaultRuntime(); GRAPH(graph) @@ -330,7 +331,7 @@ TEST_F(IrBranchEliminationTest, EliminateCompareAnyTypeVNEqTypesTrue_2) EXPECT_TRUE(GraphComparator().Compare(graph, graph_opt)); } -TEST_F(IrBranchEliminationTest, EliminateCompareAnyTypeVNEqTypesTrue_3) +TEST_F(IrBranchEliminationTest, EliminateCompareAnyTypeVNEqTypesTrue3) { auto graph = CreateGraphDynStubWithDefaultRuntime(); GRAPH(graph) @@ -399,7 +400,7 @@ TEST_F(IrBranchEliminationTest, EliminateCompareAnyTypeVNEqTypesTrue_3) EXPECT_TRUE(GraphComparator().Compare(graph, graph_opt)); } -TEST_F(IrBranchEliminationTest, EliminateCompareAnyTypeSubtype_1) +TEST_F(IrBranchEliminationTest, EliminateCompareAnyTypeSubtype1) { auto graph = CreateGraphDynStubWithDefaultRuntime(); GRAPH(graph) @@ -469,7 +470,7 @@ TEST_F(IrBranchEliminationTest, EliminateCompareAnyTypeSubtype_1) EXPECT_TRUE(GraphComparator().Compare(graph, graph_opt)); } -TEST_F(IrBranchEliminationTest, EliminateCompareAnyTypeSubtype_2) +TEST_F(IrBranchEliminationTest, EliminateCompareAnyTypeSubtype2) { auto graph = CreateGraphDynStubWithDefaultRuntime(); GRAPH(graph) @@ -516,5 +517,6 @@ TEST_F(IrBranchEliminationTest, EliminateCompareAnyTypeSubtype_2) EXPECT_TRUE(GraphComparator().Compare(graph, graph_opt)); } +// NOLINTEND(readability-magic-numbers) } // namespace panda::compiler diff --git a/tests/compiler/checks_elimination_ecma_test.cpp b/tests/compiler/checks_elimination_ecma_test.cpp index 4572911116de7063b094a0d10cc89cbfb16e1e9a..57ab18329321df98929f464db8abbdeacfe0af31 100644 --- a/tests/compiler/checks_elimination_ecma_test.cpp +++ b/tests/compiler/checks_elimination_ecma_test.cpp @@ -21,9 +21,10 @@ namespace panda::compiler { class CheckEliminationEcmaTest : public AsmTest { public: - CheckEliminationEcmaTest() {} + CheckEliminationEcmaTest() = default; }; +// NOLINTBEGIN(readability-magic-numbers) TEST_F(CheckEliminationEcmaTest, EliminateAnyTypeCheckAfterCastValueToAnyType) { auto graph = CreateGraphDynWithDefaultRuntime(); @@ -396,4 +397,6 @@ TEST_F(CheckEliminationEcmaTest, EliminateAnyTypeCheckWithUndefinedType) EXPECT_TRUE(GraphComparator().Compare(graph, graph_opt)); } +// NOLINTEND(readability-magic-numbers) + } // namespace panda::compiler diff --git a/tests/compiler/codegen_ecma_test.cpp b/tests/compiler/codegen_ecma_test.cpp index 8df013bb09bc2b2fb679f91b822b100d6d9074d4..edf1ced515248913dd498ac96742ac7399a154fb 100644 --- a/tests/compiler/codegen_ecma_test.cpp +++ b/tests/compiler/codegen_ecma_test.cpp @@ -32,7 +32,10 @@ namespace panda::compiler { class CodegenEcmaTest : public GraphTest { public: CodegenEcmaTest() : exec_module_(GetAllocator(), GetGraph()->GetRuntime()) {} - ~CodegenEcmaTest() override {} + ~CodegenEcmaTest() override = default; + + NO_COPY_SEMANTIC(CodegenEcmaTest); + NO_MOVE_SEMANTIC(CodegenEcmaTest); void TestCompareAnyType(AnyBaseType any_type, uint64_t val, bool expected_value); void TestAnyTypeCheck(AnyBaseType any_type, uint64_t val); @@ -49,12 +52,10 @@ private: static bool RunCodegen(Graph *graph) { - if (!graph->RunPass()) { - return false; - } - return true; + return graph->RunPass(); } +// NOLINTBEGIN(readability-magic-numbers) template void CodegenEcmaTest::CheckReturnValue(Graph *graph, T expected_value) { @@ -63,7 +64,7 @@ void CodegenEcmaTest::CheckReturnValue(Graph *graph, T expected_value) ASSERT_TRUE(RunCodegen(graph)); auto code_entry = reinterpret_cast(graph->GetData().Data()); - auto code_exit = code_entry + graph->GetData().Size(); + auto code_exit = code_entry + graph->GetData().Size(); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic) ASSERT(code_entry != nullptr && code_exit != nullptr); @@ -93,12 +94,12 @@ void CodegenEcmaTest::TestCompareAnyType(AnyBaseType any_type, uint64_t val, boo CheckReturnValue(graph, expected_value); } -TEST_F(CodegenEcmaTest, CompareAnyTypeInstBoolTrue_1) +TEST_F(CodegenEcmaTest, CompareAnyTypeInstBoolTrue1) { TestCompareAnyType(AnyBaseType::ECMASCRIPT_BOOLEAN_TYPE, TaggedValue::VALUE_TRUE, true); } -TEST_F(CodegenEcmaTest, CompareAnyTypeInstBoolTrue_2) +TEST_F(CodegenEcmaTest, CompareAnyTypeInstBoolTrue2) { TestCompareAnyType(AnyBaseType::ECMASCRIPT_BOOLEAN_TYPE, TaggedValue::VALUE_FALSE, true); } @@ -113,12 +114,12 @@ TEST_F(CodegenEcmaTest, CompareAnyTypeInstDoubleTrue) TestCompareAnyType(AnyBaseType::ECMASCRIPT_DOUBLE_TYPE, TaggedValue::DOUBLE_ENCODE_OFFSET, true); } -TEST_F(CodegenEcmaTest, CompareAnyTypeInstDoubleFalse_1) +TEST_F(CodegenEcmaTest, CompareAnyTypeInstDoubleFalse1) { TestCompareAnyType(AnyBaseType::ECMASCRIPT_DOUBLE_TYPE, TaggedValue::TAG_INT, false); } -TEST_F(CodegenEcmaTest, CompareAnyTypeInstDoubleFalse_2) +TEST_F(CodegenEcmaTest, CompareAnyTypeInstDoubleFalse2) { TestCompareAnyType(AnyBaseType::ECMASCRIPT_DOUBLE_TYPE, TaggedValue::TAG_OBJECT + 1, false); } @@ -344,12 +345,12 @@ void CodegenEcmaTest::TestAnyTypeCheck(AnyBaseType any_type, uint64_t val) CheckReturnValue(graph, 1); } -TEST_F(CodegenEcmaTest, AnyTypeCheckInstBoolTrue_1) +TEST_F(CodegenEcmaTest, AnyTypeCheckInstBoolTrue1) { TestAnyTypeCheck(AnyBaseType::ECMASCRIPT_BOOLEAN_TYPE, TaggedValue::VALUE_TRUE); } -TEST_F(CodegenEcmaTest, AnyTypeCheckInstBoolTrue_2) +TEST_F(CodegenEcmaTest, AnyTypeCheckInstBoolTrue2) { TestAnyTypeCheck(AnyBaseType::ECMASCRIPT_BOOLEAN_TYPE, TaggedValue::VALUE_FALSE); } @@ -389,5 +390,6 @@ TEST_F(CodegenEcmaTest, AnyTypeCheckInstCommonUndefined) TestAnyTypeCheck(AnyBaseType::UNDEFINED_TYPE, TaggedValue::VALUE_NULL); TestAnyTypeCheck(AnyBaseType::UNDEFINED_TYPE, TaggedValue::VALUE_UNDEFINED); } +// NOLINTEND(readability-magic-numbers) } // namespace panda::compiler diff --git a/tests/compiler/ir_builder_ecma_test.cpp b/tests/compiler/ir_builder_ecma_test.cpp index 8ccf7ba63f6be1bb4685b633b99dcafb537087fe..9d2e397420a2d251787f7369b8aa6c8b52934085 100644 --- a/tests/compiler/ir_builder_ecma_test.cpp +++ b/tests/compiler/ir_builder_ecma_test.cpp @@ -19,7 +19,7 @@ namespace panda::compiler { class IrBuilderTest : public AsmTest { public: - IrBuilderTest() {} + IrBuilderTest() = default; }; TEST_F(IrBuilderTest, CompareAnyType) diff --git a/tests/compiler/lowering_ecma_test.cpp b/tests/compiler/lowering_ecma_test.cpp index 0ecea76f96ee9e989d837ab14999c0df2a8e8dc3..ead0edb02e8f3108a3a97fd1170b7ff7542989e2 100644 --- a/tests/compiler/lowering_ecma_test.cpp +++ b/tests/compiler/lowering_ecma_test.cpp @@ -22,9 +22,10 @@ namespace panda::compiler { class LoweringEcmaTest : public AsmTest { public: - LoweringEcmaTest() {} + LoweringEcmaTest() = default; }; +// NOLINTBEGIN(readability-magic-numbers) TEST_F(LoweringEcmaTest, CastValueToAnyTypeWithConst) { auto graph = CreateGraphDynWithDefaultRuntime(); @@ -100,4 +101,6 @@ TEST_F(LoweringEcmaTest, CastValueToAnyTypeWithSaveState) EXPECT_TRUE(GraphComparator().Compare(graph, graph_opt)); } +// NOLINTEND(readability-magic-numbers) + } // namespace panda::compiler diff --git a/tests/compiler/peepholes_ecma_test.cpp b/tests/compiler/peepholes_ecma_test.cpp index 956f754c6c47c66bee4728de9bfd241cb0890650..c11ee88e85d2c58617210ba82a57bf6b5498e721 100644 --- a/tests/compiler/peepholes_ecma_test.cpp +++ b/tests/compiler/peepholes_ecma_test.cpp @@ -22,9 +22,10 @@ namespace panda::compiler { class PeepholesTest : public AsmTest { public: - PeepholesTest() {} + PeepholesTest() = default; }; +// NOLINTBEGIN(readability-magic-numbers) TEST_F(PeepholesTest, CastTrueSimple) { auto graph = CreateGraphDynStubWithDefaultRuntime(); @@ -378,5 +379,6 @@ TEST_F(PeepholesTest, CompareCastToAnyAndConst) EXPECT_TRUE(GraphComparator().Compare(graph, graph_opt)); } +// NOLINTEND(readability-magic-numbers) } // namespace panda::compiler diff --git a/tests/compiler/types_resolving_ecma_tests.cpp b/tests/compiler/types_resolving_ecma_tests.cpp index 3d156833bc7f595bdab76c34763f0df6ebb507f9..90df3e086e8d74af3dd91c030d1c46f56df824ce 100644 --- a/tests/compiler/types_resolving_ecma_tests.cpp +++ b/tests/compiler/types_resolving_ecma_tests.cpp @@ -23,7 +23,7 @@ namespace panda::compiler { class TypeResolvingTest : public AsmTest { public: - TypeResolvingTest() {} + TypeResolvingTest() = default; Graph *ConstructGraphWithIntrinsic(RuntimeInterface::IntrinsicId id); Graph *ConstructGraphWithIntrinsic(AnyBaseType type, RuntimeInterface::IntrinsicId id); @@ -43,6 +43,7 @@ public: void TestLdConsts(TestArray tests); }; +// NOLINTBEGIN(readability-magic-numbers) template Graph *TypeResolvingTest::ConstructGraphWithConst(AnyBaseType any_type, T cnst) { @@ -581,4 +582,6 @@ TEST_F(TypeResolvingTest, ResolveLoopPhi) ASSERT_EQ(phi.GetType(), DataType::INT32); ASSERT_EQ(phi.GetInput(1U).GetInst(), &phi); } +// NOLINTEND(readability-magic-numbers) + } // namespace panda::compiler diff --git a/tests/compiler/unit_ecma_test.cpp b/tests/compiler/unit_ecma_test.cpp index 19d23b69000400079fca3477da19f7949221c0a5..4efae8b949a1151bcead9005cd94cbc2d572d4bf 100644 --- a/tests/compiler/unit_ecma_test.cpp +++ b/tests/compiler/unit_ecma_test.cpp @@ -37,7 +37,7 @@ namespace panda::compiler { void PandaRuntimeTest::Initialize([[maybe_unused]] int argc, char **argv) { ASSERT(argc > 0); - exec_path_ = argv[0]; + exec_path_ = argv[0]; // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic) } PandaRuntimeTest::PandaRuntimeTest() @@ -57,7 +57,7 @@ PandaRuntimeTest::PandaRuntimeTest() panda::RuntimeOptions runtime_options(exec_name); runtime_options.SetBootPandaFiles({pandastdlib_path}); runtime_options.SetLoadRuntimes({"ecmascript"}); - runtime_options.SetHeapSizeLimit(50_MB); + runtime_options.SetHeapSizeLimit(50_MB); // NOLINT(readability-magic-numbers) runtime_options.SetEnableAn(true); runtime_options.SetGcType("epsilon"); Logger::InitializeStdLogging(Logger::Level::ERROR, Logger::Component::COMPILER); diff --git a/tests/compiler/vn_test_ecma.cpp b/tests/compiler/vn_test_ecma.cpp index d6da4a7e7ec9910dedf186c8d28332881eda9bb0..2953b46e7cea5cff4d3d05b0357a2963f6baaabb 100644 --- a/tests/compiler/vn_test_ecma.cpp +++ b/tests/compiler/vn_test_ecma.cpp @@ -22,7 +22,7 @@ namespace panda::compiler { class VNTest : public AsmTest { public: - VNTest() {} + VNTest() = default; }; TEST_F(VNTest, CompareAnyTypeVNTrue)