Commit d5e83627e4ed764115175dc42090afe0df332fe3

Russell Belfer 2013-10-08T14:41:32

Case sensitivity issues on Linux A couple of tests were actually dealing incorrectly with case sensitivity issues on Linux because they were relying on having core.ignorecase set to true. Now that the fixture initialization sets the case sensitivity to be accurate for the platform, it exposed bugs in these tests.

diff --git a/tests-clar/status/renames.c b/tests-clar/status/renames.c
index de84a57..16fd026 100644
--- a/tests-clar/status/renames.c
+++ b/tests-clar/status/renames.c
@@ -69,14 +69,14 @@ static void test_status(
 		actual = git_status_byindex(status_list, i);
 		expected = &expected_list[i];
 
-		cl_assert_equal_i_fmt(expected->status, actual->status, "%04x");
-
 		oldname = actual->head_to_index ? actual->head_to_index->old_file.path :
 			actual->index_to_workdir ? actual->index_to_workdir->old_file.path : NULL;
 
 		newname = actual->index_to_workdir ? actual->index_to_workdir->new_file.path :
 			actual->head_to_index ? actual->head_to_index->new_file.path : NULL;
 
+		cl_assert_equal_i_fmt(expected->status, actual->status, "%04x");
+
 		if (oldname)
 			cl_assert(git__strcmp(oldname, expected->oldname) == 0);
 		else
@@ -507,14 +507,14 @@ void test_status_renames__both_casechange_two(void)
 		  "untimely.txt", "untimeliest.txt" }
 	};
 	struct status_entry expected_case[] = {
-		{ GIT_STATUS_INDEX_RENAMED | GIT_STATUS_INDEX_MODIFIED |
-		  GIT_STATUS_WT_RENAMED | GIT_STATUS_WT_MODIFIED,
-		  "ikeepsix.txt", "ikeepsix.txt" },
-		{ GIT_STATUS_INDEX_MODIFIED | GIT_STATUS_WT_RENAMED,
-		  "sixserving.txt", "SixServing.txt" },
 		{ GIT_STATUS_INDEX_RENAMED |
 		  GIT_STATUS_WT_MODIFIED | GIT_STATUS_WT_RENAMED,
 		  "songof7cities.txt", "SONGOF7.txt" },
+		{ GIT_STATUS_INDEX_MODIFIED | GIT_STATUS_WT_RENAMED,
+		  "sixserving.txt", "SixServing.txt" },
+		{ GIT_STATUS_INDEX_RENAMED | GIT_STATUS_INDEX_MODIFIED |
+		  GIT_STATUS_WT_RENAMED | GIT_STATUS_WT_MODIFIED,
+		  "ikeepsix.txt", "ikeepsix.txt" },
 		{ GIT_STATUS_INDEX_RENAMED | GIT_STATUS_WT_RENAMED,
 		  "untimely.txt", "untimeliest.txt" }
 	};
diff --git a/tests-clar/submodule/status.c b/tests-clar/submodule/status.c
index f1227a5..f5111c8 100644
--- a/tests-clar/submodule/status.c
+++ b/tests-clar/submodule/status.c
@@ -388,7 +388,8 @@ void test_submodule_status__iterator(void)
 	opts.flags = GIT_STATUS_OPT_INCLUDE_UNTRACKED |
 		GIT_STATUS_OPT_INCLUDE_UNMODIFIED |
 		GIT_STATUS_OPT_INCLUDE_IGNORED |
-		GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS;
+		GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS |
+		GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY;
 
 	cl_git_pass(git_status_foreach_ext(
 		g_repo, &opts, confirm_submodule_status, &exp));