0047-wcscoll.c - scc - simple c99 compiler
 (HTM) git clone git://git.simple-cc.org/scc
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) Submodules
 (DIR) README
 (DIR) LICENSE
       ---
       0047-wcscoll.c (620B)
       ---
            1 #include <assert.h>
            2 #include <stdio.h>
            3 #include <wchar.h>
            4 
            5 /*
            6 output:
            7 testing
            8 done
            9 end:
           10 */
           11 
           12 int
           13 main(void)
           14 {
           15         wchar_t t1[] = {0};
           16         wchar_t t2[] = {0};
           17         wchar_t t3[] = {0x31, 0};
           18         wchar_t t4[] = {0x31, 0};
           19         wchar_t t5[] = {0x31, 0x32, 0};
           20         wchar_t t6[] = {0, 0x31, 0};
           21 
           22         puts("testing");
           23         assert(wcscoll(t1, t1) == 0);
           24         assert(wcscoll(t1, t2) == 0);
           25         assert(wcscoll(t1, t3) < 0);
           26         assert(wcscoll(t3, t1) > 0);
           27         assert(wcscoll(t3, t3) == 0);
           28         assert(wcscoll(t3, t4) == 0);
           29         assert(wcscoll(t3, t5) < 0);
           30         assert(wcscoll(t5, t3) > 0);
           31         assert(wcscoll(t3, t6) > 0);
           32         assert(wcscoll(t6, t3) < 0);
           33         puts("done");
           34 
           35         return 0;
           36 }