Search
lxdream.org :: lxdream/test/testdata.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename test/testdata.h
changeset 185:6755a04c447f
next190:f7653df5e832
author nkeynes
date Tue Jul 11 01:35:27 2006 +0000 (14 years ago)
permissions -rw-r--r--
last change First commit of system test framework. 3 initial test cases (incomplete):
testide, testmath, and testta
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/test/testdata.h Tue Jul 11 01:35:27 2006 +0000
1.3 @@ -0,0 +1,40 @@
1.4 +/*
1.5 + * $Id: testdata.h,v 1.1 2006-07-11 01:35:23 nkeynes Exp $
1.6 + *
1.7 + * Test data loader
1.8 + *
1.9 + * Copyright (c) 2006 Nathan Keynes.
1.10 + *
1.11 + * This program is free software; you can redistribute it and/or modify
1.12 + * it under the terms of the GNU General Public License as published by
1.13 + * the Free Software Foundation; either version 2 of the License, or
1.14 + * (at your option) any later version.
1.15 + *
1.16 + * This program is distributed in the hope that it will be useful,
1.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.19 + * GNU General Public License for more details.
1.20 + */
1.21 +
1.22 +#include <stdio.h>
1.23 +
1.24 +#define MAX_DATA_BLOCKS 4
1.25 +
1.26 +typedef struct test_data_block {
1.27 + const char *name;
1.28 + unsigned int length;
1.29 + char *data;
1.30 +} *test_data_block_t;
1.31 +
1.32 +typedef struct test_data {
1.33 + const char *test_name;
1.34 + struct test_data *next;
1.35 + struct test_data_block item[MAX_DATA_BLOCKS];
1.36 +} *test_data_t;
1.37 +
1.38 +test_data_t load_test_dataset( FILE *f );
1.39 +void free_test_dataset( test_data_t dataset );
1.40 +void dump_test_dataset( FILE *f, test_data_t dataset );
1.41 +int test_block_compare( test_data_block_t expect, char *actual, int actual_length );
1.42 +test_data_block_t get_test_data( test_data_t dataset, char *item_name );
1.43 +
.