diff options
Diffstat (limited to 'type_cpp_unittest.cpp')
-rw-r--r-- | type_cpp_unittest.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/type_cpp_unittest.cpp b/type_cpp_unittest.cpp index 35fc3d5..46b5db8 100644 --- a/type_cpp_unittest.cpp +++ b/type_cpp_unittest.cpp @@ -15,15 +15,26 @@ */ #include <memory> +#include <string> #include <gtest/gtest.h> #include "type_cpp.h" +using std::string; +using std::unique_ptr; + namespace android { namespace aidl { namespace cpp { +namespace { + +string kParcelableDotName = "Outer.Inner"; +string kParcelableColonName = "Outer::Inner"; + +} // namespace + class CppTypeNamespaceTest : public ::testing::Test { protected: void SetUp() override { @@ -48,6 +59,14 @@ TEST_F(CppTypeNamespaceTest, SupportsListString) { types_.HasTypeByCanonicalName("java.util.List<java.lang.String>")); } +TEST_F(CppTypeNamespaceTest, SupportsNestedParcelableClass) { + unique_ptr<AidlParcelable> parcelable( + new AidlParcelable(new AidlQualifiedName(kParcelableDotName, ""), + 0, + {"a", "goog"})); + EXPECT_EQ(parcelable->GetCppName(), kParcelableColonName); +} + } // namespace cpp } // namespace android } // namespace aidl |