/***********************************************************************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 ilist[] = {3, 4, 4, 5, 1, 1, 2, 2, 7, 6};23int isort[] = {1, 1, 2, 2, 3, 4, 4, 5, 6, 7};2425int intcmp(Void_t* one, Void_t* two, Void_t* disc)26{27int i1 = *((int*)one), i2 = *((int*)two);28return i1 - i2;29}3031int main()32{33int i;3435vcqsort(ilist, sizeof(ilist)/sizeof(int), sizeof(int), intcmp, 0);36for(i = 0; i < sizeof(ilist)/sizeof(int); ++i)37{ if(ilist[i] != isort[i])38terror("vcqsort() failed");39}4041exit(0);42}434445