aboutsummaryrefslogtreecommitdiff
path: root/tests/pack.at
blob: 0baf8e6c99a88ab271d6e11c60505cd2391f05f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# This file is part of vmod-binlog testsuite -*- autotest -*-
# Copyright (C) 2013 Sergey Poznyakoff
#
# Vmod-binlog is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# Vmod-binlog is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with vmod-binlog.  If not, see <http://www.gnu.org/licenses/>.

m4_dnl TESTPACK(conv, args [, out])
m4_define([TESTPACK],
[AT_SETUP($1)
AT_KEYWORDS([pack $1])
AT_CHECK([binpack -- $1 $2 | binpack -d -- $1 | sed 's/ /_/g'],[0],
[m4_if([$3],,[m4_bpatsubst([$2],[ ],[_])
],[$3
])])
AT_CLEANUP])

AT_BANNER(Pack conversions)

TESTPACK(Z20, text, text_______________)
TESTPACK(c, A)
TESTPACK(s, 115)
TESTPACK(S, 115)
TESTPACK(l, 137)
TESTPACK(L, 137)
TESTPACK(q, 137)
TESTPACK(Q, 137)
TESTPACK(i, 137)
TESTPACK(i, -137)
TESTPACK(I, 137)
TESTPACK(n, 143)
TESTPACK(N, 2130706433)
TESTPACK(v, 143)
TESTPACK(V, 2130706433)
#TESTPACK(f, 1.456)
#TESTPACK(d, 1.456)
TESTPACK(L2, [24 67], 24_67)
TESTPACK(lZ5l2, [137 text -568 1025])

Return to:

Send suggestions and report system problems to the System administrator.