diff --git a/capnpc-csharp.tests/Properties/Resources.Designer.cs b/capnpc-csharp.tests/Properties/Resources.Designer.cs index 7c7c2e9..0f7df65 100644 --- a/capnpc-csharp.tests/Properties/Resources.Designer.cs +++ b/capnpc-csharp.tests/Properties/Resources.Designer.cs @@ -90,6 +90,16 @@ namespace capnpc_csharp.Tests.Properties { } } + /// + /// Looks up a localized resource of type System.Byte[]. + /// + internal static byte[] UnitTest11_capnp { + get { + object obj = ResourceManager.GetObject("UnitTest11_capnp", resourceCulture); + return ((byte[])(obj)); + } + } + /// /// Looks up a localized resource of type System.Byte[]. /// diff --git a/capnpc-csharp.tests/Properties/Resources.resx b/capnpc-csharp.tests/Properties/Resources.resx index 6d2bda3..2404b46 100644 --- a/capnpc-csharp.tests/Properties/Resources.resx +++ b/capnpc-csharp.tests/Properties/Resources.resx @@ -136,4 +136,7 @@ ..\Resources\schema-with-offsets.capnp.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\Resources\UnitTest11.capnp.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + \ No newline at end of file diff --git a/capnpc-csharp.tests/Resources/UnitTest11.capnp.bin b/capnpc-csharp.tests/Resources/UnitTest11.capnp.bin new file mode 100644 index 0000000..5363609 Binary files /dev/null and b/capnpc-csharp.tests/Resources/UnitTest11.capnp.bin differ diff --git a/capnpc-csharp.tests/UnitTest11.capnp b/capnpc-csharp.tests/UnitTest11.capnp new file mode 100644 index 0000000..5fda369 --- /dev/null +++ b/capnpc-csharp.tests/UnitTest11.capnp @@ -0,0 +1,15 @@ +@0xe4369c441ab8df19; + +using Imported = import "UnitTest11b.capnp"; + +struct OuterStruct { + innerStruct @0: Imported.InnerStruct; + innerInterface @1: Imported.InnerInterface; +} + +interface OuterInterface { + struct Wrapper { + innerStruct @0: Imported.InnerStruct; + innerInterface @1: Imported.InnerInterface; + } +} diff --git a/capnpc-csharp.tests/UnitTest11b.capnp b/capnpc-csharp.tests/UnitTest11b.capnp new file mode 100644 index 0000000..c5b1926 --- /dev/null +++ b/capnpc-csharp.tests/UnitTest11b.capnp @@ -0,0 +1,9 @@ +@0xabc4e69d23fe287e; + +struct InnerStruct { + const constantS: Bool = false; +} + +interface InnerInterface { + const constantI: Bool = false; +} diff --git a/capnpc-csharp.tests/UnitTests.cs b/capnpc-csharp.tests/UnitTests.cs index c009ddd..1be2f38 100644 --- a/capnpc-csharp.tests/UnitTests.cs +++ b/capnpc-csharp.tests/UnitTests.cs @@ -71,6 +71,13 @@ namespace CapnpC Assert.AreEqual($"{innerNSStr}.Inner", innerNameSyntax.ToString()); } + [TestMethod] + public void Test11ImportedConst() + { + var model = Load(Resources.UnitTest11_capnp); + // Should not throw + } + [TestMethod] public void Test20AnnotationAndConst() {