Search
lxdream.org :: lxdream/test/testdata.h
lxdream 0.9.1
released Jun 29
Download Now
filename test/testdata.h
changeset 190:f7653df5e832
prev185:6755a04c447f
next263:6f641270b2aa
author nkeynes
date Sat Aug 05 00:18:21 2006 +0000 (16 years ago)
permissions -rw-r--r--
last change Add error lines to tests with incomplete polys
Split clip tests to separate data file
Add tests for cmd bit 23 ("use list size field")
file annotate diff log raw
nkeynes@185
     1
/*
nkeynes@190
     2
 * $Id: testdata.h,v 1.2 2006-08-02 04:13:15 nkeynes Exp $
nkeynes@185
     3
 * 
nkeynes@185
     4
 * Test data loader
nkeynes@185
     5
 *
nkeynes@185
     6
 * Copyright (c) 2006 Nathan Keynes.
nkeynes@185
     7
 *
nkeynes@185
     8
 * This program is free software; you can redistribute it and/or modify
nkeynes@185
     9
 * it under the terms of the GNU General Public License as published by
nkeynes@185
    10
 * the Free Software Foundation; either version 2 of the License, or
nkeynes@185
    11
 * (at your option) any later version.
nkeynes@185
    12
 *
nkeynes@185
    13
 * This program is distributed in the hope that it will be useful,
nkeynes@185
    14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
nkeynes@185
    15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
nkeynes@185
    16
 * GNU General Public License for more details.
nkeynes@185
    17
 */
nkeynes@185
    18
nkeynes@185
    19
#include <stdio.h>
nkeynes@185
    20
nkeynes@190
    21
#define MAX_DATA_BLOCKS 16
nkeynes@185
    22
nkeynes@185
    23
typedef struct test_data_block {
nkeynes@185
    24
    const char *name;
nkeynes@185
    25
    unsigned int length;
nkeynes@185
    26
    char *data;
nkeynes@185
    27
} *test_data_block_t;
nkeynes@185
    28
nkeynes@185
    29
typedef struct test_data {
nkeynes@185
    30
    const char *test_name;
nkeynes@185
    31
    struct test_data *next;
nkeynes@185
    32
    struct test_data_block item[MAX_DATA_BLOCKS];
nkeynes@185
    33
} *test_data_t;
nkeynes@185
    34
nkeynes@185
    35
test_data_t load_test_dataset( FILE *f );
nkeynes@185
    36
void free_test_dataset( test_data_t dataset );
nkeynes@185
    37
void dump_test_dataset( FILE *f, test_data_t dataset );
nkeynes@185
    38
int test_block_compare( test_data_block_t expect, char *actual, int actual_length );
nkeynes@185
    39
test_data_block_t get_test_data( test_data_t dataset, char *item_name );
nkeynes@185
    40
.