Add run-time variables for libcdio version number/string.

This commit is contained in:
R. Bernstein
2009-12-25 09:14:26 -05:00
parent a3ed634fe5
commit db8ee6e65a
6 changed files with 75 additions and 11 deletions

1
test/.gitignore vendored
View File

@@ -17,6 +17,7 @@
/check_nrg.sh
/check_paranoia.sh
/check_sizeof
/test_lib_driver_util
/testassert
/testbincue
/testbincue.c

View File

@@ -27,7 +27,7 @@ testparanoia_LDADD = $(LIBCDIO_PARANOIA_LIBS) $(LIBCDIO_CDDA_LIBS) $(LIBCDIO_LIB
endif
hack = check_sizeof testassert testbincue testgetdevices testischar \
testisocd testisocd2 testiso9660 testlinux \
testisocd testisocd2 testiso9660 testlinux test_lib_driver_util \
testnrg $(testparanoia) testtoc testpregap testsolaris
EXTRA_PROGRAMS = testdefault
@@ -47,6 +47,9 @@ testisocd2_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LTLIBICONV)
testtoc_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV)
testtoc_CFLAGS = -DTEST_DIR=\"$(srcdir)\"
test_lib_driver_util_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV)
tets_lib_driver_util_CFLAGS = -DTEST_DIR=\"$(srcdir)\"
testlinux_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV)
testlinux_CFLAGS = -DTEST_DIR=\"$(srcdir)\"

View File

@@ -0,0 +1,48 @@
/* -*- C -*-
Copyright (C) 2009 Rocky Bernstein <rocky@gnu.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* Unit test for lib/driver/util.c */
#include <cdio/version.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <string.h>
int
main(int argc, const char *argv[])
{
if (0 != strncmp(cdio_version_string, CDIO_VERSION,
strlen(CDIO_VERSION))) {
fprintf(stderr, "CDIO VERSION string mismatch %s vs %s\n",
cdio_version_string, CDIO_VERSION);
exit(1);
}
if (libcdio_version_num != LIBCDIO_VERSION_NUM) {
fprintf(stderr, "LIBCDIO_VERSION_NUM value mismatch %d vs %d\n",
libcdio_version_num, LIBCDIO_VERSION_NUM);
exit(2);
}
exit(0);
}