/**
* \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 "token/cclass.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)
{
const CCLASS * class = _object;
if (! isObject(_object)) {
return 0;
}
return isMemNull(
_object + CCLASS_PTR_SIZE,
(*class)->size - CCLASS_PTR_SIZE);
}
int
isMemNull(void * _mem, size_t size)
{
size_t index;
if (NULL == _mem) {
return 0;
}
for(index=0; index