## OilTest

OilTest — Test and profile function implementations.

## Synopsis

                        OilTest;
    void                (*OilTestFunction)                  (OilTest *test);
    #define             OIL_TEST_HEADER
    #define             OIL_TEST_FOOTER
    OilTest*            oil_test_new                        (OilFunctionClass *klass);
    void                oil_test_init                       (OilTest *test);
    void                oil_test_free                       (OilTest *test);
    void                oil_test_set_iterations             (OilTest *test,
                                                             int iterations);
    void                oil_test_check_ref                  (OilTest *test);
    int                 oil_test_check_impl                 (OilTest *test,
                                                             OilFunctionImpl *impl);
    void                oil_test_cleanup                    (OilTest *test);
    void*               oil_test_get_source_data            (OilTest *test,
                                                             OilArgType arg_type);
    int                 oil_test_get_value                  (OilTest *test,
                                                             OilArgType arg_type);
    void                oil_test_set_test_footer            (OilTest *test,
                                                             OilParameter *p,
                                                             int test_footer);
    void                oil_test_set_test_header            (OilTest *test,
                                                             OilParameter *p,
                                                             int test_header);

## Description

## Details

### OilTest

    typedef struct {
    } OilTest;

An opaque structure describing how to test an OilFunctionImpl for an OilFunctionClass.

### OilTestFunction ()

    void                (*OilTestFunction)                  (OilTest *test);

Typedef for functions that initialize special values in source arrays for a particular function class.

`test` : | the `OilTest` structure

### OIL_TEST_HEADER

    #define OIL_TEST_HEADER 256

Default number of bytes that are prepended to the array test area.

### OIL_TEST_FOOTER

    #define OIL_TEST_FOOTER 256

Default number of bytes that are appended to the array test area.

### oil_test_new ()

    OilTest*            oil_test_new                        (OilFunctionClass *klass);

Creates a new OilTest for the OilFunctionClass represented by `klass`.

`klass` : | an OilFunctionClass
Returns : | the new OilTest

### oil_test_init ()

    void                oil_test_init                       (OilTest *test);

Intializes `test`.

FIXME: needs work

`test` : | the OilTest

### oil_test_free ()

    void                oil_test_free                       (OilTest *test);

Frees memory associated with `test`.

`test` : | the OilTest

### oil_test_set_iterations ()

    void                oil_test_set_iterations             (OilTest *test,
                                                             int iterations);

Sets the number of iterations of `test` to `iterations`.

`test` : | the OilTest
`iterations` : | the number of iterations

### oil_test_check_ref ()

    void                oil_test_check_ref                  (OilTest *test);

Runs the test specified by `test` on the reference function of the class being tested.

`test` : | the OilTest

### oil_test_check_impl ()

    int                 oil_test_check_impl                 (OilTest *test,
                                                             OilFunctionImpl *impl);

Runs the testing procedure described by `test` on the implementation `impl`.

`test` : | the OilTest
`impl` : | an OilFunctionImpl
Returns : | 1 if `impl` passes the test, 0 if it fails

### oil_test_cleanup ()

    void                oil_test_cleanup                    (OilTest *test);

Cleans up `test`.

FIXME: needs work

`test` : | the OilTest

### oil_test_get_source_data ()

    void*               oil_test_get_source_data            (OilTest *test,
                                                             OilArgType arg_type);

`test` : |
`arg_type` : |
Returns : |

### oil_test_get_value ()

    int                 oil_test_get_value                  (OilTest *test,
                                                             OilArgType arg_type);

`test` : |
`arg_type` : |
Returns : |

### oil_test_set_test_footer ()

    void                oil_test_set_test_footer            (OilTest *test,
                                                             OilParameter *p,
                                                             int test_footer);

Sets the number of bytes of guard footer for `p` to `test_footer`.

`test` : | the OilTest
`p` : | the OilParameter to change the footer for
`test_footer` : | the number of bytes of guard footer

### oil_test_set_test_header ()

    void                oil_test_set_test_header            (OilTest *test,
                                                             OilParameter *p,
                                                             int test_header);

Sets the number of bytes of guard header for `p` to `test_header`.

`test` : | the OilTest
`p` : | the OilParameter to change the header for
`test_header` : | the number of bytes of guard header