MCPcopy Create free account
hub / github.com/alamaison/swish / _testCDataObjectQueryFormats

Function _testCDataObjectQueryFormats

test/shell_folder/data_object_test.cpp:143–156  ·  view source on GitHub ↗

* Test QueryGetData() enumerator for the presence of CFSTR_SHELLIDLIST * but the absence of CFSTR_FILEDESCRIPTOR and CFSTR_FILECONTENTS. * * Format-limited version of _testQueryFormats() in DataObjectTests.h. */

Source from the content-addressed store, hash-verified

141 * Format-limited version of _testQueryFormats() in DataObjectTests.h.
142 */
143void _testCDataObjectQueryFormats(com_ptr<IDataObject> data_object)
144{
145 // Test CFSTR_SHELLIDLIST (PIDL array) format succeeds
146 CFormatEtc fetcShellIdList(CFSTR_SHELLIDLIST);
147 BOOST_REQUIRE_OK(data_object->QueryGetData(&fetcShellIdList));
148
149 // Test CFSTR_FILEDESCRIPTOR (FILEGROUPDESCRIPTOR) format fails
150 CFormatEtc fetcDescriptor(CFSTR_FILEDESCRIPTOR);
151 BOOST_CHECK(data_object->QueryGetData(&fetcDescriptor) == S_FALSE);
152
153 // Test CFSTR_FILECONTENTS (IStream) format fails
154 CFormatEtc fetcContents(CFSTR_FILECONTENTS);
155 BOOST_CHECK(data_object->QueryGetData(&fetcContents) == S_FALSE);
156}
157
158class TestFixture : public SwishPidlFixture, public ComFixture
159{

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 1

QueryGetDataMethod · 0.80

Tested by

no test coverage detected