Skip to content

Commit

Permalink
unit test fix for sync -c
Browse files Browse the repository at this point in the history
  • Loading branch information
jessk-msft committed Dec 11, 2023
1 parent 2e7fed9 commit 04a122a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/P4VFS.UnitTest/Source/UnitTestWorkflow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,19 @@ public void SyncProtocolsTest()
string clientRoot = GetClientRoot();
string directory = String.Format(@"{0}\depot\tools\dev\source", clientRoot);
string revision = "@21";
string[] syncArgs = WindowsInterop.CommandLineToArgs(syncOption);

ServiceRestart();
Assert(ProcessInfo.ExecuteWait(P4vfsExe, String.Format("{0} sync {1} \"{2}\\...{3}\"", ClientConfig, syncOption, directory, revision), echo:true, log:true) == 0);
Assert(ProcessInfo.ExecuteWait(P4Exe, String.Format("{0} flush -f \"{1}\\...{2}\"", ClientConfig, directory, revision), echo:true) == 0);

Dictionary<string, long> placeholderSizeMap = new Dictionary<string, long>();
if (WindowsInterop.CommandLineToArgs(syncOption).Contains("-c"))
if (syncArgs.Contains("-c"))
{
foreach (string filePath in Directory.GetFiles(clientRoot, "*", SearchOption.AllDirectories))
{
placeholderSizeMap[filePath] = FileUtilities.GetFileLength(filePath);
Assert(IsPlaceholderFile(filePath));
Assert(IsPlaceholderFile(filePath) || syncArgs.Contains("-r"));
}
}

Expand Down

0 comments on commit 04a122a

Please sign in to comment.