2 * Unit test suite for MAPI utility functions
4 * Copyright 2004 Jon Griffiths
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #define NONAMELESSUNION
22 #define NONAMELESSSTRUCT
23 #include "wine/test.h"
32 static HMODULE hMapi32 = 0;
34 static SCODE (WINAPI *pScInitMapiUtil)(ULONG);
35 static void (WINAPI *pSwapPword)(PUSHORT,ULONG);
36 static void (WINAPI *pSwapPlong)(PULONG,ULONG);
38 static void test_SwapPword(void)
42 pSwapPword = (void*)GetProcAddress(hMapi32, "SwapPword@8");
49 pSwapPword(shorts, 2);
50 ok(shorts[0] == 0x01ff && shorts[1] == 0xff10 && shorts[2] == 0x2001,
51 "Expected {0x01ff,0xff10,0x2001}, got {0x%04x,0x%04x,0x%04x}\n",
52 shorts[0], shorts[1], shorts[2]);
55 static void test_SwapPlong(void)
59 pSwapPlong = (void*)GetProcAddress(hMapi32, "SwapPlong@8");
63 longs[0] = 0xffff0001;
64 longs[1] = 0x1000ffff;
65 longs[2] = 0x20000001;
67 ok(longs[0] == 0x0100ffff && longs[1] == 0xffff0010 && longs[2] == 0x20000001,
68 "Expected {0x0100ffff,0xffff0010,0x20000001}, got {0x%08lx,0x%08lx,0x%08lx}\n",
69 longs[0], longs[1], longs[2]);
74 hMapi32 = LoadLibraryA("mapi32.dll");
76 pScInitMapiUtil = (void*)GetProcAddress(hMapi32, "ScInitMapiUtil@4");