Test forward-inherited types.

This commit is contained in:
Kuba Ober 2019-08-29 12:38:13 -04:00
parent e543b62e2b
commit 28993b43a1
5 changed files with 33 additions and 0 deletions

View File

@ -69,5 +69,15 @@ namespace capnpc_csharp.Tests.Properties {
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] UnitTest2_capnp {
get {
object obj = ResourceManager.GetObject("UnitTest2_capnp", resourceCulture);
return ((byte[])(obj));
}
}
}
}

View File

@ -118,6 +118,9 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="UnitTest2_capnp" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\UnitTest2.capnp.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="UnitTest1_capnp" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\UnitTest1.capnp.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>

Binary file not shown.

View File

@ -0,0 +1,11 @@
@0xf6041efc5e8b1e59;
interface Interface1(V1) {}
interface Interface {
method @0 () -> (arg : AnyPointer);
method1 @1 () -> (arg : Interface1(AnyPointer));
method2 @2 () -> (arg : Interface2(AnyPointer));
}
interface Interface2(V2) {}

View File

@ -31,6 +31,15 @@ namespace CapnpC
Assert.AreNotEqual(structFoo.Name, fieldName);
}
[TestMethod]
public void Test02ForwardInheritance()
{
var model = Load(Resources.UnitTest2_capnp);
var codeGen = NewGeneratorFor(model);
codeGen.Transform(model.FilesToGenerate.First());
// Should not throw
}
static Generator.CodeGenerator NewGeneratorFor(Model.SchemaModel model)
=> new Generator.CodeGenerator(model, new Generator.GeneratorOptions());