pdh: Add tests for opening and closing queries.
[wine/wine-gecko.git] / dlls / pdh / tests / pdh.c
blob872f2a108141de8798421ec0964e5aaddc328e20
1 /*
2 * Tests for pdh.dll (Performance Data Helper)
4 * Copyright 2007 Hans Leidekker
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include <stdio.h>
23 #include "windows.h"
25 #include "pdh.h"
26 #include "pdhmsg.h"
28 #include "wine/test.h"
30 static void test_open_close_query( void )
32 PDH_STATUS ret;
33 PDH_HQUERY query;
35 ret = PdhOpenQueryA( NULL, 0, NULL );
36 ok(ret == PDH_INVALID_ARGUMENT, "PdhOpenQueryA failed 0x%08x\n", ret);
38 ret = PdhOpenQueryA( NULL, 0, &query );
39 ok(ret == ERROR_SUCCESS, "PdhOpenQueryA failed 0x%08x\n", ret);
41 ret = PdhCloseQuery( NULL );
42 ok(ret == PDH_INVALID_HANDLE, "PdhCloseQuery failed 0x%08x\n", ret);
44 ret = PdhCloseQuery( &query );
45 ok(ret == PDH_INVALID_HANDLE, "PdhCloseQuery failed 0x%08x\n", ret);
47 ret = PdhCloseQuery( query );
48 ok(ret == ERROR_SUCCESS, "PdhCloseQuery failed 0x%08x\n", ret);
51 START_TEST(pdh)
53 test_open_close_query();