From bb18f12b05d10c00e633edef120f2c7f2cf260a9 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Mariusz=20Pluci=C5=84ski?= Date: Mon, 7 Jun 2010 23:12:23 +0200 Subject: gameux/tests: Add creation test for IGameStatistics --- dlls/gameux/tests/Makefile.in | 1 + dlls/gameux/tests/gamestatistics.c | 52 ++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 0 deletions(-) create mode 100644 dlls/gameux/tests/gamestatistics.c diff --git a/dlls/gameux/tests/Makefile.in b/dlls/gameux/tests/Makefile.in index b7d71f4..2329f0b 100644 --- a/dlls/gameux/tests/Makefile.in +++ b/dlls/gameux/tests/Makefile.in @@ -7,6 +7,7 @@ IMPORTS = oleaut32 ole32 user32 kernel32 C_SRCS = \ gameexplorer.c \ + gamestatistics.c \ gamestatisticsmgr.c diff --git a/dlls/gameux/tests/gamestatistics.c b/dlls/gameux/tests/gamestatistics.c new file mode 100644 index 0000000..69e3985 --- /dev/null +++ b/dlls/gameux/tests/gamestatistics.c @@ -0,0 +1,52 @@ +/* + * IGameStatistics tests + * + * Copyright (C) 2010 Mariusz PluciƄski + * + * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + + +#include "gameux.h" +#include "wine/test.h" + +static void test_create( void ) +{ + HRESULT r; + + IGameStatistics* gs = NULL; + + r = CoCreateInstance( &CLSID_GameStatistics, NULL, CLSCTX_INPROC_SERVER, &IID_IGameStatistics, (LPVOID*)&gs); + + /* IGameStatistics should not be created when trying to access this way */ + ok( r != S_OK, "IGameStatistics creating succeded (result true)\n"); + ok( gs == NULL, "IGameStatistics creating succeded (not NULL interface pointer)\n"); + + /* valid way of creating IGameStatistics is using GetGameStatistics method + * from IGameStatisticsMgr - this will be implemented in future + */ +} + +START_TEST(gamestatistics) +{ + HRESULT r; + + r = CoInitialize( NULL ); + ok( r == S_OK, "failed to init COM\n"); + + test_create(); + + CoUninitialize(); +} -- 1.6.2.5