winspool: Initialize nt_ppd in add_printer_driver.
[wine.git] / dlls / msvcr70 / tests / msvcr70.c
blob0b6f395ba32dc146af9459031f2cd9c2136fad0e
1 /*
2 * Copyright 2022 Shaun Ren for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include <stdarg.h>
20 #include <stdlib.h>
21 #include <stdio.h>
23 #include <windef.h>
24 #include <winbase.h>
25 #include <errno.h>
26 #include "wine/test.h"
28 static int (__cdecl *p_strcmp)(const char *, const char *);
29 static int (__cdecl *p_strncmp)(const char *, const char *, size_t);
31 #define SETNOFAIL(x,y) x = (void*)GetProcAddress(hcrt,y)
32 #define SET(x,y) do { SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y); } while(0)
33 static BOOL init(void)
35 HMODULE hcrt;
37 SetLastError(0xdeadbeef);
38 hcrt = LoadLibraryA("msvcr70.dll");
39 if (!hcrt) {
40 win_skip("msvcr70.dll not installed (got %ld)\n", GetLastError());
41 return FALSE;
44 SET(p_strcmp, "strcmp");
45 SET(p_strncmp, "strncmp");
47 return TRUE;
50 static void test_strcmp(void)
52 int ret = p_strcmp( "abc", "abcd" );
53 ok( ret == -1, "wrong ret %d\n", ret );
54 ret = p_strcmp( "", "abc" );
55 ok( ret == -1, "wrong ret %d\n", ret );
56 ret = p_strcmp( "abc", "ab\xa0" );
57 ok( ret == -1, "wrong ret %d\n", ret );
58 ret = p_strcmp( "ab\xb0", "ab\xa0" );
59 ok( ret == 1, "wrong ret %d\n", ret );
60 ret = p_strcmp( "ab\xc2", "ab\xc2" );
61 ok( ret == 0, "wrong ret %d\n", ret );
63 ret = p_strncmp( "abc", "abcd", 3 );
64 ok( ret == 0, "wrong ret %d\n", ret );
65 ret = p_strncmp( "", "abc", 3 );
66 ok( ret == -1, "wrong ret %d\n", ret );
67 ret = p_strncmp( "abc", "ab\xa0", 4 );
68 ok( ret == -1, "wrong ret %d\n", ret );
69 ret = p_strncmp( "ab\xb0", "ab\xa0", 3 );
70 ok( ret == 1, "wrong ret %d\n", ret );
71 ret = p_strncmp( "ab\xb0", "ab\xa0", 2 );
72 ok( ret == 0, "wrong ret %d\n", ret );
73 ret = p_strncmp( "ab\xc2", "ab\xc2", 3 );
74 ok( ret == 0, "wrong ret %d\n", ret );
75 ret = p_strncmp( "abc", "abd", 0 );
76 ok( ret == 0, "wrong ret %d\n", ret );
77 ret = p_strncmp( "abc", "abc", 12 );
78 ok( ret == 0, "wrong ret %d\n", ret );
81 START_TEST(msvcr70)
83 if(!init())
84 return;
86 test_strcmp();