13#define verify_str (winetest_set_location(__FILE__, __LINE__), 0) ? (void)0 : verify_str_imp
14#define verify_str2 (winetest_set_location(__FILE__, __LINE__), 0) ? (void)0 : verify_str_imp2
29 size_t Length = comstr.Length();
31 Length = comstr.ByteLength();
32 ExpectedLength *=
sizeof(
WCHAR);
49 CComBSTR empty1, empty2;
50 CComBSTR happyW(
L"I am a happy BSTR");
51 CComBSTR happyA(
"I am a happy BSTR");
52 CComBSTR happyW4(4,
L"I am a happy BSTR");
53 CComBSTR fromlen1(1), fromlen10(10);
54 CComBSTR fromBSTRW(happyW), fromBSTRA(happyA), fromBSTRW4(happyW4);
55 CComBSTR fromBSTRlen1(fromlen1), fromBSTRlen10(fromlen10);
73 CComBSTR happy(
L"I am a happy BSTR"),
empty,
odd;
74 CComBSTR happyCopy1, happyCopy2, emptyCopy, oddCopy;
78 happyCopy1 = happy.Copy();
80 emptyCopy =
empty.Copy();
90 ok((
BSTR)happy != (
BSTR)happyCopy1,
"Expected pointers to be different\n");
91 ok((
BSTR)happy != (
BSTR)happyCopy2,
"Expected pointers to be different\n");
94 happyCopy1 = (LPCOLESTR)
NULL;
101 ok(
hr ==
S_OK,
"Expected hr to be E_POINTER, was: %08lx\n",
hr);
106 ok(
hr ==
E_POINTER,
"Expected hr to be E_POINTER, was: %u\n");
110 happy.Attach(RawPtr);
111 ok_ptr(happy.m_str, RawPtr);
113 happyCopy1.Attach(happy.Detach());
114 ok_ptr(happyCopy1.m_str, RawPtr);
121 GUID guid = { 0x12345678, 0x9abc, 0xdef0, { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0} };
123 verify_str(fromGuid,
L"{12345678-9ABC-DEF0-1234-56789ABCDEF0}");
static void verify_str_imp(const CComBSTR &comstr, PCWSTR expected)
static void verify_str_imp2(const CComBSTR &comstr, PCWSTR expected, size_t ExpectedLength)
void test_copyassignment()
std::map< E_MODULE, HMODULE > mod
#define ok_ptr(expression, result)
static const WCHAR empty[]
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
_In_ ULONG _In_ ULONG _In_ ULONG Length
BSTR WINAPI SysAllocString(LPCOLESTR str)
BSTR WINAPI DECLSPEC_HOTPATCH SysAllocStringByteLen(LPCSTR str, UINT len)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
void __winetest_cdecl winetest_ok(int condition, const char *msg,...)