test_1.c 914 Bytes
Newer Older
1 2 3
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
jkvis's avatar
jkvis committed
4
#include <string.h>
5 6 7 8 9 10 11 12 13 14 15 16 17 18

#include "../include/gesa.h"
#include "utils.h"


int main(int argc, char* argv[])
{
    (void) argc;
    (void) argv;

    printf("version: %s\n", version());

    printf("test 1\n");

19 20
    GESA gesa;

jkvis's avatar
jkvis committed
21 22 23 24 25 26 27
    //char const* const string = "accttacgacgaccttcca~";
    char const* const string = "acaaacatat~";
    size_t const length = strlen(string) + 1;

    printf("%ld\n", length);

    assert(GESA_create(&gesa, (GESA_char_t*) string, length) == 0);
28 29 30

    GESA_print(&gesa, stdout);

jkvis's avatar
jkvis committed
31
    GESA_index_t* childtab = malloc(length * sizeof(*childtab));
32 33 34 35
    assert(childtab != 0);

    GESA_calculate_childtab(&gesa, childtab);

jkvis's avatar
jkvis committed
36
    for (size_t i = 0; i < length - 1; ++i)
37 38 39 40
    {
        printf("%5ld  %5d\n", i, childtab[i]);
    } // for

jkvis's avatar
jkvis committed
41 42 43
    free(childtab);
    GESA_destroy(&gesa, GESA_KEEP_STRINGS);

44 45
    return EXIT_SUCCESS;
} // main