2 * Text layout/format tests
4 * Copyright 2012 Nikolay Sivov for CodeWeavers
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
26 #include "wine/test.h"
28 static IDWriteFactory *factory;
30 static void test_CreateTextLayout(void)
32 static const WCHAR strW[] = {'s','t','r','i','n','g',0};
33 IDWriteTextLayout *layout;
36 hr = IDWriteFactory_CreateTextLayout(factory, NULL, 0, NULL, 0.0, 0.0, &layout);
37 ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
39 hr = IDWriteFactory_CreateTextLayout(factory, strW, 6, NULL, 0.0, 0.0, &layout);
40 ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
42 hr = IDWriteFactory_CreateTextLayout(factory, strW, 6, NULL, 1.0, 0.0, &layout);
43 ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
45 hr = IDWriteFactory_CreateTextLayout(factory, strW, 6, NULL, 0.0, 1.0, &layout);
46 ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
48 hr = IDWriteFactory_CreateTextLayout(factory, strW, 6, NULL, 1000.0, 1000.0, &layout);
49 ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
52 static void test_CreateGdiCompatibleTextLayout(void)
54 static const WCHAR strW[] = {'s','t','r','i','n','g',0};
55 IDWriteTextLayout *layout;
58 hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, NULL, 0, NULL, 0.0, 0.0, 0.0, NULL, FALSE, &layout);
59 ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
61 hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, strW, 6, NULL, 0.0, 0.0, 0.0, NULL, FALSE, &layout);
62 ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
64 hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, strW, 6, NULL, 1.0, 0.0, 0.0, NULL, FALSE, &layout);
65 ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
67 hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, strW, 6, NULL, 1.0, 0.0, 1.0, NULL, FALSE, &layout);
68 ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
70 hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, strW, 6, NULL, 1000.0, 1000.0, 1.0, NULL, FALSE, &layout);
71 ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
78 hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_ISOLATED, &IID_IDWriteFactory, (IUnknown**)&factory);
79 ok(hr == S_OK, "got 0x%08x\n", hr);
82 win_skip("failed to create factory\n");
86 test_CreateTextLayout();
87 test_CreateGdiCompatibleTextLayout();
89 IDWriteFactory_Release(factory);