[PATCH 25/41] robocopy/tests: add conformance tests for /LEV
Florian Eder
others.meder at gmail.com
Mon Sep 6 09:55:02 CDT 2021
Signed-off-by: Florian Eder <others.meder at gmail.com>
---
programs/robocopy/tests/robocopy.c | 56 ++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+)
diff --git a/programs/robocopy/tests/robocopy.c b/programs/robocopy/tests/robocopy.c
index 8c94311f74d..6ded4e98650 100644
--- a/programs/robocopy/tests/robocopy.c
+++ b/programs/robocopy/tests/robocopy.c
@@ -479,6 +479,44 @@ static void check_wildcard_3_test(void)
check_folder_and_delete(L"robocopy_destination", TRUE);
}
+static void check_lev_1_test(void)
+{
+ check_files_equal(L"robocopy_source\\fileA.a", L"robocopy_destination\\fileA.a", TRUE);
+ check_files_equal(L"robocopy_source\\fileB.b", L"robocopy_destination\\fileB.b", TRUE);
+ check_files_equal(L"robocopy_source\\folderA\\fileC.c", L"robocopy_destination\\folderA\\fileC.c", TRUE);
+ check_files_equal(L"robocopy_source\\folderA\\fileD.d", L"robocopy_destination\\folderA\\fileD.d", TRUE);
+ check_files_equal(L"robocopy_source\\folderB\\fileF.f", L"robocopy_destination\\folderB\\fileF.f", TRUE);
+ check_files_equal(L"robocopy_source\\folderB\\fileG.g", L"robocopy_destination\\folderB\\fileG.g", TRUE);
+
+ check_file_and_delete(L"robocopy_source\\fileA.a", TRUE);
+ check_file_and_delete(L"robocopy_source\\fileB.b", TRUE);
+ check_file_and_delete(L"robocopy_source\\folderA\\fileC.c", TRUE);
+ check_file_and_delete(L"robocopy_source\\folderA\\fileD.d", TRUE);
+ check_file_and_delete(L"robocopy_source\\folderA\\folderD\\fileE.e", TRUE);
+ check_file_and_delete(L"robocopy_source\\folderB\\fileF.f", TRUE);
+ check_file_and_delete(L"robocopy_source\\folderB\\fileG.g", TRUE);
+ check_folder_and_delete(L"robocopy_source\\folderA\\folderD", TRUE);
+ check_folder_and_delete(L"robocopy_source\\folderA\\folderE", TRUE);
+ check_folder_and_delete(L"robocopy_source\\folderA", TRUE);
+ check_folder_and_delete(L"robocopy_source\\folderB", TRUE);
+ check_folder_and_delete(L"robocopy_source\\folderC", TRUE);
+ check_folder_and_delete(L"robocopy_source", TRUE);
+
+ check_file_and_delete(L"robocopy_destination\\fileA.a", TRUE);
+ check_file_and_delete(L"robocopy_destination\\fileB.b", TRUE);
+ check_file_and_delete(L"robocopy_destination\\folderA\\fileC.c", TRUE);
+ check_file_and_delete(L"robocopy_destination\\folderA\\fileD.d", TRUE);
+ check_file_and_delete(L"robocopy_destination\\folderA\\folderD\\fileE.e", FALSE);
+ check_file_and_delete(L"robocopy_destination\\folderB\\fileF.f", TRUE);
+ check_file_and_delete(L"robocopy_destination\\folderB\\fileG.g", TRUE);
+ check_folder_and_delete(L"robocopy_destination\\folderA\\folderD", FALSE);
+ check_folder_and_delete(L"robocopy_destination\\folderA\\folderE", FALSE);
+ check_folder_and_delete(L"robocopy_destination\\folderA", TRUE);
+ check_folder_and_delete(L"robocopy_destination\\folderB", TRUE);
+ check_folder_and_delete(L"robocopy_destination\\folderC", TRUE);
+ check_folder_and_delete(L"robocopy_destination", TRUE);
+}
+
START_TEST(robocopy)
{
WCHAR temp_command_line[2048], previous_cwd_path[4096], temp_path[4096];
@@ -613,6 +651,24 @@ START_TEST(robocopy)
check_wildcard_3_test();
winetest_pop_context();
+ winetest_push_context("LEV test 1");
+ create_test_source_folder();
+ execute_robocopy(L"robocopy.exe robocopy_source robocopy_destination /s /e /lev:0 /r:1 /w:0", 1);
+ check_mir_test();
+ winetest_pop_context();
+
+ winetest_push_context("LEV test 2");
+ create_test_source_folder();
+ execute_robocopy(L"robocopy.exe robocopy_source robocopy_destination /s /e /lev:1 /r:1 /w:0", 1);
+ check_basic_copy_test();
+ winetest_pop_context();
+
+ winetest_push_context("LEV test 3");
+ create_test_source_folder();
+ execute_robocopy(L"robocopy.exe robocopy_source robocopy_destination /s /e /lev:2 /r:1 /w:0", 1);
+ check_lev_1_test();
+ winetest_pop_context();
+
/* Reset CWD to previous folder */
ok(SetCurrentDirectoryW(previous_cwd_path), "couldn't set CWD to previous CWD folder \"%S\"", previous_cwd_path);
}
\ No newline at end of file
--
2.32.0
More information about the wine-devel
mailing list