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:
30
UnitTests/Shell.cpp
Normal file
30
UnitTests/Shell.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
SPDX-License-Identifier: MIT
|
||||
Copyright © 2022 Amebis
|
||||
*/
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
|
||||
|
||||
namespace UnitTests
|
||||
{
|
||||
TEST_CLASS(Shell)
|
||||
{
|
||||
public:
|
||||
TEST_METHOD(PathCanonicalizeA)
|
||||
{
|
||||
string path;
|
||||
Assert::IsTrue(::PathCanonicalizeA(path, "C:\\Windows\\Temp\\test\\.."));
|
||||
Assert::AreEqual("C:\\Windows\\Temp", path.c_str(), true);
|
||||
}
|
||||
|
||||
TEST_METHOD(PathCanonicalizeW)
|
||||
{
|
||||
wstring path;
|
||||
Assert::IsTrue(::PathCanonicalizeW(path, L"C:\\Windows\\Temp\\test\\.."));
|
||||
Assert::AreEqual(L"C:\\Windows\\Temp", path.c_str(), true);
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user