[polypaudio-commits] r880 - in /trunk/src: Makefile.am tests/utf8-test.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Mon May 15 17:46:03 PDT 2006


Author: lennart
Date: Tue May 16 02:46:03 2006
New Revision: 880

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=880&root=polypaudio&view=rev
Log:
add new test programme utf8-test.c

Added:
    trunk/src/tests/utf8-test.c   (with props)
Modified:
    trunk/src/Makefile.am

Modified: trunk/src/Makefile.am
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/Makefile.am?rev=880&root=polypaudio&r1=879&r2=880&view=diff
==============================================================================
--- trunk/src/Makefile.am (original)
+++ trunk/src/Makefile.am Tue May 16 02:46:03 2006
@@ -189,7 +189,8 @@
 		memblockq-test \
 		sync-playback \
 		channelmap-test \
-		thread-mainloop-test
+		thread-mainloop-test \
+		utf8-test
 
 if HAVE_SIGXCPU
 noinst_PROGRAMS += \
@@ -216,6 +217,11 @@
 thread_mainloop_test_CFLAGS = $(AM_CFLAGS)
 thread_mainloop_test_LDADD = $(AM_LDADD) libpolyp- at PA_MAJORMINOR@.la
 thread_mainloop_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
+
+utf8_test_SOURCES = tests/utf8-test.c
+utf8_test_CFLAGS = $(AM_CFLAGS)
+utf8_test_LDADD = $(AM_LDADD) libpolypcore.la
+utf8_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
 
 mcalign_test_SOURCES = tests/mcalign-test.c
 mcalign_test_CFLAGS = $(AM_CFLAGS)

Added: trunk/src/tests/utf8-test.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/tests/utf8-test.c?rev=880&root=polypaudio&view=auto
==============================================================================
--- trunk/src/tests/utf8-test.c (added)
+++ trunk/src/tests/utf8-test.c Tue May 16 02:46:03 2006
@@ -1,0 +1,26 @@
+/* $Id$ */
+
+#include <stdio.h>
+#include <assert.h>
+
+#include <polypcore/utf8.h>
+#include <polypcore/xmalloc.h>
+
+int main(int argc, char *argv[]) {
+    char *c;
+    
+    assert(pa_utf8_valid("hallo"));
+    assert(pa_utf8_valid("hallo\n"));
+    assert(!pa_utf8_valid("hüpfburg\n"));
+    assert(pa_utf8_valid("hallo\n"));
+    assert(pa_utf8_valid("hüpfburg\n"));
+    
+    printf("LATIN1: %s\n", c = pa_utf8_filter("hüpfburg"));
+    pa_xfree(c);
+    printf("UTF8: %sx\n", c = pa_utf8_filter("hüpfburg"));
+    pa_xfree(c);
+    printf("LATIN1: %sx\n", c = pa_utf8_filter("üxknärzmörzeltörszß³§dsjkfh"));
+    pa_xfree(c);
+
+    return 0;
+}

Propchange: trunk/src/tests/utf8-test.c
------------------------------------------------------------------------------
    svn:keywords = Id




More information about the pulseaudio-commits mailing list