/***{{{******************************************************************* * This file is part of libco - object library for C * * Copyright (c) 2002 Peter Rockai (yenar) * * * * 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; see the file COPYING. If not, write to * * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * * Boston, MA 02111-1307, USA. * *******************************************************************}}}***/ /* {{{ file description */ /** \file libco_object.c * \brief Test libco's object engine. Quite simple, for now. */ /* }}} */ /* {{{ includes */ #include "co_string.h" #include "co_super.h" #include "test_util.h" /* }}} */ /* {{{ */ int main (void) { char *test, buf [32]; //libco_init (); co_super sup = co_init (); test = saprintf ("this is %s test... %d\n", "simple", 3); if (!test) error (1, "NULL pointer returned by vsaprintf\n"); if (strcmp (test, "this is simple test... 3\n")) error (2, "result string isnot what expected\n"); strcpy2 (0, "test", 5); strcpy2 (buf, 0, 8); CO_DEBUG (2, "buffer: %s", buf); strcpy2 (buf, 0, 2); CO_DEBUG (2, "buffer: %s", buf); strcpy2 (buf, "test", 8); CO_DEBUG (2, "buffer: %s", buf); return 0; } /* }}} */