2 * Unit test suite for windows error reporting in Vista and above
4 * Copyright 2010 Detlef Riekenberg
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
31 #include "wine/test.h"
33 static const WCHAR empty[] = {0};
34 static const WCHAR winetest_wer[] = {'w','i','n','e','t','e','s','t','_','w','e','r','.','e','x','e',0};
38 static void test_WerAddExcludedApplication(void)
43 hr = WerRemoveExcludedApplication(winetest_wer, FALSE);
44 if (hr == E_NOTIMPL) {
45 skip("Wer*ExcludedApplication not implemented\n");
48 ok((hr == S_OK) || (hr == E_FAIL) || __HRESULT_FROM_WIN32(ERROR_ENVVAR_NOT_FOUND),
49 "got 0x%x (expected S_OK, E_FAIL or HRESULT_FROM_WIN32(ERROR_ENVVAR_NOT_FOUND))\n", hr);
51 hr = WerAddExcludedApplication(NULL, FALSE);
52 ok(hr == E_INVALIDARG, "got 0x%x (expected E_INVALIDARG)\n", hr);
54 hr = WerAddExcludedApplication(empty, FALSE);
55 ok(hr == E_INVALIDARG, "got 0x%x (expected E_INVALIDARG)\n", hr);
57 hr = WerAddExcludedApplication(winetest_wer, FALSE);
58 ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
59 /* app already in the list */
60 hr = WerAddExcludedApplication(winetest_wer, FALSE);
61 ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
65 hr = WerRemoveExcludedApplication(winetest_wer, FALSE);
66 ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
71 static void test_WerRemoveExcludedApplication(void)
76 hr = WerRemoveExcludedApplication(winetest_wer, FALSE);
77 if (hr == E_NOTIMPL) {
78 skip("Wer*ExcludedApplication not implemented\n");
82 ok((hr == S_OK) || (hr == E_FAIL) || __HRESULT_FROM_WIN32(ERROR_ENVVAR_NOT_FOUND),
83 "got 0x%x (expected S_OK, E_FAIL or HRESULT_FROM_WIN32(ERROR_ENVVAR_NOT_FOUND))\n", hr);
85 hr = WerAddExcludedApplication(winetest_wer, FALSE);
86 ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
88 hr = WerRemoveExcludedApplication(NULL, FALSE);
89 ok(hr == E_INVALIDARG, "got 0x%x (expected E_INVALIDARG)\n", hr);
91 hr = WerRemoveExcludedApplication(empty, FALSE);
92 ok(hr == E_INVALIDARG, "got 0x%x (expected E_INVALIDARG)\n", hr);
94 hr = WerRemoveExcludedApplication(winetest_wer, FALSE);
95 ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
97 /* app not in the list */
98 hr = WerRemoveExcludedApplication(winetest_wer, FALSE);
99 ok((hr == E_FAIL) || __HRESULT_FROM_WIN32(ERROR_ENVVAR_NOT_FOUND),
100 "got 0x%x (expected E_FAIL or HRESULT_FROM_WIN32(ERROR_ENVVAR_NOT_FOUND))\n", hr);
104 /* ########################### */
108 test_WerAddExcludedApplication();
109 test_WerRemoveExcludedApplication();