clang-tidy: replace typedef with using
Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
887b08b0b7
commit
3a2309bfea
@ -103,7 +103,7 @@ const bool
|
||||
template <typename T>
|
||||
void test_add()
|
||||
{
|
||||
typedef AdditionTestValues<T> TestValues;
|
||||
using TestValues = AdditionTestValues<T>;
|
||||
|
||||
#define TEST_ADD(func) \
|
||||
for (size_t i = 0; i < TestValues::case_count; ++i) { \
|
||||
@ -133,7 +133,7 @@ void test_add()
|
||||
template <typename T>
|
||||
void test_safe_add()
|
||||
{
|
||||
typedef AdditionTestValues<T> TestValues;
|
||||
using TestValues = AdditionTestValues<T>;
|
||||
|
||||
for (size_t i = 0; i < TestValues::case_count; ++i) {
|
||||
for (size_t j = 0; j < TestValues::case_count; ++j) {
|
||||
|
||||
@ -31,19 +31,19 @@ namespace cpp_98_boilerplate
|
||||
template <typename T>
|
||||
struct return_type_traits
|
||||
{
|
||||
typedef T type;
|
||||
using type = T;
|
||||
};
|
||||
|
||||
template <typename U>
|
||||
struct return_type_traits<std::vector<U> >
|
||||
{
|
||||
typedef typename std::vector<U>& type;
|
||||
using type = typename std::vector<U>&;
|
||||
};
|
||||
|
||||
template <typename U>
|
||||
struct return_type_traits<const std::vector<U> >
|
||||
{
|
||||
typedef const typename std::vector<U>& type;
|
||||
using type = const typename std::vector<U>&;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
@ -171,7 +171,7 @@ TYPED_TEST_P(slice, constructionFailsWithZeroLength)
|
||||
*/
|
||||
TYPED_TEST_P(slice, subSliceSuccessfulConstruction)
|
||||
{
|
||||
typedef Slice<TypeParam> slice_t;
|
||||
using slice_t = Slice<TypeParam>;
|
||||
|
||||
// 0 1 2 3 4 5 6 7 8 9
|
||||
// | | center_vals
|
||||
@ -244,7 +244,7 @@ void checkSubSlice(const Slice<T>& sl)
|
||||
*/
|
||||
TYPED_TEST_P(slice, constMethodsPreserveConst)
|
||||
{
|
||||
typedef Slice<TypeParam> slice_t;
|
||||
using slice_t = Slice<TypeParam>;
|
||||
|
||||
// 0 1 2 3 4 5 6 7 8 9
|
||||
// | | center_vals
|
||||
@ -263,7 +263,7 @@ TYPED_TEST_P(slice, constMethodsPreserveConst)
|
||||
*/
|
||||
TYPED_TEST_P(mutableSlice, iterators)
|
||||
{
|
||||
typedef Slice<TypeParam> slice_t;
|
||||
using slice_t = Slice<TypeParam>;
|
||||
slice_t sl = this->getTestSlice();
|
||||
|
||||
ASSERT_EQ(*sl.begin(), static_cast<typename slice_t::value_type>(1));
|
||||
@ -286,7 +286,7 @@ TYPED_TEST_P(mutableSlice, iterators)
|
||||
*/
|
||||
TYPED_TEST_P(mutableSlice, at)
|
||||
{
|
||||
typedef Slice<TypeParam> slice_t;
|
||||
using slice_t = Slice<TypeParam>;
|
||||
slice_t sl = this->getTestSlice(2, 4);
|
||||
|
||||
sl.at(0) = 6;
|
||||
@ -421,13 +421,13 @@ REGISTER_TYPED_TEST_CASE_P(slice, atAccess, iteratorAccess, constructionFailsFro
|
||||
subSliceFailedConstruction, subSliceConstructionOverflowResistance,
|
||||
constMethodsPreserveConst);
|
||||
|
||||
typedef ::testing::Types<const std::vector<int>, std::vector<int>, int*, const int*> test_types_t;
|
||||
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);
|
||||
|
||||
REGISTER_TYPED_TEST_CASE_P(mutableSlice, iterators, at);
|
||||
typedef ::testing::Types<std::vector<int>, int*> mut_test_types_t;
|
||||
using mut_test_types_t = ::testing::Types<std::vector<int>, int*>;
|
||||
INSTANTIATE_TYPED_TEST_CASE_P(slice, mutableSlice, mut_test_types_t);
|
||||
|
||||
REGISTER_TYPED_TEST_CASE_P(dataBufSlice, successfulConstruction, failedConstruction);
|
||||
typedef ::testing::Types<DataBuf&, const DataBuf&> data_buf_types_t;
|
||||
using data_buf_types_t = ::testing::Types<DataBuf&, const DataBuf&>;
|
||||
INSTANTIATE_TYPED_TEST_CASE_P(slice, dataBufSlice, data_buf_types_t);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user