3 * Test rig for versioncmp
5 * (c) 2008 Straylight/Edgeware
8 /*----- Licensing notice --------------------------------------------------*
10 * This file is part of the mLib utilities library.
12 * mLib is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU Library General Public License as
14 * published by the Free Software Foundation; either version 2 of the
15 * License, or (at your option) any later version.
17 * mLib is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU Library General Public License for more details.
22 * You should have received a copy of the GNU Library General Public
23 * License along with mLib; if not, write to the Free
24 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
29 #include "versioncmp.h"
31 static int t_vcmp(dstr
*v
)
34 int rc
= versioncmp(v
[0].buf
, v
[1].buf
);
35 if (rc
!= *(int *)v
[2].buf
) {
36 fprintf(stderr
, "\nversioncmp(%s, %s) returns %d != %d\n",
37 v
[0].buf
, v
[1].buf
, rc
, *(int *)v
[2].buf
);
43 static const test_chunk tests
[] = {
44 { "versioncmp", t_vcmp
, { &type_string
, &type_string
, &type_int
} },
48 int main(int argc
, char *argv
[])
49 { test_run(argc
, argv
, tests
, SRCDIR
"/versioncmp.in"); return (1); }
51 /*----- That's all, folks -------------------------------------------------*/