mirror of
https://github.com/msgpack/msgpack-c
synced 2026-06-08 16:11:40 +00:00
csharp: Refactoring IL code generator & add two compiled packer implementation (dynamic-method, method-builder)
This commit is contained in:
@@ -9,19 +9,44 @@ namespace msgpack.tests
|
||||
[TestFixture]
|
||||
public class CompiledPackerTests
|
||||
{
|
||||
CompiledPacker _mbImpl = new CompiledPacker (false);
|
||||
CompiledPacker _dynImpl = new CompiledPacker (true);
|
||||
|
||||
[Test]
|
||||
public void TestA ()
|
||||
public void TestA_MethodBuilder ()
|
||||
{
|
||||
TestA_Class obj0 = new TestA_Class ();
|
||||
TestA_Class obj1 = CompiledPacker.Unpack<TestA_Class> (CompiledPacker.Pack<TestA_Class> (obj0));
|
||||
obj0.Check (obj1);
|
||||
TestA (_mbImpl);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestB ()
|
||||
public void TestA_DynamicMethod ()
|
||||
{
|
||||
TestA (_dynImpl);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestB_MethodBuilder ()
|
||||
{
|
||||
TestB (_mbImpl);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestB_DynamicMethod ()
|
||||
{
|
||||
TestB (_dynImpl);
|
||||
}
|
||||
|
||||
void TestA (CompiledPacker packer)
|
||||
{
|
||||
TestA_Class obj0 = new TestA_Class ();
|
||||
TestA_Class obj1 = packer.Unpack<TestA_Class> (packer.Pack<TestA_Class> (obj0));
|
||||
obj0.Check (obj1);
|
||||
}
|
||||
|
||||
void TestB (CompiledPacker packer)
|
||||
{
|
||||
TestB_Class obj0 = TestB_Class.Create ();
|
||||
TestB_Class obj1 = CompiledPacker.Unpack<TestB_Class> (CompiledPacker.Pack<TestB_Class> (obj0));
|
||||
TestB_Class obj1 = packer.Unpack<TestB_Class> (packer.Pack<TestB_Class> (obj0));
|
||||
obj0.Check (obj1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user