blob: 96e3bec7705dc0af26c83ec9e7fd0c6cb6ded321 [file] [log] [blame]
T Jake Luciani41687fc2008-12-23 03:45:43 +00001#!/usr/bin/env perl
Mark Slee3e3d7ad2007-05-16 02:35:58 +00002
David Reissea2cba82009-03-30 21:35:00 +00003#
4# Licensed to the Apache Software Foundation (ASF) under one
5# or more contributor license agreements. See the NOTICE file
6# distributed with this work for additional information
7# regarding copyright ownership. The ASF licenses this file
8# to you under the Apache License, Version 2.0 (the
9# "License"); you may not use this file except in compliance
10# with the License. You may obtain a copy of the License at
11#
12# http://www.apache.org/licenses/LICENSE-2.0
13#
14# Unless required by applicable law or agreed to in writing,
15# software distributed under the License is distributed on an
16# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17# KIND, either express or implied. See the License for the
18# specific language governing permissions and limitations
19# under the License.
20#
21
James E. King, III177c37c2017-03-30 17:09:04 -040022use 5.10.0;
Mark Slee3e3d7ad2007-05-16 02:35:58 +000023use strict;
24use warnings;
25use Data::Dumper;
Jim Kingf5f1b352015-06-24 13:47:24 -040026use Getopt::Long qw(GetOptions);
Mark Slee3e3d7ad2007-05-16 02:35:58 +000027use Time::HiRes qw(gettimeofday);
28
29use lib '../../lib/perl/lib';
T Jake Luciani41687fc2008-12-23 03:45:43 +000030use lib 'gen-perl';
Mark Slee3e3d7ad2007-05-16 02:35:58 +000031
32use Thrift;
33use Thrift::BinaryProtocol;
Mark Slee3e3d7ad2007-05-16 02:35:58 +000034use Thrift::BufferedTransport;
Jim Kingf5f1b352015-06-24 13:47:24 -040035use Thrift::FramedTransport;
James E. King, III20e16bc2017-11-18 22:37:54 -050036use Thrift::MultiplexedProtocol;
Jim Kingf5f1b352015-06-24 13:47:24 -040037use Thrift::SSLSocket;
38use Thrift::Socket;
James E. King, III49f4dc02015-10-29 15:52:23 -040039use Thrift::UnixSocket;
Mark Slee3e3d7ad2007-05-16 02:35:58 +000040
James E. King, III20e16bc2017-11-18 22:37:54 -050041use ThriftTest::SecondService;
T Jake Luciani41687fc2008-12-23 03:45:43 +000042use ThriftTest::ThriftTest;
Mark Slee27ed6ec2007-08-16 01:26:31 +000043use ThriftTest::Types;
Mark Slee3e3d7ad2007-05-16 02:35:58 +000044
45$|++;
46
Jim Kingf5f1b352015-06-24 13:47:24 -040047sub usage {
Dean Hamstead8a130f62018-10-17 18:48:42 +110048 print <<"EOF";
Jim Kingf5f1b352015-06-24 13:47:24 -040049Usage: $0 [OPTIONS]
Mark Slee3e3d7ad2007-05-16 02:35:58 +000050
Jim Kingf5f1b352015-06-24 13:47:24 -040051Options: (default)
James E. King, III377719c2017-02-15 14:33:20 -050052 --ca CA to validate server with.
Jim Kingf5f1b352015-06-24 13:47:24 -040053 --cert Certificate to use.
54 Required if using --ssl.
James E. King, III377719c2017-02-15 14:33:20 -050055 --ciphers Acceptable cipher list.
James E. King, III49f4dc02015-10-29 15:52:23 -040056 --domain-socket <file> Use a unix domain socket.
Jim Kingf5f1b352015-06-24 13:47:24 -040057 --help Show usage.
James E. King, III377719c2017-02-15 14:33:20 -050058 --key Certificate key.
59 Required if using --ssl.
Jim Kingf5f1b352015-06-24 13:47:24 -040060 --port <portnum> 9090 Port to use.
61 --protocol {binary} binary Protocol to use.
62 --ssl If present, use SSL.
63 --transport {buffered|framed} buffered Transport to use.
James E. King, III377719c2017-02-15 14:33:20 -050064
Jim Kingf5f1b352015-06-24 13:47:24 -040065EOF
Roger Meier41ad4342015-03-24 22:30:40 +010066}
Mark Slee3e3d7ad2007-05-16 02:35:58 +000067
Jim Kingf5f1b352015-06-24 13:47:24 -040068my %opts = (
69 'port' => 9090,
70 'protocol' => 'binary',
71 'transport' => 'buffered'
72);
Mark Slee3e3d7ad2007-05-16 02:35:58 +000073
Jim Kingf5f1b352015-06-24 13:47:24 -040074GetOptions(\%opts, qw (
James E. King, III377719c2017-02-15 14:33:20 -050075 ca=s
Jim Kingf5f1b352015-06-24 13:47:24 -040076 cert=s
James E. King, III377719c2017-02-15 14:33:20 -050077 ciphers=s
78 key=s
James E. King, III49f4dc02015-10-29 15:52:23 -040079 domain-socket=s
Jim Kingf5f1b352015-06-24 13:47:24 -040080 help
81 host=s
82 port=i
83 protocol=s
84 ssl
85 transport=s
86)) || exit 1;
87
88if ($opts{help}) {
89 usage();
90 exit 0;
91}
92
Jim Kingf5f1b352015-06-24 13:47:24 -040093my $socket = undef;
Dean Hamstead8a130f62018-10-17 18:48:42 +110094if ($opts{'domain-socket'}) {
95 $socket = Thrift::UnixSocket->new($opts{'domain-socket'});
96}
97elsif ($opts{ssl}) {
98 $socket = Thrift::SSLSocket->new(\%opts);
99}
100else {
101 $socket = Thrift::Socket->new($opts{host}, $opts{port});
Jim Kingf5f1b352015-06-24 13:47:24 -0400102}
103
104my $transport;
105if ($opts{transport} eq 'buffered') {
Dean Hamstead8a130f62018-10-17 18:48:42 +1100106 $transport = Thrift::BufferedTransport->new($socket, 1024, 1024);
107}
108elsif ($opts{transport} eq 'framed') {
109 $transport = Thrift::FramedTransport->new($socket);
110}
111else {
Jim Kingf5f1b352015-06-24 13:47:24 -0400112 usage();
113 exit 1;
114}
115
116my $protocol;
James E. King, III20e16bc2017-11-18 22:37:54 -0500117my $protocol2;
118if ($opts{protocol} eq 'binary' || $opts{protocol} eq 'multi') {
Dean Hamstead8a130f62018-10-17 18:48:42 +1100119 $protocol = Thrift::BinaryProtocol->new($transport);
120}
121else {
Jim Kingf5f1b352015-06-24 13:47:24 -0400122 usage();
123 exit 1;
124}
125
James E. King, III20e16bc2017-11-18 22:37:54 -0500126my $secondService = undef;
127if (index($opts{protocol}, 'multi') == 0) {
Dean Hamstead8a130f62018-10-17 18:48:42 +1100128 $protocol2 = Thrift::MultiplexedProtocol->new($protocol, 'SecondService');
129 $protocol = Thrift::MultiplexedProtocol->new($protocol, 'ThriftTest');
130 $secondService = ThriftTest::SecondServiceClient->new($protocol2);
James E. King, III20e16bc2017-11-18 22:37:54 -0500131}
132
Dean Hamstead8a130f62018-10-17 18:48:42 +1100133my $testClient = ThriftTest::ThriftTestClient->new($protocol);
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000134
Jim Kingf5f1b352015-06-24 13:47:24 -0400135eval {
136 $transport->open();
James E. King, III377719c2017-02-15 14:33:20 -0500137};
Jim Kingf5f1b352015-06-24 13:47:24 -0400138if($@){
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000139 die(Dumper($@));
140}
James E. King, III20e16bc2017-11-18 22:37:54 -0500141
142use constant ERR_BASETYPES => 1;
143use constant ERR_STRUCTS => 2;
144use constant ERR_CONTAINERS => 4;
145use constant ERR_EXCEPTIONS => 8;
146use constant ERR_PROTOCOL => 16;
147use constant ERR_UNKNOWN => 64;
148
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000149my $start = gettimeofday();
150
151#
152# VOID TEST
153#
Dean Hamstead8a130f62018-10-17 18:48:42 +1100154print('testVoid()');
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000155$testClient->testVoid();
156print(" = void\n");
157
158#
159# STRING TEST
160#
Dean Hamstead8a130f62018-10-17 18:48:42 +1100161print('testString("Test")');
162my $s = $testClient->testString('Test');
163print(qq| = "$s"\n|);
James E. King, III20e16bc2017-11-18 22:37:54 -0500164exit(ERR_BASETYPES) if ($s ne 'Test');
165
166#
167# MULTIPLEXED TEST
168#
169if (index($opts{protocol}, 'multi') == 0) {
Dean Hamstead8a130f62018-10-17 18:48:42 +1100170 print('secondtestString("Test2")');
171 $s = $secondService->secondtestString('Test2');
172 print(qq| = "$s"\n|);
James E. King, III20e16bc2017-11-18 22:37:54 -0500173 exit(ERR_PROTOCOL) if ($s ne 'testString("Test2")');
174}
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000175
176#
Nobuaki Sukegawaa649e742015-09-21 13:53:25 +0900177# BOOL TEST
178#
Dean Hamstead8a130f62018-10-17 18:48:42 +1100179print('testBool(1)');
Jens Geyerd629ea02015-09-23 21:16:50 +0200180my $t = $testClient->testBool(1);
181print(" = $t\n");
James E. King, III20e16bc2017-11-18 22:37:54 -0500182exit(ERR_BASETYPES) if ($t ne 1);
Dean Hamstead8a130f62018-10-17 18:48:42 +1100183print('testBool(0)');
Jens Geyerd629ea02015-09-23 21:16:50 +0200184my $f = $testClient->testBool(0);
185print(" = $f\n");
Dean Hamstead8a130f62018-10-17 18:48:42 +1100186exit(ERR_BASETYPES) if ($f ne q||);
Nobuaki Sukegawaa649e742015-09-21 13:53:25 +0900187
188
189#
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000190# BYTE TEST
191#
Dean Hamstead8a130f62018-10-17 18:48:42 +1100192print('testByte(1)');
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000193my $u8 = $testClient->testByte(1);
194print(" = $u8\n");
195
196#
197# I32 TEST
198#
Dean Hamstead8a130f62018-10-17 18:48:42 +1100199print('testI32(-1)');
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000200my $i32 = $testClient->testI32(-1);
201print(" = $i32\n");
James E. King, III20e16bc2017-11-18 22:37:54 -0500202exit(ERR_BASETYPES) if ($i32 ne -1);
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000203
204#
James E. King, III20e16bc2017-11-18 22:37:54 -0500205# I64 TEST
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000206#
Dean Hamstead8a130f62018-10-17 18:48:42 +1100207print('testI64(-34359738368)');
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000208my $i64 = $testClient->testI64(-34359738368);
209print(" = $i64\n");
James E. King, III20e16bc2017-11-18 22:37:54 -0500210exit(ERR_BASETYPES) if ($i64 ne -34359738368);
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000211
212#
213# DOUBLE TEST
214#
Dean Hamstead8a130f62018-10-17 18:48:42 +1100215print('testDouble(-852.234234234)');
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000216my $dub = $testClient->testDouble(-852.234234234);
217print(" = $dub\n");
James E. King, III20e16bc2017-11-18 22:37:54 -0500218exit(ERR_BASETYPES) if ($dub ne -852.234234234);
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000219
220#
Jens Geyer8bcfdd92014-12-14 03:14:26 +0100221# BINARY TEST --- TODO
222#
223
224
225#
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000226# STRUCT TEST
227#
Dean Hamstead8a130f62018-10-17 18:48:42 +1100228print('testStruct({"Zero", 1, -3, -5})');
229my $out = ThriftTest::Xtruct->new();
230$out->string_thing('Zero');
Mark Slee82664432007-09-19 06:49:30 +0000231$out->byte_thing(1);
232$out->i32_thing(-3);
233$out->i64_thing(-5);
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000234my $in = $testClient->testStruct($out);
Dean Hamstead8a130f62018-10-17 18:48:42 +1100235print(' = {"'.$in->string_thing.'", '.
236 $in->byte_thing.', '.
237 $in->i32_thing.', '.
Mark Slee82664432007-09-19 06:49:30 +0000238 $in->i64_thing."}\n");
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000239
240#
241# NESTED STRUCT TEST
242#
Dean Hamstead8a130f62018-10-17 18:48:42 +1100243print('testNest({1, {"Zero", 1, -3, -5}, 5}');
244my $out2 = ThriftTest::Xtruct2->new();
Mark Slee82664432007-09-19 06:49:30 +0000245$out2->byte_thing(1);
246$out2->struct_thing($out);
247$out2->i32_thing(5);
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000248my $in2 = $testClient->testNest($out2);
Mark Slee82664432007-09-19 06:49:30 +0000249$in = $in2->struct_thing;
Dean Hamstead8a130f62018-10-17 18:48:42 +1100250print(' = {'.$in2->byte_thing.', {"'.
251 $in->string_thing.'", '.
252 $in->byte_thing.', '.
253 $in->i32_thing.', '.
254 $in->i64_thing.'}, '.
Mark Slee82664432007-09-19 06:49:30 +0000255 $in2->i32_thing."}\n");
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000256
257#
258# MAP TEST
259#
260my $mapout = {};
261for (my $i = 0; $i < 5; ++$i) {
262 $mapout->{$i} = $i-10;
263}
Dean Hamstead8a130f62018-10-17 18:48:42 +1100264print('testMap({');
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000265my $first = 1;
266while( my($key,$val) = each %$mapout) {
267 if ($first) {
268 $first = 0;
Dean Hamstead8a130f62018-10-17 18:48:42 +1100269 }
270 else {
271 print(', ');
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000272 }
273 print("$key => $val");
274}
Dean Hamstead8a130f62018-10-17 18:48:42 +1100275print('})');
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000276
277
278my $mapin = $testClient->testMap($mapout);
Dean Hamstead8a130f62018-10-17 18:48:42 +1100279print(' = {');
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000280
281$first = 1;
282while( my($key,$val) = each %$mapin){
283 if ($first) {
284 $first = 0;
Dean Hamstead8a130f62018-10-17 18:48:42 +1100285 }
286 else {
287 print(', ');
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000288 }
289 print("$key => $val");
290}
291print("}\n");
292
293#
294# SET TEST
295#
296my $setout = [];
297for (my $i = -2; $i < 3; ++$i) {
298 push(@$setout, $i);
299}
300
Dean Hamstead8a130f62018-10-17 18:48:42 +1100301print('testSet({'.join(',',@$setout).'})');
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000302
303my $setin = $testClient->testSet($setout);
304
Dean Hamstead8a130f62018-10-17 18:48:42 +1100305print(' = {'.join(',',@$setout)."}\n");
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000306
307#
308# LIST TEST
309#
310my $listout = [];
311for (my $i = -2; $i < 3; ++$i) {
312 push(@$listout, $i);
313}
314
Dean Hamstead8a130f62018-10-17 18:48:42 +1100315print('testList({'.join(',',@$listout).'})');
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000316
317my $listin = $testClient->testList($listout);
318
Dean Hamstead8a130f62018-10-17 18:48:42 +1100319print(' = {'.join(',',@$listin)."}\n");
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000320
321#
322# ENUM TEST
323#
Dean Hamstead8a130f62018-10-17 18:48:42 +1100324print('testEnum(ONE)');
T Jake Luciani41687fc2008-12-23 03:45:43 +0000325my $ret = $testClient->testEnum(ThriftTest::Numberz::ONE);
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000326print(" = $ret\n");
327
Dean Hamstead8a130f62018-10-17 18:48:42 +1100328print('testEnum(TWO)');
T Jake Luciani41687fc2008-12-23 03:45:43 +0000329$ret = $testClient->testEnum(ThriftTest::Numberz::TWO);
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000330print(" = $ret\n");
331
Dean Hamstead8a130f62018-10-17 18:48:42 +1100332print('testEnum(THREE)');
T Jake Luciani41687fc2008-12-23 03:45:43 +0000333$ret = $testClient->testEnum(ThriftTest::Numberz::THREE);
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000334print(" = $ret\n");
335
Dean Hamstead8a130f62018-10-17 18:48:42 +1100336print('testEnum(FIVE)');
T Jake Luciani41687fc2008-12-23 03:45:43 +0000337$ret = $testClient->testEnum(ThriftTest::Numberz::FIVE);
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000338print(" = $ret\n");
339
Dean Hamstead8a130f62018-10-17 18:48:42 +1100340print('testEnum(EIGHT)');
T Jake Luciani41687fc2008-12-23 03:45:43 +0000341$ret = $testClient->testEnum(ThriftTest::Numberz::EIGHT);
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000342print(" = $ret\n");
343
344#
345# TYPEDEF TEST
346#
Dean Hamstead8a130f62018-10-17 18:48:42 +1100347print('testTypedef(309858235082523)');
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000348my $uid = $testClient->testTypedef(309858235082523);
349print(" = $uid\n");
350
351#
352# NESTED MAP TEST
353#
Dean Hamstead8a130f62018-10-17 18:48:42 +1100354print('testMapMap(1)');
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000355my $mm = $testClient->testMapMap(1);
Dean Hamstead8a130f62018-10-17 18:48:42 +1100356print(' = {');
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000357while( my ($key,$val) = each %$mm) {
358 print("$key => {");
359 while( my($k2,$v2) = each %$val) {
360 print("$k2 => $v2, ");
361 }
Dean Hamstead8a130f62018-10-17 18:48:42 +1100362 print('}, ');
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000363}
364print("}\n");
365
366#
367# INSANITY TEST
368#
Dean Hamstead8a130f62018-10-17 18:48:42 +1100369my $insane = ThriftTest::Insanity->new();
T Jake Luciani41687fc2008-12-23 03:45:43 +0000370$insane->{userMap}->{ThriftTest::Numberz::FIVE} = 5000;
Dean Hamstead8a130f62018-10-17 18:48:42 +1100371my $truck = ThriftTest::Xtruct->new();
372$truck->string_thing('Hello2');
Jens Geyerd629ea02015-09-23 21:16:50 +0200373$truck->byte_thing(2);
374$truck->i32_thing(2);
375$truck->i64_thing(2);
Dean Hamstead8a130f62018-10-17 18:48:42 +1100376my $truck2 = ThriftTest::Xtruct->new();
377$truck2->string_thing('Goodbye4');
Jens Geyerd629ea02015-09-23 21:16:50 +0200378$truck2->byte_thing(4);
379$truck2->i32_thing(4);
380$truck2->i64_thing(4);
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000381push(@{$insane->{xtructs}}, $truck);
Jens Geyerd629ea02015-09-23 21:16:50 +0200382push(@{$insane->{xtructs}}, $truck2);
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000383
Dean Hamstead8a130f62018-10-17 18:48:42 +1100384print('testInsanity()');
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000385my $whoa = $testClient->testInsanity($insane);
Dean Hamstead8a130f62018-10-17 18:48:42 +1100386print(' = {');
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000387while( my ($key,$val) = each %$whoa) {
388 print("$key => {");
389 while( my($k2,$v2) = each %$val) {
390 print("$k2 => {");
391 my $userMap = $v2->{userMap};
Dean Hamstead8a130f62018-10-17 18:48:42 +1100392 print('{');
393 if (ref($userMap) eq 'HASH') {
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000394 while( my($k3,$v3) = each %$userMap) {
395 print("$k3 => $v3, ");
396 }
397 }
Dean Hamstead8a130f62018-10-17 18:48:42 +1100398 print('}, ');
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000399
400 my $xtructs = $v2->{xtructs};
Dean Hamstead8a130f62018-10-17 18:48:42 +1100401 print('{');
402 if (ref($xtructs) eq 'ARRAY') {
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000403 foreach my $x (@$xtructs) {
Dean Hamstead8a130f62018-10-17 18:48:42 +1100404 print('{"'.$x->{string_thing}.'", '.
405 $x->{byte_thing}.', '.$x->{i32_thing}.', '.$x->{i64_thing}.'}, ');
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000406 }
407 }
Dean Hamstead8a130f62018-10-17 18:48:42 +1100408 print('}');
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000409
Dean Hamstead8a130f62018-10-17 18:48:42 +1100410 print('}, ');
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000411 }
Dean Hamstead8a130f62018-10-17 18:48:42 +1100412 print('}, ');
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000413}
414print("}\n");
415
416#
417# EXCEPTION TEST
418#
Dean Hamstead8a130f62018-10-17 18:48:42 +1100419print(q|testException('Xception')|);
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000420eval {
421 $testClient->testException('Xception');
422 print(" void\nFAILURE\n");
Mark Slee82664432007-09-19 06:49:30 +0000423}; if($@ && $@->UNIVERSAL::isa('ThriftTest::Xception')) {
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000424 print(' caught xception '.$@->{errorCode}.': '.$@->{message}."\n");
425}
426
427
428#
429# Normal tests done.
430#
431my $stop = gettimeofday();
Dean Hamstead8a130f62018-10-17 18:48:42 +1100432my $elp = sprintf('%d',1000*($stop - $start), 0);
Mark Slee3e3d7ad2007-05-16 02:35:58 +0000433print("Total time: $elp ms\n");
434
435#
436# Extraneous "I don't trust PHP to pack/unpack integer" tests
437#
438
439# Max I32
440my $num = 2**30 + 2**30 - 1;
441my $num2 = $testClient->testI32($num);
442if ($num != $num2) {
443 print "Missed max32 $num = $num2\n";
444}
445
446# Min I32
447$num = 0 - 2**31;
448$num2 = $testClient->testI32($num);
449if ($num != $num2) {
450 print "Missed min32 $num = $num2\n";
451}
452
453# Max Number I can get out of my perl
454$num = 2**40;
455$num2 = $testClient->testI64($num);
456if ($num != $num2) {
457 print "Missed max64 $num = $num2\n";
458}
459
460# Max Number I can get out of my perl
461$num = 0 - 2**40;
462$num2 = $testClient->testI64($num);
463if ($num != $num2) {
464 print "Missed min64 $num = $num2\n";
465}
466
467$transport->close();
468
469
470