import config, image
import wavelets/zou
import tests/testimage

int def test_key(char const *filename, char const *what):

    Image *v = get_test_image(filename)

    char *key = None
    for int i = 0; i < (int)strlen(what); i++:
        if not strncmp(what + i, "key", 3):
            int j
            for j = 0; ; j++:
                char c = what[i + 3 + j]
                if not c: break
                if c == ' ': break
            char k[j + 1]
            strncpy(k, what + i + 3, j)
            k[j]= '\0'
            key = strdup(k)

    print("Using key \"%s\"\n", key)
    V *s = None
    if v: s = v->data.v
    int N = 10
    int w = 512
    V **dwts[10]
    zou_ten_twice(s, N, w, dwts, key)

    return 0
