/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// non-existent device, must fail
EXPECT_FALSE(
TestNtPathToDosPath(L"\\Device\\ThisDeviceDoesNotExist\\Foo", nullptr));
// base case
nsAutoString testPath(cDrive);
testPath.Append(L"\\Program Files");
EXPECT_TRUE(TestNtPathToDosPath(testPath.get(), L"C:\\Program Files"));
// short filename
nsAutoString ntShortName(cDrive);
ntShortName.Append(L"\\progra~1");
EXPECT_TRUE(TestNtPathToDosPath(ntShortName.get(), L"C:\\Program Files"));
DriveMapping drvMapping(u"\\\\127.0.0.1\\C$"_ns); // Only run these tests if we were able to map; some machines don't have perms if (drvMapping.Init()) { wchar_t expected[] = L" :\\";
expected[0] = drvMapping.GetDriveLetter();
nsAutoString networkPath;
ASSERT_TRUE(DriveToNtPath(drvMapping.GetDriveLetter(), networkPath));
// NtPathToDosPath must correctly handle paths whose drive letter mapping // has changed. We need to test this because the APIs called by // NtPathToDosPath return different info if this has happened.
ASSERT_TRUE(drvMapping.ChangeDriveLetter());
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.