UnitTests: Introduce

Other than having a convenient framework to test our helpers, this
allows CodeQL code analysis GitHub action.

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
2022-03-07 14:14:29 +01:00
parent 3b110f7dc5
commit 017d5d5c99
11 changed files with 287 additions and 7 deletions

View File

@@ -19,9 +19,6 @@
template<class _Traits, class _Ax>
static BOOL PathCanonicalizeA(_Inout_ std::basic_string<char, _Traits, _Ax> &sValue, _In_ LPCSTR pszPath)
{
assert(0); // TODO: Test this code.
// Allocate buffer on heap and read into it.
char szBuffer[MAX_PATH + 1];
BOOL bResult = ::PathCanonicalizeA(szBuffer, pszPath);
sValue.assign(szBuffer, bResult ? MAX_PATH : 0);
@@ -36,8 +33,6 @@ static BOOL PathCanonicalizeA(_Inout_ std::basic_string<char, _Traits, _Ax> &sVa
template<class _Traits, class _Ax>
static BOOL PathCanonicalizeW(_Inout_ std::basic_string<wchar_t, _Traits, _Ax> &sValue, _In_ LPCWSTR pszPath)
{
assert(0); // TODO: Test this code.
wchar_t szBuffer[MAX_PATH + 1];
BOOL bResult = ::PathCanonicalizeW(szBuffer, pszPath);
sValue.assign(szBuffer, bResult ? MAX_PATH : 0);