kpilot/lib

testconstants.cc

00001 /* testconstants KPilot
00002 **
00003 ** Copyright (C) 2005 by Adriaan de Groot <groot@kde.org)
00004 **
00005 ** Checks that various data structures are sized properly.
00006 */
00007 
00008 /*
00009 ** This program is free software; you can redistribute it and/or modify
00010 ** it under the terms of the GNU Lesser General Public License as published by
00011 ** the Free Software Foundation; either version 2.1 of the License, or
00012 ** (at your option) any later version.
00013 **
00014 ** This program is distributed in the hope that it will be useful,
00015 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00017 ** GNU Lesser General Public License for more details.
00018 **
00019 ** You should have received a copy of the GNU Lesser General Public License
00020 ** along with this program in a file called COPYING; if not, write to
00021 ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00022 ** MA 02110-1301, USA.
00023 */
00024 
00025 /*
00026 ** Bug reports and questions can be sent to kde-pim@kde.org
00027 */
00028 
00029 #include "options.h"
00030 
00031 #define private public
00032 #define protected public
00033 
00034 #include "pilotDatabase.h"
00035 
00036 #include <pi-appinfo.h>
00037 
00038 int main(int argc, char **argv)
00039 {
00040     PilotAppInfoBase info;
00041 
00042     kdDebug() << "*** Sizes of structures" << endl;
00043     kdDebug() << "AppInfoBase: " << sizeof(PilotAppInfoBase) << endl;
00044     kdDebug() << "CategoryInfo: " << sizeof(info.categoryInfo()) << endl;
00045     kdDebug() << "CategoryInfo: " << sizeof(*info.categoryInfo()) << endl;
00046     kdDebug() << "Category names: " << sizeof(info.categoryInfo()->name) << endl;
00047     kdDebug() << "Single category: " << sizeof(info.categoryInfo()->name[0]) << endl;
00048 
00049     if ( sizeof(info.categoryInfo()->name[0]) != 16 ) return 1;
00050     if ( sizeof(info.categoryInfo()->name) / sizeof(info.categoryInfo()->name[0]) != 16 ) return 1;
00051     return 0;
00052 }
00053 
00054 
KDE Home | KDE Accessibility Home | Description of Access Keys