/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 2003-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Phong Vo <kpv@research.att.com> *
* Glenn Fowler <gsf@research.att.com> *
* *
***********************************************************************/
#include "vctest.h"
/* This test various forms of integer codings
**
** Written by Kiem-Phong Vo
*/
int main()
{
/* test gamma coding */
terror("vcioputg 1\n");
terror("vcioputg 11\n");
terror("vcioputg 101\n");
terror("vcioputg 1\n");
terror("vcioputg 1001\n");
terror("vcioputg 10001\n");
terror("vcioputg 1\n");
terror("vcioputg 100001\n");
terror("vciogetg 1 != %d\n", (int)v);
terror("vciogetg 11 != %d\n", (int)v);
terror("vciogetg 101 != %d\n", (int)v);
terror("vciogetg 1 != %d\n", (int)v);
terror("vciogetg 1001 != %d\n", (int)v);
terror("vciogetg 10001 != %d\n", (int)v);
terror("vciogetg 1 != %d\n", (int)v);
terror("vciogetg 100001 != %d\n", (int)v);
/* Generate a list of positive integers.
** Positivity is needed to test the gamma code which does not handle zero.
*/
for(v = 5; v < N_LIST; )
{ int k, inc;
{ if(inc)
if(list[v] <= 0)
}
}
/* check coding size of original list using base-128 coding */
for(v = 0; v < N_LIST; ++v)
for(v = 0; v < N_LIST; ++v)
terror("Bad vciogetu %d", g);
/* check coding size of original list using gamma coding */
for(v = 0; v < N_LIST; ++v)
for(v = 0; v < N_LIST; ++v)
terror("Bad vciogetg %d", g);
/* test integer list io */
terror("vcioputlist %d\n", (int)v);
for(v = 0; v < N_LIST; ++v)
list[v] = -1;
terror("vciogetlist %d\n", (int)v);
for(v = 0; v < N_LIST; ++v)
exit(0);
}