/** * \file * runtest.c: the main runner for my tests * Copyright (C) 2011 Georg Hopp * * 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 3 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, see . */ #include #include #include #include #include "runtest.h" #include "tr/class.h" #define TEST_OK_CHAR '.' #define TEST_FAILED_CHAR 'F' #define TEST_ERROR_CHAR 'E' const char results[3] = { TEST_OK_CHAR, TEST_FAILED_CHAR, TEST_ERROR_CHAR }; int isObjectNull(void * object) { TR_class_ptr class = TR_GET_CLASS(object); if (! TR_IS_OBJECT(object)) { return 0; } return isMemNull(object, class->object_size); } int isMemNull(void * _mem, size_t size) { size_t index; if (NULL == _mem) { return 0; } for(index=0; index