File: test_thstr.c

package info (click to toggle)
libthai 0.1.14-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,600 kB
  • ctags: 798
  • sloc: sh: 10,137; ansic: 4,205; makefile: 313
file content (24 lines) | stat: -rw-r--r-- 541 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
 * test_thstr.c : Test suite for <thai/thstr.h> functions
 * Created: 2001-08-03
 * Author:  Theppitak Karoonboonyanan
 */

#include <thai/thstr.h>
#include <string.h>

int test_th_normalize()
{
    const thchar_t* test_str = (const thchar_t *)"س٫٫";
    const thchar_t* ans_str = (const thchar_t *)"س";
    thchar_t resBuff[50];

    th_normalize(resBuff, test_str, sizeof resBuff);
    return (strcmp((const char *)resBuff, (const char *)ans_str) == 0) ? 0 : 1;
}

int main()
{
    return test_th_normalize();
}