@@ -38,6 +38,15 @@ test code to handle memory leaks
3838Do be careful to not remove or weaken the tests, though; at a minimum
3939you definitely want to be able to pass the tests as given.
4040
41+ :bangbang : Neither of the parts of this lab comes with a ` main() ` function.
42+ We could add one, but both of the target functions (` mergesort() ` and
43+ ` array_merge() ` ) are really "library" functions that don't make a
44+ lot of sense as functions that users would interact with directly. So
45+ we just have them called by the tests but don't provide a way for you
46+ to call them directly. If you want to create a ` main.c ` for either or
47+ both of the projects feel free to do so, but it's definitely not
48+ expected.
49+
4150## Fixing memory problems
4251
4352Passing the tests is arguably just the first half of each of these problems,
@@ -129,6 +138,12 @@ Some things to watch our for:
129138
130139There are more comprehensive tips and suggestions in ` Tips_and_suggestions.md ` in the repository.
131140
141+ :bangbang : The Array Merge problem depends on the Mergesort problem, so you really
142+ should do Mergesort first. The GitHub Actions (that run the tests automatically and
143+ create things like the status badges) actually include ` mergesort.c ` when they
144+ compile the Array Merge code, so if ` mergesort.c ` is incomplete or otherwise
145+ broken that will cause the Array Merge tests to fail.
146+
132147### Mergesort
133148
134149Your task here is to implement a well known sorting algorithm in C,
@@ -222,7 +237,22 @@ the array without messing with that important first element.
222237You can use references like ` ../mergesort/mergesort.h ` or
223238` ../mergesort/mergesort.c ` to access appropriate files in that part of
224239the project, either in things like ` #include ` statements or
225- in ` gcc/g++ ` calls.
240+ in ` gcc/g++ ` calls. The command in the GitHub Actions to compile
241+ the Array Merge tess, for example, is:
242+
243+ ``` text
244+ g++ -Wall -g -o array_merge_test ../mergesort/mergesort.c array_merge.c array_merge_test.cpp -lgtest -pthread -std=c++0x
245+ ```
246+
247+ Note that the ` ../mergesort/mergesort.c ` in this command includes
248+ the Mergesort ` .c ` file in the list of files that will be compiled
249+ and linked together to form the ` array_merge_test ` executable.
250+ That has two major implications:
251+
252+ - You * must* have a working ` mergesort.c ` in order to get the GitHub
253+ Actions for Array Merge to compile successfully.
254+ - You * can* (and presumably should?) use the function ` mergesort() ` that
255+ you define in the other part of the lab here in Array Merge.
226256
227257## Final Words
228258
0 commit comments