chromium/third_party/crashpad/crashpad/util/stdlib/string_number_conversion_test.cc

// Copyright 2014 The Crashpad Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "util/stdlib/string_number_conversion.h"

#include <sys/types.h>

#include <array>
#include <iterator>
#include <limits>
#include <type_traits>

#include "gtest/gtest.h"

#define STRINGIFY(a)
#define STR(a)

template <typename TValueType>
struct TestSpecification {};

// Signed 32-bit test data
template <typename TIntType,
          typename std::enable_if<std::is_integral<TIntType>::value &&
                                  std::is_signed<TIntType>::value &&
                                  (sizeof(TIntType) == 4)>::type* = nullptr>
static constexpr std::array<TestSpecification<TIntType>, 61> kTestDataFunc() {}

// Unsigned 32-bit test data
template <typename TIntType,
          typename std::enable_if<std::is_integral<TIntType>::value &&
                                  !std::is_signed<TIntType>::value &&
                                  (sizeof(TIntType) == 4)>::type* = nullptr>
static constexpr std::array<TestSpecification<TIntType>, 61> kTestDataFunc() {}

// Signed 64-bit test data
template <typename TIntType,
          typename std::enable_if<std::is_integral<TIntType>::value &&
                                  std::is_signed<TIntType>::value &&
                                  (sizeof(TIntType) == 8)>::type* = nullptr>
static constexpr std::array<TestSpecification<TIntType>, 24> kTestDataFunc() {}

// Unsigned 64-bit test data
template <typename TIntType,
          typename std::enable_if<std::is_integral<TIntType>::value &&
                                  !std::is_signed<TIntType>::value &&
                                  (sizeof(TIntType) == 8)>::type* = nullptr>
static constexpr std::array<TestSpecification<TIntType>, 25> kTestDataFunc() {}

// This string is split to avoid MSVC warning:
//   "decimal digit terminates octal escape sequence".
static constexpr char kEmbeddedNullInputRaw[] =;

namespace crashpad {
namespace test {
namespace {

TEST(StringNumberConversion, StringToInt) {}

TEST(StringNumberConversion, StringToUnsignedInt) {}

TEST(StringNumberConversion, StringToLong) {}

TEST(StringNumberConversion, StringToUnsignedLong) {}

TEST(StringNumberConversion, StringToLongLong) {}

TEST(StringNumberConversion, StringToUnsignedLongLong) {}

}  // namespace
}  // namespace test
}  // namespace crashpad