diff options
author | Niels Dekker <N.Dekker@lumc.nl> | 2020-12-24 13:42:39 +0100 |
---|---|---|
committer | Niels Dekker <N.Dekker@lumc.nl> | 2021-02-25 13:23:52 +0100 |
commit | ac3c2a8d0496893787015014a5abd397b766cce2 (patch) | |
tree | b3502f10ab4a4745fb764f162a9501f39bdcadc0 /googlemock/scripts/generator/cpp/tokenize.py | |
parent | 1de637fbdd4ab0051229707f855eee76f5a3d5da (diff) | |
download | googletest-ac3c2a8d0496893787015014a5abd397b766cce2.tar.gz googletest-ac3c2a8d0496893787015014a5abd397b766cce2.zip |
overload PrintTo for std::type_info and std::type_index
Included the string returned by their `name()` member function with the output of `PrintTo`.
Typical use case:
std::unique_ptr<AbstractProduct> product = FactoryMethod();
// Assert that the product is of type X:
ASSERT_EQ(std::type_index{typeid(*product)},
std::type_index{typeid(ProductX)});
Possible output in case of a test assert failure, now including the names of the compared type indices:
> error: Expected equality of these values:
> std::type_index(typeid(*product))
> Which is: 8-byte object <D0-65 54-8C F6-7F 00-00> ("class ProductY")
> std::type_index(typeid(ProductX))
> Which is: 8-byte object <40-64 54-8C F6-7F 00-00> ("class ProductX")
With help from Krystian Kuzniarek.
Diffstat (limited to 'googlemock/scripts/generator/cpp/tokenize.py')
0 files changed, 0 insertions, 0 deletions