Test for success on Schema.capnp.

This commit is contained in:
Kuba Ober 2019-08-29 13:02:32 -04:00
parent 2b3d833f6d
commit 1aff615036
4 changed files with 22 additions and 0 deletions

View File

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

View File

@ -133,4 +133,7 @@
<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>
<data name="schema_with_offsets_capnp" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\schema-with-offsets.capnp.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>

View File

@ -80,6 +80,15 @@ namespace CapnpC
// Should not throw
}
[TestMethod]
public void Test30SchemaCapnp()
{
var model = Load(Resources.schema_with_offsets_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());