csharp: Refactoring IL code generator & add two compiled packer implementation (dynamic-method, method-builder)

This commit is contained in:
Kazuki Oikawa 2011-04-23 14:14:12 +09:00
parent 94e5b0d78f
commit 33498d3673
7 changed files with 883 additions and 670 deletions

View file

@ -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);
}
}