Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,18 @@ private void VerifyFileInformation(
VerifyFileCommonDirectoryInformation(entry.FileCommonDirectoryInformation, fileAttribute, verifyFileTime);
Site.Assert.AreEqual(fileName, Encoding.Unicode.GetString(entry.FileName), $"FileName of the entry should be {fileName}.");
Site.Assert.AreEqual(endOfFile, entry.FileCommonDirectoryInformation.EndOfFile, $"The EndOfFile of the entry should be {endOfFile}.");
Site.Assert.AreEqual(allocationSize, entry.FileCommonDirectoryInformation.AllocationSize, $"The AllocationSize of the entry should be {allocationSize}.");
if (this.fsaAdapter.FileSystem == FileSystem.NTFS ||
this.fsaAdapter.FileSystem == FileSystem.REFS)
{
// Allocation size is implementation-specific.
Site.Assert.AreEqual(allocationSize, entry.FileCommonDirectoryInformation.AllocationSize,
$"The AllocationSize of the entry should be {allocationSize}.");
} else {
// OTHERFS -- Only demand 512-byte block alignment
Site.Assert.AreEqual(0, (entry.FileCommonDirectoryInformation.AllocationSize & 511),
$"The AllocationSize of the entry should be block-aligned.");
}

}

/// <summary>
Expand All @@ -671,7 +682,17 @@ private void VerifyFileInformation(
VerifyFileCommonDirectoryInformation(entry.FileCommonDirectoryInformation, fileAttribute, verifyFileTime);
Site.Assert.AreEqual(fileName, Encoding.Unicode.GetString(entry.FileName), $"FileName of the entry should be {fileName}.");
Site.Assert.AreEqual(endofFile, entry.FileCommonDirectoryInformation.EndOfFile, $"The EndOfFile of the entry should be {endofFile}.");
Site.Assert.AreEqual(allocationSize, entry.FileCommonDirectoryInformation.AllocationSize, $"The AllocationSize of the entry should be {allocationSize}.");
if (this.fsaAdapter.FileSystem == FileSystem.NTFS ||
this.fsaAdapter.FileSystem == FileSystem.REFS)
{
// Allocation size is implementation-specific.
Site.Assert.AreEqual(allocationSize, entry.FileCommonDirectoryInformation.AllocationSize,
$"The AllocationSize of the entry should be {allocationSize}.");
} else {
// OTHERFS -- Only demand 512-byte block alignment
Site.Assert.AreEqual(0, (entry.FileCommonDirectoryInformation.AllocationSize & 511),
$"The AllocationSize of the entry should be block-aligned.");
}
Site.Assert.AreEqual(eaSize, entry.EaSize, $"EaSize of the entry should be {eaSize}.");
}

Expand All @@ -692,7 +713,17 @@ private void VerifyFileInformation(
VerifyFileCommonDirectoryInformation(entry.FileCommonDirectoryInformation, fileAttribute, verifyFileTime);
Site.Assert.AreEqual(fileName, Encoding.Unicode.GetString(entry.FileName), $"FileName of the entry should be {fileName}.");
Site.Assert.AreEqual(endofFile, entry.FileCommonDirectoryInformation.EndOfFile, $"The EndOfFile of the entry should be {endofFile}.");
Site.Assert.AreEqual(allocationSize, entry.FileCommonDirectoryInformation.AllocationSize, $"The AllocationSize of the entry should be {allocationSize}.");
if (this.fsaAdapter.FileSystem == FileSystem.NTFS ||
this.fsaAdapter.FileSystem == FileSystem.REFS)
{
// Allocation size is implementation-specific.
Site.Assert.AreEqual(allocationSize, entry.FileCommonDirectoryInformation.AllocationSize,
$"The AllocationSize of the entry should be {allocationSize}.");
} else {
// OTHERFS -- Only demand 512-byte block alignment
Site.Assert.AreEqual(0, (entry.FileCommonDirectoryInformation.AllocationSize & 511),
$"The AllocationSize of the entry should be block-aligned.");
}
Site.Assert.AreEqual(eaSize, entry.EaSize, $"EaSize of the entry should be {eaSize}.");
}

Expand All @@ -714,10 +745,25 @@ private void VerifyFileInformation(
VerifyFileCommonDirectoryInformation(entry.FileCommonDirectoryInformation, fileAttribute, verifyFileTime);
Site.Assert.AreEqual(fileName, Encoding.Unicode.GetString(entry.FileName), $"FileName of the entry should be {fileName}.");
Site.Assert.AreEqual(endofFile, entry.FileCommonDirectoryInformation.EndOfFile, $"The EndOfFile of the entry should be {endofFile}.");
Site.Assert.AreEqual(allocationSize, entry.FileCommonDirectoryInformation.AllocationSize, $"The AllocationSize of the entry should be {allocationSize}.");
Site.Assert.AreEqual(eaSize, entry.EaSize, $"EaSize of the entry should be {eaSize}.");
Site.Assert.AreEqual(shortName.Length * 2, entry.ShortNameLength, $"The ShortNameLength of the entry should be {shortName.Length * 2}."); // ShortName is unicode in protocol
Site.Assert.AreEqual(shortName, GetShortName(entry.ShortName, entry.ShortNameLength), $"The ShortName of the entry should be \"{shortName}\".");
if (this.fsaAdapter.FileSystem == FileSystem.NTFS ||
this.fsaAdapter.FileSystem == FileSystem.REFS)
{
// Allocation size is implementation-specific.
Site.Assert.AreEqual(allocationSize, entry.FileCommonDirectoryInformation.AllocationSize,
$"The AllocationSize of the entry should be {allocationSize}.");
Site.Assert.AreEqual(eaSize, entry.EaSize, $"EaSize of the entry should be {eaSize}.");
// Short name is implementation-specific.
Site.Assert.AreEqual(shortName.Length * 2, entry.ShortNameLength,
$"The ShortNameLength of the entry should be {shortName.Length * 2}."); // ShortName is unicode in protocol
Site.Assert.AreEqual(shortName, GetShortName(entry.ShortName, entry.ShortNameLength),
$"The ShortName of the entry should be \"{shortName}\".");
} else {
// OTHERFS -- Only demand 512-byte block alignment
Site.Assert.AreEqual(0, (entry.FileCommonDirectoryInformation.AllocationSize & 511),
$"The AllocationSize of the entry should be block-aligned.");
Site.Assert.AreEqual(eaSize, entry.EaSize, $"EaSize of the entry should be {eaSize}.");
// OTHERFS -- don't know what the actual short name should be.
}
}

/// <summary>
Expand All @@ -738,10 +784,25 @@ private void VerifyFileInformation(
VerifyFileCommonDirectoryInformation(entry.FileCommonDirectoryInformation, fileAttribute, verifyFileTime);
Site.Assert.AreEqual(fileName, Encoding.Unicode.GetString(entry.FileName), $"FileName of the entry should be {fileName}.");
Site.Assert.AreEqual(endofFile, entry.FileCommonDirectoryInformation.EndOfFile, $"The EndOfFile of the entry should be {endofFile}.");
Site.Assert.AreEqual(allocationSize, entry.FileCommonDirectoryInformation.AllocationSize, $"The AllocationSize of the entry should be {allocationSize}.");
Site.Assert.AreEqual(eaSize, entry.EaSize, $"EaSize of the entry should be {eaSize}.");
Site.Assert.AreEqual(shortName.Length * 2, entry.ShortNameLength, $"The ShortNameLength of the entry should be {shortName.Length * 2}."); // ShortName is unicode in protocol
Site.Assert.AreEqual(shortName, GetShortName(entry.ShortName, entry.ShortNameLength), $"The ShortName of the entry should be \"{shortName}\".");
if (this.fsaAdapter.FileSystem == FileSystem.NTFS ||
this.fsaAdapter.FileSystem == FileSystem.REFS)
{
// Allocation size is implementation-specific.
Site.Assert.AreEqual(allocationSize, entry.FileCommonDirectoryInformation.AllocationSize,
$"The AllocationSize of the entry should be {allocationSize}.");
Site.Assert.AreEqual(eaSize, entry.EaSize, $"EaSize of the entry should be {eaSize}.");
// Short name is implementation-specific.
Site.Assert.AreEqual(shortName.Length * 2, entry.ShortNameLength,
$"The ShortNameLength of the entry should be {shortName.Length * 2}."); // ShortName is unicode in protocol
Site.Assert.AreEqual(shortName, GetShortName(entry.ShortName, entry.ShortNameLength),
$"The ShortName of the entry should be \"{shortName}\".");
} else {
// OTHERFS -- Only demand 512-byte block alignment
Site.Assert.AreEqual(0, (entry.FileCommonDirectoryInformation.AllocationSize & 511),
$"The AllocationSize of the entry should be block-aligned.");
Site.Assert.AreEqual(eaSize, entry.EaSize, $"EaSize of the entry should be {eaSize}.");
// OTHERFS -- don't know what the actual short name should be.
}
}

/// <summary>
Expand Down