blob: 89510c5b5cb92c43dbc2fbff64c2d2c23f95aa98 [file] [log] [blame]
T Jake Luciani1952e542009-02-01 04:47:30 +00001use Test::More tests => 6;
2
3use strict;
4use warnings;
5
6use Data::Dumper;
7
8use Thrift::BinaryProtocol;
9use Thrift::MemoryBuffer;
10
11use ThriftTest::Types;
12
13
14my $transport = Thrift::MemoryBuffer->new();
15my $protocol = Thrift::BinaryProtocol->new($transport);
16
17my $a = ThriftTest::Xtruct->new();
18$a->i32_thing(10);
19$a->i64_thing(30);
20$a->string_thing('Hello, world!');
21$a->write($protocol);
22
23my $b = ThriftTest::Xtruct->new();
24$b->read($protocol);
25is($b->i32_thing, $a->i32_thing);
26is($b->i64_thing, $a->i64_thing);
27is($b->string_thing, $a->string_thing);
28
29$b->write($protocol);
30my $c = ThriftTest::Xtruct->new();
31$c->read($protocol);
32is($c->i32_thing, $a->i32_thing);
33is($c->i64_thing, $a->i64_thing);
34is($c->string_thing, $a->string_thing);