# This file is part of vmod-binlog testsuite -*- autotest -*- # Copyright (C) 2013-2014 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 . 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])