mirror of
https://github.com/FabInfra/capnproto-dotnetcore_Runtime.git
synced 2025-03-12 14:51:41 +01:00
Test constants in imported non-generated structures and interfaces.
This commit is contained in:
parent
e13a8751dc
commit
e2cfb8aaf1
10
capnpc-csharp.tests/Properties/Resources.Designer.cs
generated
10
capnpc-csharp.tests/Properties/Resources.Designer.cs
generated
@ -90,6 +90,16 @@ namespace capnpc_csharp.Tests.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] UnitTest11_capnp {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("UnitTest11_capnp", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
|
@ -136,4 +136,7 @@
|
||||
<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>
|
||||
<data name="UnitTest11_capnp" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\UnitTest11.capnp.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
</root>
|
BIN
capnpc-csharp.tests/Resources/UnitTest11.capnp.bin
Normal file
BIN
capnpc-csharp.tests/Resources/UnitTest11.capnp.bin
Normal file
Binary file not shown.
15
capnpc-csharp.tests/UnitTest11.capnp
Normal file
15
capnpc-csharp.tests/UnitTest11.capnp
Normal file
@ -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;
|
||||
}
|
||||
}
|
9
capnpc-csharp.tests/UnitTest11b.capnp
Normal file
9
capnpc-csharp.tests/UnitTest11b.capnp
Normal file
@ -0,0 +1,9 @@
|
||||
@0xabc4e69d23fe287e;
|
||||
|
||||
struct InnerStruct {
|
||||
const constantS: Bool = false;
|
||||
}
|
||||
|
||||
interface InnerInterface {
|
||||
const constantI: Bool = false;
|
||||
}
|
@ -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()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user