Skip to content

Commit

Permalink
Update google test to 1.12.1 (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
peddie authored Dec 12, 2022
1 parent 658607a commit e9354bf
Show file tree
Hide file tree
Showing 16 changed files with 52 additions and 52 deletions.
6 changes: 3 additions & 3 deletions tests/test_apply.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ typedef ::testing::Types<SquareClassMethodApply, SquareFunctionPointerApply,
SquareFunctionApply, SquareLambdaApply>
ApplyTestCases;

TYPED_TEST_CASE_P(ApplyTester);
TYPED_TEST_SUITE_P(ApplyTester);

TYPED_TEST_P(ApplyTester, test_apply_sanity) {
auto parent = this->test_case.get_parent();
Expand All @@ -102,9 +102,9 @@ TYPED_TEST_P(ApplyTester, test_apply_sanity) {
EXPECT_EQ(expected, actual);
}

REGISTER_TYPED_TEST_CASE_P(ApplyTester, test_apply_sanity);
REGISTER_TYPED_TEST_SUITE_P(ApplyTester, test_apply_sanity);

INSTANTIATE_TYPED_TEST_CASE_P(test_apply, ApplyTester, ApplyTestCases);
INSTANTIATE_TYPED_TEST_SUITE_P(test_apply, ApplyTester, ApplyTestCases);

TEST(test_apply, test_vector_apply_free_function) {

Expand Down
2 changes: 1 addition & 1 deletion tests/test_call_trace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ typedef ::testing::Types<SumXandXY, SumXandY, SumSumXandYandXY, ProdXandXY,
ProdSumXandXYProdXandXY>
TestFunctions;

TYPED_TEST_CASE(TestCallTreeCovarianceFunctions, TestFunctions);
TYPED_TEST_SUITE(TestCallTreeCovarianceFunctions, TestFunctions);

TYPED_TEST(TestCallTreeCovarianceFunctions, prints_call_trace) {
X x;
Expand Down
16 changes: 8 additions & 8 deletions tests/test_core_distribution.cc
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,13 @@ TYPED_TEST_P(DistributionTest, test_subtract) {
EXPECT_EQ(actual, expected);
};

REGISTER_TYPED_TEST_CASE_P(DistributionTest, test_subset,
test_multiply_with_matrix_joint,
test_multiply_with_matrix_marginal,
test_multiply_with_sparse_matrix_joint,
test_multiply_with_sparse_matrix_marginal,
test_multiply_with_vector, test_multiply_by_scalar,
test_add, test_subtract);
REGISTER_TYPED_TEST_SUITE_P(DistributionTest, test_subset,
test_multiply_with_matrix_joint,
test_multiply_with_matrix_marginal,
test_multiply_with_sparse_matrix_joint,
test_multiply_with_sparse_matrix_marginal,
test_multiply_with_vector, test_multiply_by_scalar,
test_add, test_subtract);

Eigen::VectorXd arange(int k = 5) {
Eigen::VectorXd mean(k);
Expand Down Expand Up @@ -203,6 +203,6 @@ struct JointWithCovariance : public DistributionTestCase<JointDistribution> {

typedef ::testing::Types<MarginalWithCovariance, JointWithCovariance> ToTest;

INSTANTIATE_TYPED_TEST_CASE_P(Albatross, DistributionTest, ToTest);
INSTANTIATE_TYPED_TEST_SUITE_P(Albatross, DistributionTest, ToTest);

} // namespace albatross
2 changes: 1 addition & 1 deletion tests/test_core_distribution.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ struct DistributionTest : public ::testing::Test {
typedef typename Distribution::RepresentationType Representation;
};

TYPED_TEST_CASE_P(DistributionTest);
TYPED_TEST_SUITE_P(DistributionTest);
} // namespace albatross
8 changes: 4 additions & 4 deletions tests/test_covariance_functions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ typedef ::testing::Types<
Exponential<RadialDistance>>
VectorCompatibleCovarianceFunctions;

TYPED_TEST_CASE(TestVectorCovarianceFunctions,
VectorCompatibleCovarianceFunctions);
TYPED_TEST_SUITE(TestVectorCovarianceFunctions,
VectorCompatibleCovarianceFunctions);

TYPED_TEST(TestVectorCovarianceFunctions, WorksWithEigen) {
const auto xs = points_on_a_line(5);
Expand Down Expand Up @@ -190,8 +190,8 @@ typedef ::testing::Types<
SumOfCovarianceFunctions<IndependentNoise<double>, DummyCovariance>>
DoubleCompatibleCovarianceFunctions;

TYPED_TEST_CASE(TestDoubleCovarianceFunctions,
DoubleCompatibleCovarianceFunctions);
TYPED_TEST_SUITE(TestDoubleCovarianceFunctions,
DoubleCompatibleCovarianceFunctions);

TYPED_TEST(TestDoubleCovarianceFunctions, works_with_eigen) {
const auto xs = points_on_a_line(5);
Expand Down
12 changes: 6 additions & 6 deletions tests/test_cross_validation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ TYPED_TEST_P(RegressionModelTester, test_score_variants) {
}
}

REGISTER_TYPED_TEST_CASE_P(RegressionModelTester, test_loo_predict_variants,
test_logo_predict_variants, test_loo_get_predictions,
test_score_variants);
REGISTER_TYPED_TEST_SUITE_P(RegressionModelTester, test_loo_predict_variants,
test_logo_predict_variants,
test_loo_get_predictions, test_score_variants);

INSTANTIATE_TYPED_TEST_CASE_P(test_cross_validation, RegressionModelTester,
ExampleModels);
INSTANTIATE_TYPED_TEST_SUITE_P(test_cross_validation, RegressionModelTester,
ExampleModels);

/*
* Here we build two different datasets. Each dataset consists of targets
Expand Down Expand Up @@ -234,7 +234,7 @@ class SpecializedCrossValidationTester : public ::testing::Test {
typedef ::testing::Types<MakeLargeGaussianProcess,
MakeLargeAdaptedGaussianProcess>
SpecializedModels;
TYPED_TEST_CASE(SpecializedCrossValidationTester, SpecializedModels);
TYPED_TEST_SUITE(SpecializedCrossValidationTester, SpecializedModels);

TYPED_TEST(SpecializedCrossValidationTester,
test_uses_specialized_cross_validation_functions) {
Expand Down
16 changes: 8 additions & 8 deletions tests/test_group_by.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ typedef ::testing::Types<BoolClassMethodGrouper, BoolLambdaGrouper,
CustomFunctionGrouper>
GrouperTestCases;

TYPED_TEST_CASE_P(GroupByTester);
TYPED_TEST_SUITE_P(GroupByTester);

template <typename GrouperFunction, typename ValueType,
typename GroupKey = typename details::grouper_result<GrouperFunction,
Expand Down Expand Up @@ -350,14 +350,14 @@ TYPED_TEST_P(GroupByTester, test_groupby_filter) {
filtered.size());
}

REGISTER_TYPED_TEST_CASE_P(GroupByTester, test_groupby_access_methods,
test_groupby_groups, test_groupby_counts,
test_groupby_combine, test_groupby_modify_combine,
test_groupby_apply_combine, test_groupby_apply_void,
test_groupby_filter, test_groupby_apply_value_only,
test_groupby_index_apply);
REGISTER_TYPED_TEST_SUITE_P(GroupByTester, test_groupby_access_methods,
test_groupby_groups, test_groupby_counts,
test_groupby_combine, test_groupby_modify_combine,
test_groupby_apply_combine, test_groupby_apply_void,
test_groupby_filter, test_groupby_apply_value_only,
test_groupby_index_apply);

INSTANTIATE_TYPED_TEST_CASE_P(test_groupby, GroupByTester, GrouperTestCases);
INSTANTIATE_TYPED_TEST_SUITE_P(test_groupby, GroupByTester, GrouperTestCases);

/*
* Test Filtering
Expand Down
2 changes: 1 addition & 1 deletion tests/test_model_metrics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ typedef ::testing::Types<LeaveOneOutLikelihood<JointDistribution>,
LeaveOneOutRMSE, GaussianProcessNegativeLogLikelihood>
MetricsToTest;

TYPED_TEST_CASE(ModelMetricTester, MetricsToTest);
TYPED_TEST_SUITE(ModelMetricTester, MetricsToTest);

TYPED_TEST(ModelMetricTester, test_sanity) {
MakeGaussianProcess test_case;
Expand Down
12 changes: 6 additions & 6 deletions tests/test_models.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ TYPED_TEST_P(RegressionModelTester, test_correct_derived_type) {
EXPECT_TRUE(same);
}

REGISTER_TYPED_TEST_CASE_P(RegressionModelTester,
test_performs_reasonably_on_linear_data,
test_predict_order_preserved, test_predict_variants,
test_correct_derived_type);
REGISTER_TYPED_TEST_SUITE_P(RegressionModelTester,
test_performs_reasonably_on_linear_data,
test_predict_order_preserved, test_predict_variants,
test_correct_derived_type);

INSTANTIATE_TYPED_TEST_CASE_P(test_models, RegressionModelTester,
ExampleModels);
INSTANTIATE_TYPED_TEST_SUITE_P(test_models, RegressionModelTester,
ExampleModels);

class BadModel : public ModelBase<BadModel> {
public:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_models.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ typedef ::testing::Types<MakeLinearRegression, MakeGaussianProcess,
MakeRansacAdaptedGaussianProcess, MakeNullModel>
ExampleModels;

TYPED_TEST_CASE_P(RegressionModelTester);
TYPED_TEST_SUITE_P(RegressionModelTester);

enum PredictLevel { MEAN, MARGINAL, JOINT };

Expand Down
2 changes: 1 addition & 1 deletion tests/test_radial.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class CovarianceStateSpaceTester : public ::testing::Test {
using StateSpaceTestCases =
::testing::Types<SquaredExponentialSSRTest, ExponentialSSRTest,
ExponentialAngularSSRTest>;
TYPED_TEST_CASE(CovarianceStateSpaceTester, StateSpaceTestCases);
TYPED_TEST_SUITE(CovarianceStateSpaceTester, StateSpaceTestCases);

TYPED_TEST(CovarianceStateSpaceTester, test_state_space_representation) {

Expand Down
14 changes: 7 additions & 7 deletions tests/test_serialize.cc
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ struct LinearCombo : public SerializableType<LinearCombination<double>> {
}
};

REGISTER_TYPED_TEST_CASE_P(SerializeTest, test_roundtrip_serialize_json,
test_roundtrip_serialize_binary);
REGISTER_TYPED_TEST_SUITE_P(SerializeTest, test_roundtrip_serialize_json,
test_roundtrip_serialize_binary);

typedef ::testing::Types<LDLT, ExplainedCovarianceRepresentation, EigenMatrix3d,
SerializableType<Eigen::Matrix2i>, EmptyEigenVectorXd,
Expand All @@ -287,7 +287,7 @@ typedef ::testing::Types<LDLT, ExplainedCovarianceRepresentation, EigenMatrix3d,
VariantAsDouble, BlockSymmetricMatrix, LinearCombo>
ToTest;

INSTANTIATE_TYPED_TEST_CASE_P(Albatross, SerializeTest, ToTest);
INSTANTIATE_TYPED_TEST_SUITE_P(Albatross, SerializeTest, ToTest);

/*
* Make sure all the example models serialize.
Expand Down Expand Up @@ -380,11 +380,11 @@ TYPED_TEST_P(RegressionModelTester, test_fit_model_serializes) {
SerializableFitModelType<TypeParam>>();
}

REGISTER_TYPED_TEST_CASE_P(RegressionModelTester, test_model_serializes,
test_fit_model_serializes);
REGISTER_TYPED_TEST_SUITE_P(RegressionModelTester, test_model_serializes,
test_fit_model_serializes);

INSTANTIATE_TYPED_TEST_CASE_P(test_serialize, RegressionModelTester,
ExampleModels);
INSTANTIATE_TYPED_TEST_SUITE_P(test_serialize, RegressionModelTester,
ExampleModels);

TEST(test_serialize, test_variant_version_0) {
int one = 1;
Expand Down
2 changes: 1 addition & 1 deletion tests/test_serialize.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ template <typename Serializable> struct SerializeTest : public ::testing::Test {
typedef typename Serializable::RepresentationType Representation;
};

TYPED_TEST_CASE_P(SerializeTest);
TYPED_TEST_SUITE_P(SerializeTest);

template <typename InputArchiveType, typename OutputArchiveType,
typename SerializableTestType>
Expand Down
2 changes: 1 addition & 1 deletion tests/test_sparse_gp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class SparseGaussianProcessTest : public ::testing::Test {
};

typedef ::testing::Types<LeaveOneIntervalOut> IndependenceAssumptions;
TYPED_TEST_CASE(SparseGaussianProcessTest, IndependenceAssumptions);
TYPED_TEST_SUITE(SparseGaussianProcessTest, IndependenceAssumptions);

template <typename CovFunc, typename GrouperFunction>
void expect_sparse_gp_performance(const CovFunc &covariance,
Expand Down
4 changes: 2 additions & 2 deletions tests/test_traits_indexing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ typedef ::testing::Types<
WithReturnType<CallOperatorStringConstRefInt, std::string>>
TestFunctions;

TYPED_TEST_CASE(TestCanBeCalledWithInt, TestFunctions);
TYPED_TEST_SUITE(TestCanBeCalledWithInt, TestFunctions);

TYPED_TEST(TestCanBeCalledWithInt, test_invocalbe) {
using Expected = typename TypeParam::ReturnType;
Expand Down Expand Up @@ -163,7 +163,7 @@ typedef ::testing::Types<
decltype(lambda_bool_const_ref_int), CallOperatorBoolConstRefInt>
ValueFilterFunctionTestCases;

TYPED_TEST_CASE(TestIsValueFilterFunction, ValueFilterFunctionTestCases);
TYPED_TEST_SUITE(TestIsValueFilterFunction, ValueFilterFunctionTestCases);

TYPED_TEST(TestIsValueFilterFunction, test_is_value_filter_function) {
EXPECT_TRUE(bool(
Expand Down
2 changes: 1 addition & 1 deletion third_party/googletest
Submodule googletest updated 382 files

0 comments on commit e9354bf

Please sign in to comment.