[xplc-cvs] xplc/tests test012.cpp,NONE,1.1 test.h,1.26,1.27 testmain.cpp,1.11,1.12
Cross-platform lightweight components
Status: Alpha
Brought to you by:
pphaneuf
From: Pierre P. <pph...@us...> - 2005-12-20 02:28:57
|
Update of /cvsroot/xplc/xplc/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1060/tests Modified Files: test.h testmain.cpp Added Files: test012.cpp Log Message: Added a component to programmatically generate UUIDs. Index: test.h =================================================================== RCS file: /cvsroot/xplc/xplc/tests/test.h,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** test.h 25 Jun 2004 18:23:30 -0000 1.26 --- test.h 20 Dec 2005 02:28:49 -0000 1.27 *************** *** 4,8 **** * Copyright (C) 2000-2003, Pierre Phaneuf * Copyright (C) 2001, Stéphane Lajoie ! * Copyright (C) 2002-2004, Net Integration Technologies, Inc. * * This library is free software; you can redistribute it and/or --- 4,8 ---- * Copyright (C) 2000-2003, Pierre Phaneuf * Copyright (C) 2001, Stéphane Lajoie ! * Copyright (C) 2002-2005, Net Integration Technologies, Inc. * * This library is free software; you can redistribute it and/or *************** *** 42,45 **** --- 42,46 ---- void test010(); void test011(); + void test012(); void test_assert(const char* file, Index: testmain.cpp =================================================================== RCS file: /cvsroot/xplc/xplc/tests/testmain.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** testmain.cpp 31 Dec 2004 08:56:35 -0000 1.11 --- testmain.cpp 20 Dec 2005 02:28:49 -0000 1.12 *************** *** 2,5 **** --- 2,6 ---- * * XPLC - Cross-Platform Lightweight Components + * Copyright (C) 2005, Net Integration Technologies, Inc. * Copyright (C) 2000-2002, Pierre Phaneuf * Copyright (C) 2001, Stéphane Lajoie *************** *** 52,55 **** --- 53,57 ---- ADD_TEST(test010), ADD_TEST(test011), + ADD_TEST(test012), { 0, 0 } }; --- NEW FILE: test012.cpp --- /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- * * XPLC - Cross-Platform Lightweight Components * Copyright (C) 2005, Net Integration Technologies, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #include "test.h" #include <xplc/IUuidGen.h> #include <xplc/uuidops.h> #include <xplc/utils.h> /* * test012 * * Tests UUID generation. */ void test012() { IServiceManager* servmgr; IObject* obj; IUuidGen* uuidgen = 0; UUID uuid1; UUID uuid2; servmgr = XPLC_getServiceManager(); ASSERT(servmgr != 0, "could not obtain service manager"); obj = servmgr->getObject(XPLC_uuidGen); ASSERT(obj != 0, "could not get the UUID generator component"); uuidgen = mutate<IUuidGen>(obj); ASSERT(uuidgen != 0, "UUID generator does not have expected interface"); uuid1 = uuidgen->createUuid(); VERIFY(uuid1 != UUID_null, "generated UUID is null"); uuid2 = uuidgen->createUuid(); VERIFY(uuid1 != UUID_null, "generated UUID is null"); VERIFY(uuid1 != uuid2, "generated UUIDs are equal"); } |