ReactOS  0.4.14-dev-614-gbfd8a84
CComObject.cpp File Reference
#include <atlbase.h>
#include <atlcom.h>
#include "atltest.h"
Include dependency graph for CComObject.cpp:

Go to the source code of this file.

Classes

class  CTestObject
 
class  CDumExe
 

Functions

 START_TEST (CComObject)
 

Variables

static LONG g_CTOR = 0
 
static LONG g_DTOR = 0
 
static LONG g_BLIND = 0
 
CDumExe dum
 

Function Documentation

◆ START_TEST()

START_TEST ( CComObject  )

Definition at line 74 of file CComObject.cpp.

75 {
76  g_CTOR = g_DTOR = g_BLIND = 0;
77 
78  CComObject<CTestObject>* pTest;
79  HRESULT hr = CComObject<CTestObject>::CreateInstance(&pTest);
80 
81  ok(hr == S_OK, "Expected S_OK, got 0x%lx\n", hr);
82 
83  ok(g_CTOR == 1, "Expected 1, got %lu\n", g_CTOR);
84  ok(g_DTOR == 0, "Expected 0, got %lu\n", g_DTOR);
85  ok(g_BLIND == 0, "Expected 0, got %lu\n", g_BLIND);
86 
87  if (hr == S_OK)
88  {
89  ULONG ref = pTest->AddRef();
90  ok(ref == 1, "Expected 1, got %lu\n", ref);
91 
92  {
93  CComPtr<IUnknown> ppv;
94  hr = pTest->QueryInterface(IID_IUnknown, (void **) &ppv);
95  ok(hr == S_OK, "Expected S_OK, got 0x%lx\n", hr);
96  ok(g_CTOR == 1, "Expected 1, got %lu\n", g_CTOR);
97  ok(g_DTOR == 0, "Expected 0, got %lu\n", g_DTOR);
98  ok(g_BLIND == 0, "Expected 0, got %lu\n", g_BLIND);
99 
100  CComPtr<IPersist> ppersist;
101  hr = pTest->QueryInterface(IID_IPersist, (void **)&ppersist);
102  ok(hr == S_OK, "Expected S_OK, got 0x%lx\n", hr);
103  ok(g_CTOR == 1, "Expected 1, got %lu\n", g_CTOR);
104  ok(g_DTOR == 0, "Expected 0, got %lu\n", g_DTOR);
105  ok(g_BLIND == 0, "Expected 0, got %lu\n", g_BLIND);
106 
107  }
108 
109  {
110  CComPtr<IStdMarshalInfo> pstd;
111  hr = pTest->QueryInterface(IID_IStdMarshalInfo, (void **)&pstd);
112  ok(hr == S_OK, "Expected S_OK, got 0x%lx\n", hr);
113  ok(g_CTOR == 1, "Expected 1, got %lu\n", g_CTOR);
114  ok(g_DTOR == 0, "Expected 0, got %lu\n", g_DTOR);
115  ok(g_BLIND == 1, "Expected 1, got %lu\n", g_BLIND);
116  }
117 
118  ref = pTest->Release();
119  ok(ref == 0, "Expected 0, got %lu\n", ref);
120  ok(g_CTOR == 1, "Expected 1, got %lu\n", g_CTOR);
121  ok(g_DTOR == 1, "Expected 1, got %lu\n", g_DTOR);
122  ok(g_BLIND == 1, "Expected 1, got %lu\n", g_BLIND);
123  }
124 }
HRESULT hr
Definition: shlfolder.c:183
const GUID IID_IPersist
Definition: proxy.cpp:14
REFIID LPVOID * ppv
Definition: atlbase.h:39
static LONG g_DTOR
Definition: CComObject.cpp:20
Definition: send.c:47
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
static LONG g_CTOR
Definition: CComObject.cpp:19
static LONG g_BLIND
Definition: CComObject.cpp:21
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
unsigned int ULONG
Definition: retypes.h:1

Variable Documentation

◆ dum

CDumExe dum

Definition at line 71 of file CComObject.cpp.

Referenced by RECTL_Intersect(), SdbBeginWriteListTag(), and START_TEST().

◆ g_BLIND

LONG g_BLIND = 0
static

Definition at line 21 of file CComObject.cpp.

Referenced by CTestObject::FuncBlind(), and START_TEST().

◆ g_CTOR

LONG g_CTOR = 0
static

Definition at line 19 of file CComObject.cpp.

Referenced by CTestObject::CTestObject(), and START_TEST().

◆ g_DTOR

LONG g_DTOR = 0
static

Definition at line 20 of file CComObject.cpp.

Referenced by START_TEST(), and CTestObject::~CTestObject().