blob: b21b074b1f8d5fab7d537f98961eb53d2db97cd1 [file] [log] [blame]
/* tests for utilities of libmsomcore */
/*
* (C) 2014 Holger Hans Peter Freyther
*
* All Rights Reserved
*
* This program 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 2 of the License, or
* (at your option) any later version.
*
* This program 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 this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#include <osmocom/core/utils.h>
#include <stdio.h>
static void hexdump_test(void)
{
uint8_t data[4098];
int i;
for (i = 0; i < ARRAY_SIZE(data); ++i)
data[i] = i & 0xff;
printf("Plain dump\n");
printf("%s\n", osmo_hexdump(data, 4));
printf("Corner case\n");
printf("%s\n", osmo_hexdump(data, ARRAY_SIZE(data)));
printf("%s\n", osmo_hexdump_nospc(data, ARRAY_SIZE(data)));
}
int main(int argc, char **argv)
{
hexdump_test();
return 0;
}