WinStd/UnitTests/Shell.cpp
Simon Rozman 017d5d5c99 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>
2022-03-07 14:20:58 +01:00

31 lines
621 B
C++

/*
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);
}
};
}