Check the Assignment 2 grade on the ZINC Online Submission System. Your submission record will state all test case failures (if any).
While there are multiple grading records on ZINC, only the latest one will count as the score for your submission; you can ignore other previous records.
Since we did not mention how late penalty is calculated, we gave a grace period of 5 minutes to late submission. Your latest submission before 23 October 2021, 00:04 HKT was graded. If there were no submissions before 23 October 2021, 00:04 HKT, your score will be discarded. This applies to the bonus part as well.
To make an appeal for your grades, please follow the below procedure. Appeals with incomplete information and/or not following the procedure will not be processed:
Your appeal will be processed slowly. Please be patient. If you do not receive any reply or acknowledgment after 72 hours, please send the email again.
Below is a list of common errors and situations for COMP2012H assignments in general:
FilesystemStub.cpp).Commit.cpp and gitlite.cpp to this directory. Then run make:
make
Two executables are produced:
gitlite-grader: The grader version of Gitlite with all filesystem operations replaced by in-memory operations.gitlite-unit-testing: Unit testing cases of individiual functions.
# For Windows
.\gitlite-grader -t tests/init.in
# For macOS and Linux
./gitlite-grader -t tests/init.in
gitlite-grader-leak: The grader version of Gitlite with all filesystem operations replaced by in-memory operations. Also runs GCC sanitizer.gitlite-unit-testing-leak: Unit testing cases of individiual functions. Also runs GCC sanitizer.
The following test cases of unit testing correspond to those listed in ZINC. You can run them by providing the test case number to gitlite-unit-testing. For example, this runs test case 10:
# For macOS and Linux
./gitlite-unit-testing 10
# For Windows
..\gitlite-unit-testing.exe 10
ListNew: Calls list_new() to create a list. The data fields in the sentinel are checked.
ListPushBackOne: Calls list_push_back() to add one blob at the back. Both forward and backward orders of the linked list are checked.
ListPushBackMultiple: Calls list_push_back() to add multiple blobs at the back. Both forward and backward orders of the linked list are checked.
ListFindNameFound: Calls list_find_name() to find a blob with the given name. The blob can be found. The return values are checked.
ListFindNameNotFound: Calls list_find_name() to find a blob with the given name. The blob cannot be found. The return values are checked.
ListPutNewOne: Calls list_put() to add a blob to the list. The return value is checked. Both forward and backward orders of the linked list are checked.
ListPutNewMultiple: Calls list_put() to add multiple blobs to the list. The return values are checked. Both forward and backward orders of the linked list are checked.
ListPutUpdateOne: Calls list_put() to update a blob in the list. The return value is checked. Both forward and backward orders of the linked list are checked.
ListPutUpdateMultiple: Calls list_put() to update multiple blobs to the list. The return values are checked. Both forward and backward orders of the linked list are checked.
ListPutNewMultipleCommit: Same as ListPutNewMultiple but uses commits instead.
ListPutUpdateMultipleCommit: Same as ListPutUpdateMultiple but uses commits instead.
ListRemoveNotFound: Calls list_remove() to remove a blob with the given name. The blob cannot be found. The return values are checked. Both forward and backward orders of the linked list are checked.
ListRemoveOne: Calls list_remove() to remove a blob with the given name. The blob can be found and removed. The return value is checked. Both forward and backward orders of the linked list are checked.
ListRemoveAll: Calls list_remove() to remove all blobs from the list. The return values are checked. Both forward and backward orders of the linked list are checked.
ListSize: Calls list_size() to get the size of several lists.
ListClearEmpty: Calls list_clear() on an empty list. Both forward and backward orders of the linked list are checked.
ListClearNonEmpty: Calls list_clear() on an non-empty list. Both forward and backward orders of the linked list are checked.
ListReplaceEmptyByEmpty: Calls list_replace() to replace an empty list by an empty list. Both forward and backward orders of the linked list are checked.
ListReplaceEmptyByNonEmpty: Calls list_replace() to replace an empty list by an non-empty list. Both forward and backward orders of the linked list are checked.
ListReplaceNonEmptyByEmpty: Calls list_replace() to replace an non-empty list by an empty list. Both forward and backward orders of the linked list are checked.
ListReplaceNonEmptyByNonEmpty: Calls list_replace() to replace an non-empty list by an non-empty list. Both forward and backward orders of the linked list are checked.
ListCopyEmpty: Calls list_copy() to copy an empty list. Both forward and backward orders of the linked list are checked.
ListCopyNonEmpty: Calls list_copy() to copy an non-empty list. Both forward and backward orders of the linked list are checked.
ListDeleteEmpty: Calls list_delete() on an empty list.
ListDeleteNonEmpty: Calls list_delete() on non-empty list.
ListDeleteEmptyCommit: Same as ListDeleteNonEmpty but the list contains branches that have a commit pointer.
The following test cases also run GCC sanitizer to check for memory leak.
Init: Calls init() and verifies the data structures.
AddUntrackedFiles: Calls add() to add untracked files.
AddUpdatedFiles: Calls add() to add a tracked file with updated content.
AddUnchangedFiles: Calls add() to add a tracked file with unchanged content.
AddRemovedFiles: Calls add() to add a file that is staged for removal.
CommitWithChanges: Calls commit() to make a commit with files staged for addition.
CommitWithoutChanges: Calls commit() to make a commit without files staged for addition and removal.
CommitWithRemovalOnly: Calls commit() to make a commit with files staged for removal only.
RemoveStagedFiles: Calls remove() to remove a file that is staged for addition.
RemoveHeadTrackedFiles: Calls remove() to remove a file that is tracked in the head commit of the repository.
RemoveFilesNotExist: Calls remove() to remove a file that is neither staged for addition nor tracked in the head commit of the repository.
CheckoutFiles: Calls checkout() to checkout files from different commits.
CheckoutFilesNotExist: Calls checkout() to checkout files that do not exist in commits.
CheckoutCommitNotExist: Calls checkout() to checkout files from commits that do not exist.
CheckoutBranch: Calls checkout() to checkout a branch.
CheckoutBranchNotExists: Calls checkout() to checkout a branch that does not exist.
CheckoutCurrentBranch: Calls checkout() to checkout the current branch.
ResetToParent: Calls reset() to reset to the parent commit.
ResetToSelf: Calls reset() to reset to the head commit of the repository.
ResetToCommitNotExists: Calls reset() to reset to a commit that does not exist.
CreateNewBranch: Calls branch() to create a new branch.
CreateBranchWithDuplicateName: Calls branch() to create a branch with existing name.
RemoveBranch: Calls remove_branch() to remove a branch.
RemoveBranchNotExists: Calls remove_branch() to remove a branch that does not exist.
RemoveCurrentBranch: Calls remove_branch() to remove the current branch.
MergeAncestors: Calls merge() to merge an ancestor into the current branch.
MergeHandlesFastForwading: Calls merge() to merge a branch with fast forward.
MergeOverwritingUntrackedFiles: Calls merge() to merge a branch that would overwrite untracked files.
MergeGeneralTest: Calls merge() to merge a branch into the current branch.
MergeBranchNotExists: Calls merge() to merge a branch that does not exist.
MergeCurrentBranch: Calls merge() to merge the current branch.
MergeWithUncommitedChanges: Calls merge() with uncommitted changes.
get_lca()
Same: Calls get_lca() with two identical commits.
Ahead: Calls get_lca() with one commit is ahead of another.
Diverged: Calls get_lca() with two commits whose history have diverged.
The following test cases also run GCC sanitizer to check for memory leak.
Merged1: Calls get_lca() where the commit history contains second parent.get_lca() where the commit history contains second parent.
The following test cases run the automated testing module of Gitlite, with all filesystem operations replaced by in-memory operations. You can read the content of the files used in auto-testing/src.
To run the integrated testcases, first change the working directory to auto-testing. If you are using VSCode, right click on auto-testing in the directory structure that appears on the left, click "Open in Integrated Terminal". Run the grading version of Gitlite, which is located in the parent directoy in the following way (this example runs the test case init.in):
# For macOS and Linux
../gitlite-grader -t tests/init.in
# For Windows
..\gitlite-grader.exe -t tests\init.in
You can read and understand the test cases in order to know what commands were being tested and the expected output.
init.inadd-multi.inadd-remove.incommit.inrm.incheckout-file.incheckout-branch.inreset.inmerge-simple.inmerge-case123.inmerge-case45.inmerge-case67.inmerge-case8a.inmerge-case8b.inmerge-case8c.inmerge-case-all.inbranch-and-rm.inlog.instatus-branch.instatus-files.inThe following test cases also run GCC sanitizer to check for memory leak.
merge-2nd-parent.in