diff options
author | ambrosin <ambrosin@google.com> | 2023-02-02 04:32:09 -0800 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-02-02 04:33:20 -0800 |
commit | 400ef41797432a5ca120fcc5c9a8a9d20d371a46 (patch) | |
tree | 101d2386bf2f1d4372b2770d1623c6981b226700 /cc/core | |
parent | 100df09442682faac01339a72ee4e8647878b61c (diff) | |
download | tink-400ef41797432a5ca120fcc5c9a8a9d20d371a46.tar.gz |
Move test primitive classes outside of the anonymous namespace to allow compile with MSVC
When in the anonymous namespace, these generate the following errors with Visual Studio 2019:
```
:\src\git\tink_cc\build\__include_alias\tink/core/private_key_manager_impl.h(135): error C2018: unknown character '0x60' [T:\src\git\tink_cc\build\tink\tink_test_core_private_key_manager_impl_test.vcxproj]
//+++ Start Injected Code
template <> const ::crypto::tink::KeyFactory & ::crypto::tink::internal::PrivateKeyManagerImpl<crypto::tink::internal::`anonymous namespace'::PrivatePrimitive,crypto::tink::PrivateKeyTypeManager<google::crypto::tink::EcdsaPrivateKey,google::crypto::tink::EcdsaKeyFormat,google::crypto::tink::EcdsaPublicKey,crypto::tink::List<crypto::tink::internal::`anonymous namespace'::PrivatePrimitive> >,crypto::tink::KeyTypeManager<google::crypto::tink::EcdsaPublicKey,void,crypto::tink::List<crypto::tink::internal::`anonymous namespace'::PublicPrimitive> > >::get_key_factory() const { return ::crypto::tink::internal::PrivateKeyManagerImpl<crypto::tink::internal::`anonymous namespace'::PrivatePrimitive,crypto::tink::PrivateKeyTypeManager<google::crypto::tink::EcdsaPrivateKey,google::crypto::tink::EcdsaKeyFormat,google::crypto::tink::EcdsaPublicKey,crypto::tink::List<crypto::tink::internal::`anonymous namespace'::PrivatePrimitive> >,crypto::tink::KeyTypeManager<google::crypto::tink::EcdsaPublicKey,void,crypto::tink::List<crypto::tink::internal::`anonymous namespace'::PublicPrimitive> > >::get_key_factory();
}
//--- End Injected Code
```
PiperOrigin-RevId: 506584258
Diffstat (limited to 'cc/core')
-rw-r--r-- | cc/core/private_key_manager_impl_test.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cc/core/private_key_manager_impl_test.cc b/cc/core/private_key_manager_impl_test.cc index acb4966dd..a874884e8 100644 --- a/cc/core/private_key_manager_impl_test.cc +++ b/cc/core/private_key_manager_impl_test.cc @@ -47,12 +47,18 @@ using ::testing::Eq; using ::testing::HasSubstr; using ::testing::Return; +} // namespace + // Placeholders for the primitives. We don't really want to test anything with // these except that things compile and List<PrivatePrimitive> is never confused // with List<PublicPrimitive> in private_key_manager_impl. +// NOTE: These are outside of the anonymous namespace to allow compiling with +// MSVC. class PrivatePrimitive {}; class PublicPrimitive {}; +namespace { + class ExamplePrivateKeyTypeManager : public PrivateKeyTypeManager<EcdsaPrivateKey, EcdsaKeyFormat, EcdsaPublicKey, List<PrivatePrimitive>> { |