Skip to content

Commit 67ba85a

Browse files
committed
C++: Add failing tests for 'CAtlTemporaryFile'.
1 parent 3709151 commit 67ba85a

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

  • cpp/ql/test/library-tests/dataflow/source-sink-tests

cpp/ql/test/library-tests/dataflow/source-sink-tests/atl.cpp

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,39 @@ void test_CAtlFileMapping(CAtlFileMapping<char> mapping) {
179179
char* data = static_cast<char*>(mapping); // $ local_source
180180
void* data2 = mapping.GetData(); // $ local_source
181181
}
182+
183+
struct CAtlTemporaryFile {
184+
CAtlTemporaryFile() throw();
185+
~CAtlTemporaryFile() throw();
186+
HRESULT Close(LPCTSTR szNewName) throw();
187+
HRESULT Create(LPCTSTR pszDir, DWORD dwDesiredAccess) throw();
188+
HRESULT Flush() throw();
189+
HRESULT GetPosition(ULONGLONG& nPos) const throw();
190+
HRESULT GetSize(ULONGLONG& nLen) const throw();
191+
HRESULT HandsOff() throw();
192+
HRESULT HandsOn() throw();
193+
HRESULT LockRange(ULONGLONG nPos, ULONGLONG nCount) throw();
194+
195+
HRESULT Read(
196+
LPVOID pBuffer,
197+
DWORD nBufSize,
198+
DWORD& nBytesRead) throw();
199+
HRESULT Seek(LONGLONG nOffset, DWORD dwFrom) throw();
200+
201+
HRESULT SetSize(ULONGLONG nNewLen) throw();
202+
LPCTSTR TempFileName() throw();
203+
HRESULT UnlockRange(ULONGLONG nPos, ULONGLONG nCount) throw();
204+
205+
HRESULT Write(
206+
LPCVOID pBuffer,
207+
DWORD nBufSize,
208+
DWORD* pnBytesWritten) throw();
209+
operator HANDLE() throw();
210+
};
211+
212+
void test_CAtlTemporaryFile() {
213+
CAtlTemporaryFile file;
214+
char buffer[1024];
215+
DWORD bytesRead;
216+
file.Read(buffer, 1024, bytesRead); // $ MISSING: local_source
217+
}

0 commit comments

Comments
 (0)