Replace calls to deprecated googletest macros *TEST_CASE() with *TEST_SUITE()
PiperOrigin-RevId: 229586776
This commit is contained in:
parent
aba19e4143
commit
2eaf93a349
@ -49,7 +49,7 @@ using Types =
|
||||
std::pair<int16, qint16>, std::pair<uint16, quint16>,
|
||||
std::pair<int32, qint32>>;
|
||||
|
||||
TYPED_TEST_CASE(LiteralUtilTest, Types);
|
||||
TYPED_TEST_SUITE(LiteralUtilTest, Types);
|
||||
|
||||
TYPED_TEST(LiteralUtilTest, LiteralToQuantizedHostTensor) {
|
||||
using int_type = typename TypeParam::first_type;
|
||||
|
@ -139,7 +139,7 @@ TEST_P(StatusPropagationTest, PartialRunDoneFirst) {
|
||||
// ExecutorDone and PartialRunDone.
|
||||
Status ExecutorError() { return errors::Internal("executor error"); }
|
||||
Status PartialRunError() { return errors::Internal("partial run error"); }
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
PartialRunMgr, StatusPropagationTest,
|
||||
::testing::Values(
|
||||
StatusTestParam{Status::OK(), Status::OK(), Status::OK()},
|
||||
|
@ -75,7 +75,7 @@ TEST_P(Bfloat16Test, TruncateTest) {
|
||||
EXPECT_EQ(GetParam().expected_rounding, float(rounded));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Bfloat16Test_Instantiation, Bfloat16Test,
|
||||
::testing::Values(
|
||||
Bfloat16TestParam{
|
||||
|
@ -83,9 +83,10 @@ TEST_P(AsyncInterleaveManyTest, Model) {
|
||||
EXPECT_GE(async_interleave_many->OutputTime(&input_times), 0);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(Test, AsyncInterleaveManyTest,
|
||||
::testing::Combine(::testing::Values(1, 2),
|
||||
::testing::Values(0, 50, 100, 200)));
|
||||
INSTANTIATE_TEST_SUITE_P(Test, AsyncInterleaveManyTest,
|
||||
::testing::Combine(::testing::Values(1, 2),
|
||||
::testing::Values(0, 50, 100,
|
||||
200)));
|
||||
|
||||
class AsyncKnownRatioTest
|
||||
: public ::testing::TestWithParam<std::tuple<int64, int64, int64>> {};
|
||||
@ -156,10 +157,10 @@ TEST_P(AsyncKnownRatioTest, Model) {
|
||||
EXPECT_GE(async_known_many->OutputTime(&input_times), 0);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(Test, AsyncKnownRatioTest,
|
||||
::testing::Combine(::testing::Values(1, 2, 4, 8),
|
||||
::testing::Values(0, 50, 100, 200),
|
||||
::testing::Values(0, 1, 2, 4)));
|
||||
INSTANTIATE_TEST_SUITE_P(Test, AsyncKnownRatioTest,
|
||||
::testing::Combine(::testing::Values(1, 2, 4, 8),
|
||||
::testing::Values(0, 50, 100, 200),
|
||||
::testing::Values(0, 1, 2, 4)));
|
||||
|
||||
TEST(InterleaveManyTest, Model) {
|
||||
std::shared_ptr<Node> interleave_many =
|
||||
@ -245,7 +246,7 @@ TEST_P(KnownRatioTest, Model) {
|
||||
num_inputs_per_output * (50 + 100) + 64);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(Test, KnownRatioTest, ::testing::Values(0, 1, 2, 4));
|
||||
INSTANTIATE_TEST_SUITE_P(Test, KnownRatioTest, ::testing::Values(0, 1, 2, 4));
|
||||
|
||||
TEST(SourceTest, Model) {
|
||||
std::shared_ptr<Node> source = model::MakeSourceNode({0, "source", nullptr});
|
||||
|
@ -952,8 +952,8 @@ class FusedConv2DWithBiasOpTest : public FusedConv2DOpTest<T> {};
|
||||
template <typename T>
|
||||
class FusedConv2DWithBatchNormOpTest : public FusedConv2DOpTest<T> {};
|
||||
|
||||
TYPED_TEST_CASE_P(FusedConv2DWithBiasOpTest);
|
||||
TYPED_TEST_CASE_P(FusedConv2DWithBatchNormOpTest);
|
||||
TYPED_TEST_SUITE_P(FusedConv2DWithBiasOpTest);
|
||||
TYPED_TEST_SUITE_P(FusedConv2DWithBatchNormOpTest);
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// Conv2D + BiasAdd + {Relu} //
|
||||
@ -1035,29 +1035,29 @@ TYPED_TEST_P(FusedConv2DWithBatchNormOpTest, SpatialConvolutionAndRelu) {
|
||||
this->VerifyConv2DWithBatchNormAndRelu(filter_size, filter_count);
|
||||
}
|
||||
|
||||
REGISTER_TYPED_TEST_CASE_P(FusedConv2DWithBiasOpTest, //
|
||||
OneByOneConvolution, //
|
||||
ImageSizeConvolution, //
|
||||
SpatialConvolution, //
|
||||
OneByOneConvolutionAndRelu, //
|
||||
ImageSizeConvolutionAndRelu, //
|
||||
SpatialConvolutionAndRelu);
|
||||
REGISTER_TYPED_TEST_SUITE_P(FusedConv2DWithBiasOpTest, //
|
||||
OneByOneConvolution, //
|
||||
ImageSizeConvolution, //
|
||||
SpatialConvolution, //
|
||||
OneByOneConvolutionAndRelu, //
|
||||
ImageSizeConvolutionAndRelu, //
|
||||
SpatialConvolutionAndRelu);
|
||||
|
||||
REGISTER_TYPED_TEST_CASE_P(FusedConv2DWithBatchNormOpTest, //
|
||||
OneByOneConvolution, //
|
||||
ImageSizeConvolution, //
|
||||
SpatialConvolution, //
|
||||
OneByOneConvolutionAndRelu, //
|
||||
ImageSizeConvolutionAndRelu, //
|
||||
SpatialConvolutionAndRelu);
|
||||
REGISTER_TYPED_TEST_SUITE_P(FusedConv2DWithBatchNormOpTest, //
|
||||
OneByOneConvolution, //
|
||||
ImageSizeConvolution, //
|
||||
SpatialConvolution, //
|
||||
OneByOneConvolutionAndRelu, //
|
||||
ImageSizeConvolutionAndRelu, //
|
||||
SpatialConvolutionAndRelu);
|
||||
|
||||
using FusedBiasAddDataTypes = ::testing::Types<float, double>;
|
||||
INSTANTIATE_TYPED_TEST_CASE_P(Test, FusedConv2DWithBiasOpTest,
|
||||
FusedBiasAddDataTypes);
|
||||
INSTANTIATE_TYPED_TEST_SUITE_P(Test, FusedConv2DWithBiasOpTest,
|
||||
FusedBiasAddDataTypes);
|
||||
|
||||
using FusedBatchNormDataTypes = ::testing::Types<float>;
|
||||
INSTANTIATE_TYPED_TEST_CASE_P(Test, FusedConv2DWithBatchNormOpTest,
|
||||
FusedBatchNormDataTypes);
|
||||
INSTANTIATE_TYPED_TEST_SUITE_P(Test, FusedConv2DWithBatchNormOpTest,
|
||||
FusedBatchNormDataTypes);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Performance benchmarks for the FusedConv2DWithBiasOp. //
|
||||
|
@ -45,7 +45,7 @@ typedef ::testing::Types<Int8_IT, UInt8_IT, Int16_IT, UInt16_IT, Int32_IT,
|
||||
Int64_IT, UInt64_IT, Long_IT>
|
||||
SupportedIntTypes;
|
||||
|
||||
TYPED_TEST_CASE(IntTypeTest, SupportedIntTypes);
|
||||
TYPED_TEST_SUITE(IntTypeTest, SupportedIntTypes);
|
||||
|
||||
TYPED_TEST(IntTypeTest, TestInitialization) {
|
||||
constexpr typename TestFixture::T a;
|
||||
|
@ -209,7 +209,7 @@ const Scalar NcclManagerTest<Scalar>::max_ =
|
||||
|
||||
// Instantiate tests for float and double.
|
||||
using TypeList = ::testing::Types<float, double>;
|
||||
TYPED_TEST_CASE(NcclManagerTest, TypeList);
|
||||
TYPED_TEST_SUITE(NcclManagerTest, TypeList);
|
||||
|
||||
// Test basic sum reduction.
|
||||
TYPED_TEST(NcclManagerTest, BasicSumReduction) {
|
||||
|
@ -400,7 +400,7 @@ class BidirectionalLSTMOpModel : public SingleOpModel {
|
||||
// indicating whether to use quantization or not.
|
||||
class LSTMOpTest : public ::testing::TestWithParam<bool> {};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(QuantizationOrNot, LSTMOpTest, ::testing::Bool());
|
||||
INSTANTIATE_TEST_SUITE_P(QuantizationOrNot, LSTMOpTest, ::testing::Bool());
|
||||
|
||||
TEST_P(LSTMOpTest, BlackBoxTestNoCifgNoPeepholeNoProjectionNoClipping) {
|
||||
const int n_batch = 1;
|
||||
|
@ -1069,7 +1069,7 @@ TEST_P(ConvolutionOpTest, DISABLED_PointwiseMultifilterHybrid) {
|
||||
0.0474)));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
ConvolutionOpTest, ConvolutionOpTest,
|
||||
::testing::ValuesIn(SingleOpTest::GetKernelTags(*kKernelMap)));
|
||||
|
||||
|
@ -437,11 +437,11 @@ TEST_P(QuantizedDepthwiseConvolutionOpTest, SimpleDilatedTestPaddingSame) {
|
||||
ElementsAreArray({4, 7, 3, 6, 10, 4, 2, 3, 1}));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
DepthwiseConvolutionOpTest, DepthwiseConvolutionOpTest,
|
||||
::testing::ValuesIn(SingleOpTest::GetKernelTags(*kKernelMap)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
QuantizedDepthwiseConvolutionOpTest, QuantizedDepthwiseConvolutionOpTest,
|
||||
::testing::ValuesIn(SingleOpTest::GetKernelTags(*kKernelMap)));
|
||||
|
||||
|
@ -725,11 +725,11 @@ TEST_P(QuantizedFullyConnectedOpTest,
|
||||
ElementsAre(175, 177, 179, 243, 245, 247));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
FloatFullyConnectedOpTest, FloatFullyConnectedOpTest,
|
||||
::testing::ValuesIn(SingleOpTest::GetKernelTags(*kKernelMap)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
QuantizedFullyConnectedOpTest, QuantizedFullyConnectedOpTest,
|
||||
::testing::ValuesIn(SingleOpTest::GetKernelTags(*kKernelMapNoPie)));
|
||||
|
||||
|
@ -236,9 +236,9 @@ TEST_P(ReshapeOpTest, Strings) {
|
||||
ElementsAreArray({"1", "2", "3", "4", "5", "6", "7", "8"}));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(VariedShapeSpec, ReshapeOpTest,
|
||||
::testing::Values(kAsReshapeOption, kAsConstantTensor,
|
||||
kAsTensor));
|
||||
INSTANTIATE_TEST_SUITE_P(VariedShapeSpec, ReshapeOpTest,
|
||||
::testing::Values(kAsReshapeOption, kAsConstantTensor,
|
||||
kAsTensor));
|
||||
} // namespace
|
||||
} // namespace tflite
|
||||
|
||||
|
@ -252,7 +252,7 @@ TEST_P(TransposeConvOpTest, AccuracyTest) {
|
||||
EXPECT_THAT(m.GetOutputShape(), ElementsAreArray({1, 3, 4, 1}));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TransposeConvOpTest, TransposeConvOpTest,
|
||||
::testing::ValuesIn(SingleOpTest::GetKernelTags(*kKernelMap)));
|
||||
|
||||
|
@ -196,10 +196,10 @@ TEST_P(SpeechTest, DISABLED_TtsTest) {
|
||||
// 200s just to bring up the Android emulator.)
|
||||
static const int kAllInvocations = -1;
|
||||
static const int kFirstFewInvocations = 10;
|
||||
INSTANTIATE_TEST_CASE_P(LongTests, SpeechTest,
|
||||
::testing::Values(kAllInvocations));
|
||||
INSTANTIATE_TEST_CASE_P(ShortTests, SpeechTest,
|
||||
::testing::Values(kFirstFewInvocations));
|
||||
INSTANTIATE_TEST_SUITE_P(LongTests, SpeechTest,
|
||||
::testing::Values(kAllInvocations));
|
||||
INSTANTIATE_TEST_SUITE_P(ShortTests, SpeechTest,
|
||||
::testing::Values(kFirstFewInvocations));
|
||||
|
||||
} // namespace
|
||||
} // namespace tflite
|
||||
|
@ -257,8 +257,8 @@ std::vector<tensorflow::DataType> TestTypes() {
|
||||
return {DT_FLOAT, DT_INT32, DT_INT64, DT_BOOL, DT_QUINT8, DT_COMPLEX64};
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(ShapeImportTest, ShapeImportTest,
|
||||
::testing::ValuesIn(TestTypes()));
|
||||
INSTANTIATE_TEST_SUITE_P(ShapeImportTest, ShapeImportTest,
|
||||
::testing::ValuesIn(TestTypes()));
|
||||
|
||||
class ContentImportTest : public ::testing::Test {
|
||||
public:
|
||||
@ -418,8 +418,8 @@ TEST_P(TypeImportTest, BasicTypeInference) {
|
||||
model.operators[0].get());
|
||||
ASSERT_THAT(op->output_data_types, ::testing::ElementsAre(GetParam().second));
|
||||
}
|
||||
INSTANTIATE_TEST_CASE_P(BasicTypeInference, TypeImportTest,
|
||||
::testing::ValuesIn(UnaryTestTypes()));
|
||||
INSTANTIATE_TEST_SUITE_P(BasicTypeInference, TypeImportTest,
|
||||
::testing::ValuesIn(UnaryTestTypes()));
|
||||
|
||||
TEST(ImportTest, TypeInferenceWithFixedOutputType) {
|
||||
// Create an op that has a fixed output type (bool).
|
||||
|
@ -96,8 +96,8 @@ TEST_P(ShapeTest, Agrees) {
|
||||
}
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AgreeBroadcast, ShapeTest,
|
||||
::testing::ValuesIn(CreateShapePairs()));
|
||||
INSTANTIATE_TEST_SUITE_P(AgreeBroadcast, ShapeTest,
|
||||
::testing::ValuesIn(CreateShapePairs()));
|
||||
|
||||
static const char kNegativeValuesMessage[] =
|
||||
"Tensor shape should not include negative values";
|
||||
|
Loading…
Reference in New Issue
Block a user