From 9229c19d01cb4011d58b5f4deb791951e668e4a7 Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Wed, 10 Sep 2008 12:38:41 +0100 Subject: [PATCH] inetcomm/tests: Tests for IMimeInternational_FindCharset. --- dlls/inetcomm/tests/mimeintl.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/dlls/inetcomm/tests/mimeintl.c b/dlls/inetcomm/tests/mimeintl.c index defe3f953d1..0075cb5b77a 100644 --- a/dlls/inetcomm/tests/mimeintl.c +++ b/dlls/inetcomm/tests/mimeintl.c @@ -52,9 +52,35 @@ static void test_create(void) IMimeInternational_Release(internat); } +static void test_charset(void) +{ + IMimeInternational *internat; + HRESULT hr; + HCHARSET hcs, hcs_windows_1252, hcs_windows_1251; + + hr = MimeOleGetInternat(&internat); + ok(hr == S_OK, "ret %08x\n", hr); + + hr = IMimeInternational_FindCharset(internat, "non-existent", &hcs); + ok(hr == MIME_E_NOT_FOUND, "got %08x\n", hr); + + hr = IMimeInternational_FindCharset(internat, "windows-1252", &hcs_windows_1252); + ok(hr == S_OK, "got %08x\n", hr); + hr = IMimeInternational_FindCharset(internat, "windows-1252", &hcs); + ok(hr == S_OK, "got %08x\n", hr); + ok(hcs_windows_1252 == hcs, "got different hcharsets for the same name\n"); + + hr = IMimeInternational_FindCharset(internat, "windows-1251", &hcs_windows_1251); + ok(hr == S_OK, "got %08x\n", hr); + ok(hcs_windows_1252 != hcs_windows_1251, "got the same hcharset for the different names\n"); + + IMimeInternational_Release(internat); +} + START_TEST(mimeintl) { OleInitialize(NULL); test_create(); + test_charset(); OleUninitialize(); }