LUMIERA.clone/tests/library/test-luid.c
Christian Thaeter 9826fd180d renamed the uuid to luid
uuid's are somewhat standardized, we use our uid's slightly differently,
so change the name not to be confused with standards.
 * Small fix for luid generation
 * build a 'luidgen' tool which will be used by the interface gen later
 * add emacs vars
 * include the luidgen tool in automake
2008-08-10 12:18:20 +02:00

81 lines
1.8 KiB
C

/*
test-luid.c - test the luid lib
Copyright (C) Lumiera.org
2007, 2008 Christian Thaeter <ct@pipapo.org>
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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
//#include "cinelerra-config.h"
//#include <stdio.h>
#include "lib/luid.h"
#include <nobug.h>
//CINELERRA_ERROR_DEFINE(TEST, "test error");
int
main (int argc, char** argv)
{
NOBUG_INIT;
if (argc == 1)
return 0;
if (!strcmp(argv[1], "uuidgen_2"))
{
lumiera_uid luid1;
lumiera_uid luid2;
lumiera_uid_gen (&luid1);
lumiera_uid_gen (&luid2);
printf ("%d\n", lumiera_uid_eq (&luid2, &luid1));
}
else if (!strcmp(argv[1], "uuidgen_copy"))
{
lumiera_uid luid1;
lumiera_uid luid2;
lumiera_uid_gen (&luid1);
lumiera_uid_copy (&luid2, &luid1);
printf ("%d\n", lumiera_uid_eq (&luid2, &luid1));
}
else if (!strcmp(argv[1], "ptrs"))
{
lumiera_uid luid;
lumiera_uid_set_ptr (&luid, &luid);
printf ("%d\n", lumiera_uid_ptr_get (&luid) == &luid);
}
else
return 1;
return 0;
}
/*
// Local Variables:
// mode: C
// c-file-style: "gnu"
// indent-tabs-mode: nil
// End:
*/