Added a test for stat'ing a memory based storage file.

This commit is contained in:
Mike McCormack 2004-08-11 00:17:52 +00:00 committed by Alexandre Julliard
parent 9baafec900
commit 06b8046f20
6 changed files with 94 additions and 1 deletions

3
configure vendored

File diff suppressed because one or more lines are too long

View File

@ -1604,6 +1604,7 @@ dlls/ntdll/Makefile
dlls/ntdll/tests/Makefile
dlls/odbc32/Makefile
dlls/ole32/Makefile
dlls/ole32/tests/Makefile
dlls/oleacc/Makefile
dlls/oleaut32/Makefile
dlls/oleaut32/tests/Makefile

View File

@ -55,6 +55,8 @@ RC_BINARIES = \
drag_move.cur \
nodrop.cur
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:

View File

@ -0,0 +1,3 @@
Makefile
storage32.ok
testlist.c

View File

@ -0,0 +1,14 @@
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../../..
SRCDIR = @srcdir@
VPATH = @srcdir@
TESTDLL = ole32.dll
IMPORTS = ole32 kernel32 ntdll
EXTRALIBS = -luuid
CTESTS = \
storage32.c
@MAKE_TEST_RULES@
### Dependencies:

View File

@ -0,0 +1,72 @@
/*
* Unit tests for OLE storage
*
* Copyright (c) 2004 Mike McCormack
*
* 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 <stdio.h>
#define COBJMACROS
#include "wine/test.h"
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "ole2.h"
#include "objidl.h"
#include "initguid.h"
DEFINE_GUID( test_stg_cls, 0x88888888, 0x0425, 0x0000, 0,0,0,0,0,0,0,0);
void test_hglobal_storage_stat(void)
{
ILockBytes *ilb = NULL;
IStorage *stg = NULL;
HRESULT r;
STATSTG stat;
DWORD mode, refcount;
r = CreateILockBytesOnHGlobal( NULL, TRUE, &ilb );
ok( r == S_OK, "CreateILockBytesOnHGlobal failed\n");
mode = STGM_CREATE|STGM_SHARE_EXCLUSIVE|STGM_READWRITE;/*0x1012*/
r = StgCreateDocfileOnILockBytes( ilb, mode, 0, &stg );
ok( r == S_OK, "CreateILockBytesOnHGlobal failed\n");
r = WriteClassStg( stg, &test_stg_cls );
ok( r == S_OK, "WriteClassStg failed\n");
memset( &stat, 0, sizeof stat );
r = IStorage_Stat( stg, &stat, 0 );
ok( stat.pwcsName == NULL, "storage name not null\n");
ok( stat.type == 1, "type is wrong\n");
todo_wine {
ok( stat.grfMode == 0x12, "grf mode is incorrect\n");
}
ok( !memcmp(&stat.clsid, &test_stg_cls, sizeof test_stg_cls), "CLSID is wrong");
refcount = IStorage_Release( stg );
ok( refcount == 0, "IStorage refcount is wrong\n");
refcount = ILockBytes_Release( ilb );
ok( refcount == 0, "ILockBytes refcount is wrong\n");
}
START_TEST(storage32)
{
test_hglobal_storage_stat();
}