1 /* 2 * TEST SUITE FOR MB/WC FUNCTIONS IN CLIBRARY 3 * 4 * FILE: dat_swscanf.c 5 * 6 * SWSCANF: int swscanf (const wchar_t *s, const wchar_t *fmt, ...); 7 */ 8 9 10 #include <errno.h> 11 #include <stdlib.h> 12 #include "tst_types.h" 13 #include "tgn_locdef.h" 14 15 16 TST_SWSCANF tst_swscanf_loc [] = 17 { 18 { 19 { Tswscanf, TST_LOC_de }, 20 { 21 /*------------------------ 01 -----------------------*/ 22 { { { 23 0x002D, 0x0031, 0x003A, /* %d: -1 */ 24 0x0032, 0x003A, /* %u: 2 */ 25 0x0033, 0x002C, 0x0033, 0x003A, /* %f: 3.3 */ 26 0x00E4, 0x003A, /* %c: '�' */ 27 0x00C4, 0x00DC, 0x0000, 0x0000, /* %s: "��" */ 28 }, 29 L"%d:%u:%f:%c:%s", 0 30 }, 31 { /* The fields are: err_val, ret_flag, ret_val, 32 val_int, val_uns, val_flt, val_c, val_s, val_S. */ 33 0,1,5, 34 -1, 2, 3.3, '�', "��", { 0x0000, }, 35 }, 36 }, 37 /*------------------------ 02 -----------------------*/ 38 { { { 39 0x00E4, 0x00C4, 0x0000 /* "��" */ 40 }, 41 L"%lc", 'C' 42 }, 43 { 0,1,1, 44 0,0,0,0,"", { 0x00E4, 0x0000 }, 45 }, 46 }, 47 /*------------------------ 03 -----------------------*/ 48 { { { 49 0x00E4, 0x00C4, 0x0000 /* "��" */ 50 }, 51 L"%ls", 'S' 52 }, 53 { 0,1,1, 54 0,0,0,0,"", { 0x00E4, 0x00C4, 0x0000 }, 55 }, 56 }, 57 /*------------------------ 04 -----------------------*/ 58 /* <NO_WAIVER> x 2 */ 59 { { { 60 0x00E4, 0x00C4, 0x0000 /* "��" */ 61 }, 62 L"1%d:2%d:3%d:4%d:5%d:6%d:7%d:8%d:9%d", 0 63 }, 64 { 0,1,0, 65 0,0,0,0,"", { 0x0000 }, 66 }, 67 }, 68 /*---------------------------------------------------*/ 69 { .is_last = 1} /* Last element. */ 70 } 71 }, 72 { 73 { Tswscanf, TST_LOC_enUS }, 74 { 75 /*------------------------ 01 -----------------------*/ 76 { { { 0x002D, 0x0031, 0x003A, 77 0x0032, 0x003A, 78 0x0035, 0x0034, 0x002E, 0x0033, 0x0045, 0x002D, 0x0031, 0x003A, 79 0x0041, 0x003A, 80 0x0061, 0x0062, 0x0000, 0x0000, 81 }, 82 L"%d:%u:%f:%c:%s", 0 83 }, 84 { 0,1,5, 85 -1, 2, 5.43, 'A', "ab", { 0x0000 }, 86 }, 87 }, 88 /*------------------------ 02 -----------------------*/ 89 /* <NO_WAIVER> x 2 */ 90 { { { 91 0x0063, 0x0064, 0x0000 92 }, 93 L"%C", 'C' 94 }, 95 { 0,1,1, 96 0,0,0,0,"", { 0x0063, 0x0000 }, 97 }, 98 }, 99 /*------------------------ 03 -----------------------*/ 100 { { { 101 0x0063, 0x0064, 0x0000 102 }, 103 L"%S", 'S' 104 }, 105 { 0,1,1, 106 0,0,0,0,"", { 0x0063, 0x0064, 0x0000 }, 107 }, 108 }, 109 /*---------------------------------------------------*/ 110 { .is_last = 1} /* Last element. */ 111 } 112 }, 113 { 114 { Tswscanf, TST_LOC_eucJP }, 115 { 116 /*------------------------ 01 -----------------------*/ 117 { { { 0x002D, 0x0031, 0x003A, 118 0x0032, 0x003A, 119 0x0033, 0x002E, 0x0033, 0x003A, 120 0x0062, 0x003A, 121 0x0061, 0x0062, 0x0000, 0x0000, 122 }, 123 L"%d:%u:%f:%c:%s", 0 124 }, 125 { 0,1,5, 126 -1, 2, 3.3, 'b', "ab", { 0x0000 } 127 }, 128 }, 129 /*------------------------ 02 -----------------------*/ 130 { { { 131 0x30A2, 0x30A4, 0x0000 132 }, 133 L"%ls", 'S' 134 }, 135 { 0,1,1, 136 0,0,0,0,"", { 0x30A2, 0x30A4, 0x0000 } 137 }, 138 }, 139 /*------------------------ 03 -----------------------*/ 140 { { { 141 0x0031, 0x003A, 142 0x0030, 0x003A, 143 0x0033, 0x002E, 0x0039, 0x003A, 144 0x0061, 0x003A, 145 0x0063, 0x0064, 0x0000, 0x0000, 146 }, 147 L"%2$d:%1$u:%3$f:%4$c:%5$s", 0 148 }, 149 { 0,1,5, 150 0, 1, 3.9, 'a', "cd", { 0x0000 } 151 }, 152 }, 153 /*---------------------------------------------------*/ 154 { .is_last = 1} /* Last element. */ 155 } 156 }, 157 { 158 { Tswscanf, TST_LOC_end } 159 } 160 }; 161