Test use of nodes imported from non-generated files.

This commit is contained in:
Kuba Ober 2019-08-29 10:29:21 -04:00
parent 28993b43a1
commit 4f431856ba
5 changed files with 26 additions and 0 deletions

View File

@ -79,5 +79,15 @@ namespace capnpc_csharp.Tests.Properties {
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] UnitTest3_capnp {
get {
object obj = ResourceManager.GetObject("UnitTest3_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="UnitTest3_capnp" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\UnitTest3.capnp.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<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>

Binary file not shown.

View File

@ -0,0 +1,6 @@
@0xb7158f7fa52b8db6;
using Cxx = import "/capnp/c++.capnp";
$Cxx.namespace("Foo.Bar.Baz");

View File

@ -40,6 +40,13 @@ namespace CapnpC
// Should not throw
}
[TestMethod]
public void Test03NonGeneratedNodeSkip()
{
var model = Load(Resources.UnitTest3_capnp);
// Should not throw
}
static Generator.CodeGenerator NewGeneratorFor(Model.SchemaModel model)
=> new Generator.CodeGenerator(model, new Generator.GeneratorOptions());