Sweden-Number/dlls/urlmon/tests/url.c

59 lines
1.7 KiB
C

/*
* UrlMon URL tests
*
* Copyright 2004 Kevin Koltzau
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdarg.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "urlmon.h"
#include "wine/test.h"
const WCHAR TEST_URL_1[] = {'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q','.','o','r','g','/','\0'};
const WCHAR TEST_PART_URL_1[] = {'/','t','e','s','t','/','\0'};
static void test_CreateURLMoniker(LPCWSTR url1, LPCWSTR url2)
{
HRESULT hr;
IMoniker *mon1 = NULL;
IMoniker *mon2 = NULL;
hr = CreateURLMoniker(NULL, url1, &mon1);
ok(SUCCEEDED(hr), "failed to create moniker: 0x%08lx\n", hr);
if(SUCCEEDED(hr)) {
hr = CreateURLMoniker(mon1, url2, &mon2);
ok(SUCCEEDED(hr), "failed to create moniker: 0x%08lx\n", hr);
}
if(mon1) IMoniker_Release(mon1);
if(mon2) IMoniker_Release(mon2);
}
static void test_create()
{
test_CreateURLMoniker(TEST_URL_1, TEST_PART_URL_1);
}
START_TEST(url)
{
test_create();
}