/***********************************************************************1* *2* This software is part of the ast package *3* Copyright (c) 2003-2011 AT&T Intellectual Property *4* and is licensed under the *5* Eclipse Public License, Version 1.0 *6* by AT&T Intellectual Property *7* *8* A copy of the License is available at *9* http://www.eclipse.org/org/documents/epl-v10.html *10* (with md5 checksum b35adb5213ca9657e911e9befb180842) *11* *12* Information and Software Systems Research *13* AT&T Research *14* Florham Park NJ *15* *16* Phong Vo <[email protected]> *17* Glenn Fowler <[email protected]> *18* *19***********************************************************************/20#include "vctest.h"2122int main()23{24char *tar, *del, *t;25Vcodex_t *vc;26ssize_t k, n;2728#if 129tar = "00000011111122222abc012000000111111222222012abc";30#else31/* for debugging, here are the various data for "panama":32** BW transform: \005npmaaaa33** base[]: 'a' 0, 'm' 3, 'n' 4, 'p' 534** offset[]: 0 0 0 0 1 0 235*/36tar = "panama";37#endif3839if(!(vc = vcopen(0, Vcbwt, 0, 0, VC_ENCODE)) )40terror("Cannot open Vcbwt handle");4142if((n = vcapply(vc, tar, strlen(tar), &del)) <= 0)43terror("Vcbwt failed");4445if(!(vc = vcopen(0, Vcbwt, 0, 0, VC_DECODE)) )46terror("Cannot open Vcbwt handle");47if((n = vcapply(vc, del, n, &t)) != strlen(tar) )48terror("Vcunbwt returns wrong size");49for(k = 0; k < n; ++k)50if(t[k] != tar[k])51terror("Vcunbwt computed bad byte");52exit(0);53}545556