mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-05 13:29:57 -05:00
add new test programme utf8-test.c
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@880 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
bf58753a99
commit
53595938d0
2 changed files with 33 additions and 1 deletions
26
src/tests/utf8-test.c
Normal file
26
src/tests/utf8-test.c
Normal file
|
|
@ -0,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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue