mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2025-02-17 01:20:02 +00:00
tests/sfversion.c : Test function sf_version_string.
This commit is contained in:
parent
ee663d829f
commit
cf4859c221
@ -87,3 +87,7 @@ tests/utils.c
|
||||
tests/utils.h
|
||||
tests/write_read_test.c
|
||||
tests/test_wrapper.sh
|
||||
doc/AUTHORS
|
||||
doc/ChangeLog
|
||||
doc/NEWS
|
||||
doc/README
|
||||
|
@ -10,6 +10,9 @@
|
||||
* src/sndfile.c src/sndfile.h.in src/create_symbols_file.py
|
||||
Add public function sf_version_string.
|
||||
|
||||
* tests/sfversion.c
|
||||
Test function sf_version_string.
|
||||
|
||||
2009-03-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
||||
|
||||
* src/common.h src/caf.c src/sndfile.c
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "sfconfig.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
@ -29,11 +30,19 @@
|
||||
|
||||
#define BUFFER_SIZE (256)
|
||||
|
||||
static char strbuffer [BUFFER_SIZE] ;
|
||||
|
||||
int
|
||||
main (void)
|
||||
{ sf_command (NULL, SFC_GET_LIB_VERSION, strbuffer, sizeof (strbuffer)) ;
|
||||
{ static char strbuffer [BUFFER_SIZE] ;
|
||||
const char * ver ;
|
||||
|
||||
sf_command (NULL, SFC_GET_LIB_VERSION, strbuffer, sizeof (strbuffer)) ;
|
||||
ver = sf_version_string () ;
|
||||
|
||||
if (strcmp (ver, strbuffer) != 0)
|
||||
{ printf ("Version mismatch : '%s' != '%s'\n\n", ver, strbuffer) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
printf ("%s", strbuffer) ;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user