Switch case to suite to follow new gtest naming.

Bug: 135528735

Test: All unit tests pass.
Change-Id: I1f3dc6fe381ec557b6b7bc5cb1c58d210efa63da
This commit is contained in:
Christopher Ferris 2019-06-20 16:16:42 -07:00
parent 2226fe6ddf
commit 7e21eba5b7
15 changed files with 73 additions and 71 deletions

View file

@ -1662,7 +1662,7 @@ TEST_P(ArmExidxDecodeTest, eval_pc_set) {
ASSERT_EQ(0x10U, (*exidx_->regs())[15]);
}
INSTANTIATE_TEST_CASE_P(, ArmExidxDecodeTest,
::testing::Values("logging", "register_logging", "no_logging"));
INSTANTIATE_TEST_SUITE_P(, ArmExidxDecodeTest,
::testing::Values("logging", "register_logging", "no_logging"));
} // namespace unwindstack

View file

@ -66,7 +66,7 @@ class DwarfCfaLogTest : public ::testing::Test {
DwarfCie cie_;
DwarfFde fde_;
};
TYPED_TEST_CASE_P(DwarfCfaLogTest);
TYPED_TEST_SUITE_P(DwarfCfaLogTest);
// NOTE: All class variable references have to be prefaced with this->.
@ -763,17 +763,17 @@ TYPED_TEST_P(DwarfCfaLogTest, cfa_register_override) {
ASSERT_EQ("", GetFakeLogBuf());
}
REGISTER_TYPED_TEST_CASE_P(DwarfCfaLogTest, cfa_illegal, cfa_nop, cfa_offset, cfa_offset_extended,
cfa_offset_extended_sf, cfa_restore, cfa_restore_extended, cfa_set_loc,
cfa_advance_loc, cfa_advance_loc1, cfa_advance_loc2, cfa_advance_loc4,
cfa_undefined, cfa_same, cfa_register, cfa_state,
cfa_state_cfa_offset_restore, cfa_def_cfa, cfa_def_cfa_sf,
cfa_def_cfa_register, cfa_def_cfa_offset, cfa_def_cfa_offset_sf,
cfa_def_cfa_expression, cfa_expression, cfa_val_offset,
cfa_val_offset_sf, cfa_val_expression, cfa_gnu_args_size,
cfa_gnu_negative_offset_extended, cfa_register_override);
REGISTER_TYPED_TEST_SUITE_P(DwarfCfaLogTest, cfa_illegal, cfa_nop, cfa_offset, cfa_offset_extended,
cfa_offset_extended_sf, cfa_restore, cfa_restore_extended, cfa_set_loc,
cfa_advance_loc, cfa_advance_loc1, cfa_advance_loc2, cfa_advance_loc4,
cfa_undefined, cfa_same, cfa_register, cfa_state,
cfa_state_cfa_offset_restore, cfa_def_cfa, cfa_def_cfa_sf,
cfa_def_cfa_register, cfa_def_cfa_offset, cfa_def_cfa_offset_sf,
cfa_def_cfa_expression, cfa_expression, cfa_val_offset,
cfa_val_offset_sf, cfa_val_expression, cfa_gnu_args_size,
cfa_gnu_negative_offset_extended, cfa_register_override);
typedef ::testing::Types<uint32_t, uint64_t> DwarfCfaLogTestTypes;
INSTANTIATE_TYPED_TEST_CASE_P(, DwarfCfaLogTest, DwarfCfaLogTestTypes);
INSTANTIATE_TYPED_TEST_SUITE_P(, DwarfCfaLogTest, DwarfCfaLogTestTypes);
} // namespace unwindstack

View file

@ -64,7 +64,7 @@ class DwarfCfaTest : public ::testing::Test {
DwarfCie cie_;
DwarfFde fde_;
};
TYPED_TEST_CASE_P(DwarfCfaTest);
TYPED_TEST_SUITE_P(DwarfCfaTest);
// NOTE: All test class variables need to be referenced as this->.
@ -952,16 +952,17 @@ TYPED_TEST_P(DwarfCfaTest, cfa_register_override) {
ASSERT_EQ("", GetFakeLogBuf());
}
REGISTER_TYPED_TEST_CASE_P(DwarfCfaTest, cfa_illegal, cfa_nop, cfa_offset, cfa_offset_extended,
cfa_offset_extended_sf, cfa_restore, cfa_restore_extended, cfa_set_loc,
cfa_advance_loc1, cfa_advance_loc2, cfa_advance_loc4, cfa_undefined,
cfa_same, cfa_register, cfa_state, cfa_state_cfa_offset_restore,
cfa_def_cfa, cfa_def_cfa_sf, cfa_def_cfa_register, cfa_def_cfa_offset,
cfa_def_cfa_offset_sf, cfa_def_cfa_expression, cfa_expression,
cfa_val_offset, cfa_val_offset_sf, cfa_val_expression, cfa_gnu_args_size,
cfa_gnu_negative_offset_extended, cfa_register_override);
REGISTER_TYPED_TEST_SUITE_P(DwarfCfaTest, cfa_illegal, cfa_nop, cfa_offset, cfa_offset_extended,
cfa_offset_extended_sf, cfa_restore, cfa_restore_extended, cfa_set_loc,
cfa_advance_loc1, cfa_advance_loc2, cfa_advance_loc4, cfa_undefined,
cfa_same, cfa_register, cfa_state, cfa_state_cfa_offset_restore,
cfa_def_cfa, cfa_def_cfa_sf, cfa_def_cfa_register, cfa_def_cfa_offset,
cfa_def_cfa_offset_sf, cfa_def_cfa_expression, cfa_expression,
cfa_val_offset, cfa_val_offset_sf, cfa_val_expression,
cfa_gnu_args_size, cfa_gnu_negative_offset_extended,
cfa_register_override);
typedef ::testing::Types<uint32_t, uint64_t> DwarfCfaTestTypes;
INSTANTIATE_TYPED_TEST_CASE_P(, DwarfCfaTest, DwarfCfaTestTypes);
INSTANTIATE_TYPED_TEST_SUITE_P(, DwarfCfaTest, DwarfCfaTestTypes);
} // namespace unwindstack

View file

@ -44,7 +44,7 @@ class DwarfDebugFrameTest : public ::testing::Test {
MemoryFake memory_;
DwarfDebugFrame<TypeParam>* debug_frame_ = nullptr;
};
TYPED_TEST_CASE_P(DwarfDebugFrameTest);
TYPED_TEST_SUITE_P(DwarfDebugFrameTest);
// NOTE: All test class variables need to be referenced as this->.
@ -812,7 +812,7 @@ TYPED_TEST_P(DwarfDebugFrameTest, GetFdeFromPc_interleaved) {
EXPECT_EQ(0xb50U, fde->pc_end);
}
REGISTER_TYPED_TEST_CASE_P(
REGISTER_TYPED_TEST_SUITE_P(
DwarfDebugFrameTest, GetFdes32, GetFdes32_after_GetFdeFromPc, GetFdes32_not_in_section,
GetFdeFromPc32, GetFdeFromPc32_reverse, GetFdeFromPc32_not_in_section, GetFdes64,
GetFdes64_after_GetFdeFromPc, GetFdes64_not_in_section, GetFdeFromPc64, GetFdeFromPc64_reverse,
@ -825,6 +825,6 @@ REGISTER_TYPED_TEST_CASE_P(
GetFdeFromOffset64_lsda_address, GetFdeFromPc_interleaved);
typedef ::testing::Types<uint32_t, uint64_t> DwarfDebugFrameTestTypes;
INSTANTIATE_TYPED_TEST_CASE_P(, DwarfDebugFrameTest, DwarfDebugFrameTestTypes);
INSTANTIATE_TYPED_TEST_SUITE_P(, DwarfDebugFrameTest, DwarfDebugFrameTestTypes);
} // namespace unwindstack

View file

@ -42,7 +42,7 @@ class DwarfEhFrameTest : public ::testing::Test {
MemoryFake memory_;
DwarfEhFrame<TypeParam>* eh_frame_ = nullptr;
};
TYPED_TEST_CASE_P(DwarfEhFrameTest);
TYPED_TEST_SUITE_P(DwarfEhFrameTest);
// NOTE: All test class variables need to be referenced as this->.
@ -125,9 +125,9 @@ TYPED_TEST_P(DwarfEhFrameTest, GetFdeCieFromOffset64) {
EXPECT_EQ(1U, cie->return_address_register);
}
REGISTER_TYPED_TEST_CASE_P(DwarfEhFrameTest, GetFdeCieFromOffset32, GetFdeCieFromOffset64);
REGISTER_TYPED_TEST_SUITE_P(DwarfEhFrameTest, GetFdeCieFromOffset32, GetFdeCieFromOffset64);
typedef ::testing::Types<uint32_t, uint64_t> DwarfEhFrameTestTypes;
INSTANTIATE_TYPED_TEST_CASE_P(, DwarfEhFrameTest, DwarfEhFrameTestTypes);
INSTANTIATE_TYPED_TEST_SUITE_P(, DwarfEhFrameTest, DwarfEhFrameTestTypes);
} // namespace unwindstack

View file

@ -73,7 +73,7 @@ class DwarfEhFrameWithHdrTest : public ::testing::Test {
MemoryFake memory_;
TestDwarfEhFrameWithHdr<TypeParam>* eh_frame_ = nullptr;
};
TYPED_TEST_CASE_P(DwarfEhFrameWithHdrTest);
TYPED_TEST_SUITE_P(DwarfEhFrameWithHdrTest);
// NOTE: All test class variables need to be referenced as this->.
@ -446,14 +446,14 @@ TYPED_TEST_P(DwarfEhFrameWithHdrTest, GetFdeFromPc_fde_not_found) {
ASSERT_EQ(nullptr, this->eh_frame_->GetFdeFromPc(0x800));
}
REGISTER_TYPED_TEST_CASE_P(DwarfEhFrameWithHdrTest, Init, Init_non_zero_load_bias, GetFdes,
GetFdeInfoFromIndex_expect_cache_fail, GetFdeInfoFromIndex_read_pcrel,
GetFdeInfoFromIndex_read_datarel, GetFdeInfoFromIndex_cached,
GetFdeOffsetFromPc_verify, GetFdeOffsetFromPc_index_fail,
GetFdeOffsetFromPc_fail_fde_count, GetFdeOffsetFromPc_search,
GetCieFde32, GetCieFde64, GetFdeFromPc_fde_not_found);
REGISTER_TYPED_TEST_SUITE_P(DwarfEhFrameWithHdrTest, Init, Init_non_zero_load_bias, GetFdes,
GetFdeInfoFromIndex_expect_cache_fail, GetFdeInfoFromIndex_read_pcrel,
GetFdeInfoFromIndex_read_datarel, GetFdeInfoFromIndex_cached,
GetFdeOffsetFromPc_verify, GetFdeOffsetFromPc_index_fail,
GetFdeOffsetFromPc_fail_fde_count, GetFdeOffsetFromPc_search,
GetCieFde32, GetCieFde64, GetFdeFromPc_fde_not_found);
typedef ::testing::Types<uint32_t, uint64_t> DwarfEhFrameWithHdrTestTypes;
INSTANTIATE_TYPED_TEST_CASE_P(, DwarfEhFrameWithHdrTest, DwarfEhFrameWithHdrTestTypes);
INSTANTIATE_TYPED_TEST_SUITE_P(, DwarfEhFrameWithHdrTest, DwarfEhFrameWithHdrTestTypes);
} // namespace unwindstack

View file

@ -48,7 +48,7 @@ class DwarfOpLogTest : public ::testing::Test {
std::unique_ptr<DwarfMemory> mem_;
std::unique_ptr<DwarfOp<TypeParam>> op_;
};
TYPED_TEST_CASE_P(DwarfOpLogTest);
TYPED_TEST_SUITE_P(DwarfOpLogTest);
TYPED_TEST_P(DwarfOpLogTest, multiple_ops) {
// Multi operation opcodes.
@ -65,9 +65,9 @@ TYPED_TEST_P(DwarfOpLogTest, multiple_ops) {
ASSERT_EQ(expected, lines);
}
REGISTER_TYPED_TEST_CASE_P(DwarfOpLogTest, multiple_ops);
REGISTER_TYPED_TEST_SUITE_P(DwarfOpLogTest, multiple_ops);
typedef ::testing::Types<uint32_t, uint64_t> DwarfOpLogTestTypes;
INSTANTIATE_TYPED_TEST_CASE_P(, DwarfOpLogTest, DwarfOpLogTestTypes);
INSTANTIATE_TYPED_TEST_SUITE_P(, DwarfOpLogTest, DwarfOpLogTestTypes);
} // namespace unwindstack

View file

@ -48,7 +48,7 @@ class DwarfOpTest : public ::testing::Test {
std::unique_ptr<DwarfMemory> mem_;
std::unique_ptr<DwarfOp<TypeParam>> op_;
};
TYPED_TEST_CASE_P(DwarfOpTest);
TYPED_TEST_SUITE_P(DwarfOpTest);
TYPED_TEST_P(DwarfOpTest, decode) {
// Memory error.
@ -1571,15 +1571,16 @@ TYPED_TEST_P(DwarfOpTest, is_dex_pc) {
EXPECT_FALSE(this->op_->dex_pc_set());
}
REGISTER_TYPED_TEST_CASE_P(DwarfOpTest, decode, eval, illegal_opcode, not_implemented, op_addr,
op_deref, op_deref_size, const_unsigned, const_signed, const_uleb,
const_sleb, op_dup, op_drop, op_over, op_pick, op_swap, op_rot, op_abs,
op_and, op_div, op_minus, op_mod, op_mul, op_neg, op_not, op_or, op_plus,
op_plus_uconst, op_shl, op_shr, op_shra, op_xor, op_bra,
compare_opcode_stack_error, compare_opcodes, op_skip, op_lit, op_reg,
op_regx, op_breg, op_breg_invalid_register, op_bregx, op_nop, is_dex_pc);
REGISTER_TYPED_TEST_SUITE_P(DwarfOpTest, decode, eval, illegal_opcode, not_implemented, op_addr,
op_deref, op_deref_size, const_unsigned, const_signed, const_uleb,
const_sleb, op_dup, op_drop, op_over, op_pick, op_swap, op_rot, op_abs,
op_and, op_div, op_minus, op_mod, op_mul, op_neg, op_not, op_or,
op_plus, op_plus_uconst, op_shl, op_shr, op_shra, op_xor, op_bra,
compare_opcode_stack_error, compare_opcodes, op_skip, op_lit, op_reg,
op_regx, op_breg, op_breg_invalid_register, op_bregx, op_nop,
is_dex_pc);
typedef ::testing::Types<uint32_t, uint64_t> DwarfOpTestTypes;
INSTANTIATE_TYPED_TEST_CASE_P(, DwarfOpTest, DwarfOpTestTypes);
INSTANTIATE_TYPED_TEST_SUITE_P(, DwarfOpTest, DwarfOpTestTypes);
} // namespace unwindstack

View file

@ -68,7 +68,7 @@ class DwarfSectionImplTest : public ::testing::Test {
MemoryFake memory_;
TestDwarfSectionImpl<TypeParam>* section_ = nullptr;
};
TYPED_TEST_CASE_P(DwarfSectionImplTest);
TYPED_TEST_SUITE_P(DwarfSectionImplTest);
// NOTE: All test class variables need to be referenced as this->.
@ -571,18 +571,18 @@ TYPED_TEST_P(DwarfSectionImplTest, Log) {
ASSERT_EQ("", GetFakeLogBuf());
}
REGISTER_TYPED_TEST_CASE_P(DwarfSectionImplTest, GetCieFromOffset_fail_should_not_cache,
GetFdeFromOffset_fail_should_not_cache, Eval_cfa_expr_eval_fail,
Eval_cfa_expr_no_stack, Eval_cfa_expr_is_register, Eval_cfa_expr,
Eval_cfa_val_expr, Eval_bad_regs, Eval_no_cfa, Eval_cfa_bad,
Eval_cfa_register_prev, Eval_cfa_register_from_value,
Eval_double_indirection, Eval_register_reference_chain, Eval_dex_pc,
Eval_invalid_register, Eval_different_reg_locations,
Eval_return_address_undefined, Eval_pc_zero, Eval_return_address,
Eval_ignore_large_reg_loc, Eval_reg_expr, Eval_reg_val_expr,
GetCfaLocationInfo_cie_not_cached, GetCfaLocationInfo_cie_cached, Log);
REGISTER_TYPED_TEST_SUITE_P(DwarfSectionImplTest, GetCieFromOffset_fail_should_not_cache,
GetFdeFromOffset_fail_should_not_cache, Eval_cfa_expr_eval_fail,
Eval_cfa_expr_no_stack, Eval_cfa_expr_is_register, Eval_cfa_expr,
Eval_cfa_val_expr, Eval_bad_regs, Eval_no_cfa, Eval_cfa_bad,
Eval_cfa_register_prev, Eval_cfa_register_from_value,
Eval_double_indirection, Eval_register_reference_chain, Eval_dex_pc,
Eval_invalid_register, Eval_different_reg_locations,
Eval_return_address_undefined, Eval_pc_zero, Eval_return_address,
Eval_ignore_large_reg_loc, Eval_reg_expr, Eval_reg_val_expr,
GetCfaLocationInfo_cie_not_cached, GetCfaLocationInfo_cie_cached, Log);
typedef ::testing::Types<uint32_t, uint64_t> DwarfSectionImplTestTypes;
INSTANTIATE_TYPED_TEST_CASE_P(, DwarfSectionImplTest, DwarfSectionImplTestTypes);
INSTANTIATE_TYPED_TEST_SUITE_P(, DwarfSectionImplTest, DwarfSectionImplTestTypes);
} // namespace unwindstack

View file

@ -31,7 +31,7 @@ namespace unwindstack {
class ElfCacheTest : public ::testing::Test {
protected:
static void SetUpTestCase() { memory_.reset(new MemoryFake); }
static void SetUpTestSuite() { memory_.reset(new MemoryFake); }
void SetUp() override { Elf::SetCachingEnabled(true); }

View file

@ -58,7 +58,7 @@ class MapInfoCreateMemoryTest : public ::testing::Test {
ASSERT_TRUE(android::base::WriteFully(fd, buffer.data(), buffer.size()));
}
static void SetUpTestCase() {
static void SetUpTestSuite() {
std::vector<uint8_t> buffer(12288, 0);
memcpy(buffer.data(), ELFMAG, SELFMAG);
buffer[EI_CLASS] = ELFCLASS32;

View file

@ -30,7 +30,7 @@ class MemoryOfflineBufferTest : public ::testing::Test {
memory_.reset(new MemoryOfflineBuffer(buffer_.data(), kStart, kEnd));
}
static void SetUpTestCase() {
static void SetUpTestSuite() {
buffer_.resize(kLength);
for (size_t i = 0; i < kLength; i++) {
buffer_[i] = i % 189;

View file

@ -236,7 +236,7 @@ std::vector<Register> ExpectedRegisters<RegsMips64>() {
}
using RegTypes = ::testing::Types<RegsArm, RegsArm64, RegsX86, RegsX86_64, RegsMips, RegsMips64>;
TYPED_TEST_CASE(RegsIterateTest, RegTypes);
TYPED_TEST_SUITE(RegsIterateTest, RegTypes);
TYPED_TEST(RegsIterateTest, iterate) {
std::vector<Register> expected = ExpectedRegisters<TypeParam>();

View file

@ -55,7 +55,7 @@ class SymbolsTest : public ::testing::Test {
MemoryFake memory_;
};
TYPED_TEST_CASE_P(SymbolsTest);
TYPED_TEST_SUITE_P(SymbolsTest);
TYPED_TEST_P(SymbolsTest, function_bounds_check) {
Symbols symbols(0x1000, sizeof(TypeParam), sizeof(TypeParam), 0x2000, 0x100);
@ -362,11 +362,11 @@ TYPED_TEST_P(SymbolsTest, get_global) {
EXPECT_EQ(4U, offset);
}
REGISTER_TYPED_TEST_CASE_P(SymbolsTest, function_bounds_check, no_symbol, multiple_entries,
multiple_entries_nonstandard_size, symtab_value_out_of_bounds,
symtab_read_cached, get_global);
REGISTER_TYPED_TEST_SUITE_P(SymbolsTest, function_bounds_check, no_symbol, multiple_entries,
multiple_entries_nonstandard_size, symtab_value_out_of_bounds,
symtab_read_cached, get_global);
typedef ::testing::Types<Elf32_Sym, Elf64_Sym> SymbolsTestTypes;
INSTANTIATE_TYPED_TEST_CASE_P(, SymbolsTest, SymbolsTestTypes);
INSTANTIATE_TYPED_TEST_SUITE_P(, SymbolsTest, SymbolsTestTypes);
} // namespace unwindstack

View file

@ -54,7 +54,7 @@ class UnwinderTest : public ::testing::Test {
}
}
static void SetUpTestCase() {
static void SetUpTestSuite() {
maps_.reset(new Maps);
ElfFake* elf = new ElfFake(new MemoryFake);