Changeset 21723 in vbox
- Timestamp:
- Jul 20, 2009 12:39:00 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstUtf8.cpp
r21714 r21723 823 823 } 824 824 uint64_t u64Elapsed = RTTimeNanoTS() - u64Start; 825 RTTestPrintf(hTest, RTTESTLVL_ALWAYS, "%d in % RI64ns\n", i, u64Elapsed);825 RTTestPrintf(hTest, RTTESTLVL_ALWAYS, "%d in %'RI64 ns\n", i, u64Elapsed); 826 826 } 827 827 … … 843 843 } 844 844 uint64_t u64Elapsed = RTTimeNanoTS() - u64Start; 845 RTTestPrintf(hTest, RTTESTLVL_ALWAYS, "%d in % RI64ns\n", i, u64Elapsed);845 RTTestPrintf(hTest, RTTESTLVL_ALWAYS, "%d in %'RI64 ns\n", i, u64Elapsed); 846 846 } 847 847 … … 1009 1009 } 1010 1010 1011 1011 1012 void testLatin1(RTTEST hTest) 1012 1013 { 1013 1014 RTTestSub(hTest, "Latin1 conversion functions"); 1014 1015 1015 1016 /* Test Utf16 -> Latin1 */ 1016 1017 size_t cch_szAll = 0; … … 1162 1163 } 1163 1164 1165 1166 static void testNoTransation(RTTEST hTest) 1167 { 1168 1169 /* 1170 * Try trigger a VERR_NO_TRANSLATION error in convert to 1171 * current CP to latin-1. 1172 */ 1173 const RTUTF16 s_swzTest1[] = { 0x2358, 0x2242, 0x2357, 0x2359, 0x22f9, 0x2c4e, 0x0030, 0x0060, 1174 0x0092, 0x00c1, 0x00f2, 0x1f80, 0x0088, 0x2c38, 0x2c30, 0x0000 }; 1175 char *pszTest1; 1176 int rc = RTUtf16ToUtf8(s_swzTest1, &pszTest1); 1177 RTTESTI_CHECK_RC_RETV(rc, VINF_SUCCESS); 1178 1179 RTTestSub(hTest, "VERR_NO_TRANSLATION/RTStrUtf8ToCurrentCP"); 1180 char *pszOut; 1181 rc = RTStrUtf8ToCurrentCP(&pszOut, pszTest1); 1182 if (RT_SUCCESS(rc)) 1183 { 1184 RTTESTI_CHECK(!strcmp(pszOut, pszTest1)); 1185 RTTestIPrintf(RTTESTLVL_ALWAYS, "CurrentCP is UTF-8 or similar\n"); 1186 RTStrFree(pszOut); 1187 } 1188 else 1189 RTTESTI_CHECK_RC(rc, VERR_NO_TRANSLATION); 1190 1191 RTTestSub(hTest, "VERR_NO_TRANSLATION/RTUtf16ToLatin1"); 1192 rc = RTUtf16ToLatin1(s_swzTest1, &pszOut); 1193 RTTESTI_CHECK_RC(rc, VERR_NO_TRANSLATION); 1194 if (RT_SUCCESS(rc)) 1195 RTStrFree(pszOut); 1196 1197 RTStrFree(pszTest1); 1198 RTTestSubDone(hTest); 1199 } 1200 1201 1164 1202 int main() 1165 1203 { … … 1187 1225 testLatin1(hTest); 1188 1226 1227 testNoTransation(hTest); 1228 1189 1229 Benchmarks(hTest); 1190 1230
Note:
See TracChangeset
for help on using the changeset viewer.