Apply style changes to *.t
[www-quvi.git] / t / 01_codes.t
blob7ddc9dabfb656b41f89fc8a6863efa2d0c5236a7
2 # WWW::Quvi
3 # Copyright (C) 2011  Toni Gundogdu <legatvs@gmail.com>
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301, USA.
21 use warnings;
22 use strict;
24 use Test::More;
25 use WWW::Quvi;
27 my @return = (
28               WWW::Quvi::OK,                WWW::Quvi::Mem,
29               WWW::Quvi::BadHandle,         WWW::Quvi::InvArg,
30               WWW::Quvi::CurlInit,          WWW::Quvi::Last,
31               WWW::Quvi::AbortedByCallback, WWW::Quvi::LuaInit,
32               WWW::Quvi::NoLuaWebsite,      WWW::Quvi::NoLuaUtil,
33               WWW::Quvi::NoSupport,         WWW::Quvi::CallbackError,
34               WWW::Quvi::IconvError,        WWW::Quvi::LuaError
35              );
37 my @proto = (
38              WWW::Quvi::ProtoHttp, WWW::Quvi::ProtoMms,
39              WWW::Quvi::ProtoRtsp, WWW::Quvi::ProtoRtmp,
40              WWW::Quvi::ProtoAll
41             );
43 plan tests => scalar @return + scalar @proto;
45 my $n = -1;
46 foreach (@return)
48   is($_, ++$n);
50   #  diag "$_,$n\n";
51   $n = 0x40 if $n == WWW::Quvi::NoLuaUtil;
54 $n = 1;
55 foreach (@proto)
57   is($_, $n);
59   #  diag "$_,$n\n";
60   if ($n == WWW::Quvi::ProtoRtmp)
61   {
62     $n = 0x1 | 0x2 | 0x4 | 0x8;
63   }
64   else
65   {
66     $n = $n << 1;
67   }
70 # vim: set ts=2 sw=2 tw=72 expandtab: