Skip to content

Commit

Permalink
unitTests: fix old API usage
Browse files Browse the repository at this point in the history
Found with google-upgrade-googletest-case

Signed-off-by: Rosen Penev <[email protected]>
  • Loading branch information
neheb committed Feb 13, 2023
1 parent c94d0aa commit 785a9ed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions unitTests/test_XmpKey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ const std::string notRegisteredValidKey("Xmp.noregistered.prop");
// behavior of the XmpKey class
class AXmpKey : public testing::Test {
public:
static void SetUpTestCase() {
static void SetUpTestSuite() {
XmpProperties::registerNs(expectedFamily, expectedPrefix);
}

static void TearDownTestCase() {
static void TearDownTestSuite() {
XmpProperties::unregisterNs();
}

Expand Down
24 changes: 12 additions & 12 deletions unitTests/test_slice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ const std::vector<int>& get_test_data<const std::vector<int>>(slice<const std::v
template <typename T>
class mutableSlice : public slice<T> {};

TYPED_TEST_CASE_P(slice);
TYPED_TEST_CASE_P(mutableSlice);
TYPED_TEST_SUITE_P(slice);
TYPED_TEST_SUITE_P(mutableSlice);

TYPED_TEST_P(slice, atAccess) {
// typedef Slice<TypeParam> slice_t;
Expand Down Expand Up @@ -355,7 +355,7 @@ struct dataBufSlice : public ::testing::Test {
template <typename T>
byte dataBufSlice<T>::data[4] = {0xde, 0xad, 0xbe, 0xef};

TYPED_TEST_CASE_P(dataBufSlice);
TYPED_TEST_SUITE_P(dataBufSlice);

TYPED_TEST_P(dataBufSlice, successfulConstruction) {
// just check that makeSlice appears to work
Expand All @@ -375,18 +375,18 @@ TYPED_TEST_P(dataBufSlice, failedConstruction) {
//
// GTest boilerplate to get the tests running for all the different types
//
REGISTER_TYPED_TEST_CASE_P(slice, atAccess, iteratorAccess, constructionFailsFromInvalidRange,
constructionFailsWithZeroLength, subSliceSuccessfulConstruction, subSliceFunctions,
subSliceFailedConstruction, subSliceConstructionOverflowResistance,
constMethodsPreserveConst);
REGISTER_TYPED_TEST_SUITE_P(slice, atAccess, iteratorAccess, constructionFailsFromInvalidRange,
constructionFailsWithZeroLength, subSliceSuccessfulConstruction, subSliceFunctions,
subSliceFailedConstruction, subSliceConstructionOverflowResistance,
constMethodsPreserveConst);

using test_types_t = ::testing::Types<const std::vector<int>, std::vector<int>, int*, const int*>;
INSTANTIATE_TYPED_TEST_CASE_P(slice, slice, test_types_t);
INSTANTIATE_TYPED_TEST_SUITE_P(slice, slice, test_types_t);

REGISTER_TYPED_TEST_CASE_P(mutableSlice, iterators, at);
REGISTER_TYPED_TEST_SUITE_P(mutableSlice, iterators, at);
using mut_test_types_t = ::testing::Types<std::vector<int>, int*>;
INSTANTIATE_TYPED_TEST_CASE_P(slice, mutableSlice, mut_test_types_t);
INSTANTIATE_TYPED_TEST_SUITE_P(slice, mutableSlice, mut_test_types_t);

REGISTER_TYPED_TEST_CASE_P(dataBufSlice, successfulConstruction, failedConstruction);
REGISTER_TYPED_TEST_SUITE_P(dataBufSlice, successfulConstruction, failedConstruction);
using data_buf_types_t = ::testing::Types<DataBuf&, const DataBuf&>;
INSTANTIATE_TYPED_TEST_CASE_P(slice, dataBufSlice, data_buf_types_t);
INSTANTIATE_TYPED_TEST_SUITE_P(slice, dataBufSlice, data_buf_types_t);

0 comments on commit 785a9ed

Please sign in to comment.