2011-04-16 21:12:04 +09:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using TestA_Class = msgpack.tests.ObjectPackerTests.TestA_Class;
|
|
|
|
|
using TestB_Class = msgpack.tests.ObjectPackerTests.TestB_Class;
|
|
|
|
|
|
|
|
|
|
namespace msgpack.tests
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
|
|
|
|
public class CompiledPackerTests
|
|
|
|
|
{
|
2011-04-23 14:14:12 +09:00
|
|
|
|
CompiledPacker _mbImpl = new CompiledPacker (false);
|
|
|
|
|
CompiledPacker _dynImpl = new CompiledPacker (true);
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void TestA_MethodBuilder ()
|
|
|
|
|
{
|
|
|
|
|
TestA (_mbImpl);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void TestA_DynamicMethod ()
|
|
|
|
|
{
|
|
|
|
|
TestA (_dynImpl);
|
|
|
|
|
}
|
|
|
|
|
|
2011-04-16 21:12:04 +09:00
|
|
|
|
[Test]
|
2011-04-23 14:14:12 +09:00
|
|
|
|
public void TestB_MethodBuilder ()
|
|
|
|
|
{
|
|
|
|
|
TestB (_mbImpl);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void TestB_DynamicMethod ()
|
|
|
|
|
{
|
|
|
|
|
TestB (_dynImpl);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TestA (CompiledPacker packer)
|
2011-04-16 21:12:04 +09:00
|
|
|
|
{
|
|
|
|
|
TestA_Class obj0 = new TestA_Class ();
|
2011-04-23 14:14:12 +09:00
|
|
|
|
TestA_Class obj1 = packer.Unpack<TestA_Class> (packer.Pack<TestA_Class> (obj0));
|
2011-04-16 21:12:04 +09:00
|
|
|
|
obj0.Check (obj1);
|
|
|
|
|
}
|
|
|
|
|
|
2011-04-23 14:14:12 +09:00
|
|
|
|
void TestB (CompiledPacker packer)
|
2011-04-16 21:12:04 +09:00
|
|
|
|
{
|
|
|
|
|
TestB_Class obj0 = TestB_Class.Create ();
|
2011-04-23 14:14:12 +09:00
|
|
|
|
TestB_Class obj1 = packer.Unpack<TestB_Class> (packer.Pack<TestB_Class> (obj0));
|
2011-04-16 21:12:04 +09:00
|
|
|
|
obj0.Check (obj1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|