test-guid.c revision 33750ba29b605a925af5aed58d3f3735422b1e25
/* Copyright (c) 2014 Dovecot authors, see the included COPYING file */
#include "test-lib.h"
#include "guid.h"
void test_guid(void)
{
static const guid_128_t test_guid =
{ 0x01, 0x23, 0x45, 0x67, 0x89,
0xab, 0xcd, 0xef,
0xAB, 0xCD, 0xEF,
0x00, 0x00, 0x00, 0x00, 0x00 };
const char *str;
unsigned int i;
test_begin("guid_128_generate()");
test_end();
test_begin("guid_128_is_empty()");
test_end();
test_begin("guid_128_copy()");
test_end();
test_begin("guid_128_to_string()");
test_end();
test_begin("guid_128_from_string()");
/* empty */
/* too large */
/* too small */
/* reset to normal */
/* upper + lowercase hex chars */
for (i = 0; i < 10; i++)
guidbuf[i] = '0' + i;
for (i = 0; i < 6; i++)
for (i = 0; i < 6; i++)
/* non-hex chars */
guidbuf[0] = 'g';
guidbuf[0] = ' ';
test_end();
}