mirror of
https://github.com/google/googletest.git
synced 2025-12-06 08:46:50 +08:00
Fix narrowing type conversion error
This commit is contained in:
parent
18172295df
commit
4f08b9ba59
@ -332,10 +332,11 @@ internal::ParamGenerator<typename Container::value_type> ValuesIn(
|
|||||||
// INSTANTIATE_TEST_SUITE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
|
// INSTANTIATE_TEST_SUITE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
template <typename... Ts>
|
template <typename... Ts,
|
||||||
internal::ParamGenerator<std::common_type_t<Ts...>> Values(Ts... vs) {
|
typename TCommonType = std::common_type_t<std::decay_t<Ts>...>>
|
||||||
return ValuesIn(
|
internal::ParamGenerator<TCommonType> Values(Ts&&... vs) {
|
||||||
std::array<std::common_type_t<Ts...>, sizeof...(Ts)>{std::move(vs)...});
|
TCommonType values[sizeof...(Ts)] = {std::forward<Ts>(vs)...};
|
||||||
|
return ValuesIn(values);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bool() allows generating tests with parameters in a set of (false, true).
|
// Bool() allows generating tests with parameters in a set of (false, true).
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user