From 28ac74aef63d50031bb6cad9fabdba0b25ecd279 Mon Sep 17 00:00:00 2001 From: Dennis Liu Date: Sat, 1 Mar 2025 22:08:32 +0800 Subject: [PATCH] Refine trace command descriptions Updated the trace command files to specify required operations explicitly. Improved documentation without modifying test data. Change-Id: If8ef44171bb5cc3cfee812d74cc33d55f6f1320b --- README.md | 2 ++ traces/trace-01-ops.cmd | 2 +- traces/trace-02-ops.cmd | 2 +- traces/trace-03-ops.cmd | 2 +- traces/trace-04-ops.cmd | 2 +- traces/trace-05-ops.cmd | 2 +- traces/trace-06-ops.cmd | 2 +- traces/trace-07-string.cmd | 2 +- traces/trace-08-robust.cmd | 2 +- traces/trace-09-robust.cmd | 2 +- traces/trace-10-robust.cmd | 2 +- traces/trace-11-malloc.cmd | 2 +- traces/trace-12-malloc.cmd | 2 +- traces/trace-13-malloc.cmd | 2 +- traces/trace-14-perf.cmd | 2 +- traces/trace-15-perf.cmd | 2 +- traces/trace-16-perf.cmd | 2 +- traces/trace-17-complexity.cmd | 2 +- 18 files changed, 19 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 40fcd96b1..f144de29f 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,8 @@ Trace files * They are short and simple. * We encourage to study them to see what tests are being performed. * XX is the trace number (1-17). CAT describes the general nature of the test. + * All functions that need to be implemented are explicitly listed. + * If a colon is present in the title, all functions mentioned afterwards must be correctly implemented for the test to pass. * `traces/trace-eg.cmd` : A simple, documented trace file to demonstrate the operation of `qtest` ## Debugging Facilities diff --git a/traces/trace-01-ops.cmd b/traces/trace-01-ops.cmd index d53c3d6a7..0b7f6adcc 100644 --- a/traces/trace-01-ops.cmd +++ b/traces/trace-01-ops.cmd @@ -1,4 +1,4 @@ -# Test of insert_head and remove_head +# Test of 'q_new', 'q_insert_head', and 'q_remove_head' option fail 0 option malloc 0 new diff --git a/traces/trace-02-ops.cmd b/traces/trace-02-ops.cmd index 5ef39385c..ee403ebfb 100644 --- a/traces/trace-02-ops.cmd +++ b/traces/trace-02-ops.cmd @@ -1,4 +1,4 @@ -# Test of insert_head, insert_tail, remove_head, remove_tail, and delete_mid +# Test of 'q_new', 'q_insert_head', 'q_insert_tail', 'q_remove_head', 'q_remove_tail', and 'q_delete_mid' option fail 0 option malloc 0 new diff --git a/traces/trace-03-ops.cmd b/traces/trace-03-ops.cmd index 86063bc60..4c1f11ae2 100644 --- a/traces/trace-03-ops.cmd +++ b/traces/trace-03-ops.cmd @@ -1,4 +1,4 @@ -# Test of insert_head, insert_tail, remove_head, reverse and merge +# Test of 'q_new', 'q_insert_head', 'q_remove_head', 'q_reverse', 'q_sort', and 'q_merge' option fail 0 option malloc 0 new diff --git a/traces/trace-04-ops.cmd b/traces/trace-04-ops.cmd index 2c89058d4..0f4fbfb3d 100644 --- a/traces/trace-04-ops.cmd +++ b/traces/trace-04-ops.cmd @@ -1,4 +1,4 @@ -# Test of insert_head, insert_tail, size, swap, and sort +# Test of 'q_new', 'q_insert_tail', 'q_insert_head', 'q_remove_head', 'q_size', 'q_swap', and 'q_sort' option fail 0 option malloc 0 new diff --git a/traces/trace-05-ops.cmd b/traces/trace-05-ops.cmd index 63f56ef19..756ffbe83 100644 --- a/traces/trace-05-ops.cmd +++ b/traces/trace-05-ops.cmd @@ -1,4 +1,4 @@ -# Test of insert_head, insert_tail, remove_head, reverse, size, swap, and sort +# Test of 'q_new', 'q_free', 'q_insert_head', 'q_insert_tail', 'q_remove_head', 'q_reverse', 'q_size', 'q_swap', and 'q_sort' option fail 0 option malloc 0 new diff --git a/traces/trace-06-ops.cmd b/traces/trace-06-ops.cmd index d8ba9358d..e7d96157b 100644 --- a/traces/trace-06-ops.cmd +++ b/traces/trace-06-ops.cmd @@ -1,4 +1,4 @@ -# Test of insert_head, insert_tail, delete duplicate, sort, descend and reverseK +# Test of 'q_new', 'q_free', 'q_insert_head', 'q_insert_tail', 'q_remove_head', 'q_delete_dup', 'q_sort', 'q_descend', and 'q_reverseK' new ih RAND 4 it gerbil 3 diff --git a/traces/trace-07-string.cmd b/traces/trace-07-string.cmd index 9e58f300f..f1a862ef4 100644 --- a/traces/trace-07-string.cmd +++ b/traces/trace-07-string.cmd @@ -1,4 +1,4 @@ -# Test of truncated strings +# Test of truncated strings: 'q_new', 'q_free', 'q_insert_head', 'q_insert_tail', 'q_remove_head', 'q_reverse', and 'q_sort' option fail 0 option malloc 0 new diff --git a/traces/trace-08-robust.cmd b/traces/trace-08-robust.cmd index 45853e73c..77f9043cf 100644 --- a/traces/trace-08-robust.cmd +++ b/traces/trace-08-robust.cmd @@ -1,4 +1,4 @@ -# Test operations on empty queue +# Test operations on empty queue: 'q_new', 'q_remove_head', 'q_reverse', 'q_size', and 'q_sort' option fail 10 option malloc 0 new diff --git a/traces/trace-09-robust.cmd b/traces/trace-09-robust.cmd index 49190a7d3..80e7215bc 100644 --- a/traces/trace-09-robust.cmd +++ b/traces/trace-09-robust.cmd @@ -1,4 +1,4 @@ -# Test remove_head with NULL argument +# Test 'q_remove_head' with NULL argument: 'q_new', 'q_insert_head', and 'q_remove_head' option fail 10 option malloc 0 new diff --git a/traces/trace-10-robust.cmd b/traces/trace-10-robust.cmd index b3f346b91..24a95a60e 100644 --- a/traces/trace-10-robust.cmd +++ b/traces/trace-10-robust.cmd @@ -1,4 +1,4 @@ -# Test operations on NULL queue +# Test operations on NULL queue: 'q_free', 'q_insert_head', 'q_insert_tail', 'q_remove_head', 'q_reverse', 'q_size', and 'q_sort' option fail 10 option malloc 0 free diff --git a/traces/trace-11-malloc.cmd b/traces/trace-11-malloc.cmd index f653f20ad..1af3975c9 100644 --- a/traces/trace-11-malloc.cmd +++ b/traces/trace-11-malloc.cmd @@ -1,4 +1,4 @@ -# Test of malloc failure on insert_head +# Test of malloc failure on 'q_insert_head': 'q_new', and 'q_insert_head' option fail 30 option malloc 0 new diff --git a/traces/trace-12-malloc.cmd b/traces/trace-12-malloc.cmd index b6577286c..462e87e01 100644 --- a/traces/trace-12-malloc.cmd +++ b/traces/trace-12-malloc.cmd @@ -1,4 +1,4 @@ -# Test of malloc failure on insert_tail +# Test of malloc failure on 'q_insert_tail': 'q_new', 'q_insert_head', and 'q_insert_tail' option fail 50 option malloc 0 new diff --git a/traces/trace-13-malloc.cmd b/traces/trace-13-malloc.cmd index 093beb27f..641acda18 100644 --- a/traces/trace-13-malloc.cmd +++ b/traces/trace-13-malloc.cmd @@ -1,4 +1,4 @@ -# Test of malloc failure on new +# Test of malloc failure on 'q_new': 'q_new' option fail 10 option malloc 50 new diff --git a/traces/trace-14-perf.cmd b/traces/trace-14-perf.cmd index 85d966a8a..2e8803439 100644 --- a/traces/trace-14-perf.cmd +++ b/traces/trace-14-perf.cmd @@ -1,4 +1,4 @@ -# Test performance of insert_tail, reverse, and sort +# Test performance of 'q_new', 'q_insert_head', 'q_insert_tail', 'q_reverse', and 'q_sort' option fail 0 option malloc 0 new diff --git a/traces/trace-15-perf.cmd b/traces/trace-15-perf.cmd index 88492b32f..8d7d771d4 100644 --- a/traces/trace-15-perf.cmd +++ b/traces/trace-15-perf.cmd @@ -1,4 +1,4 @@ -# Test performance of sort with random and descending orders +# Test performance of 'q_sort' with random and descending orders: 'q_new', 'q_free', 'q_insert_head', 'q_sort', and 'q_reverse' # 10000: all correct sorting algorithms are expected pass # 50000: sorting algorithms with O(n^2) time complexity are expected failed # 100000: sorting algorithms with O(nlogn) time complexity are expected pass diff --git a/traces/trace-16-perf.cmd b/traces/trace-16-perf.cmd index abd926d37..e0fb506dd 100644 --- a/traces/trace-16-perf.cmd +++ b/traces/trace-16-perf.cmd @@ -1,4 +1,4 @@ -# Test performance of insert_tail +# Test performance of 'q_new', 'q_insert_head', 'q_insert_tail', and 'q_reverse' option fail 0 option malloc 0 new diff --git a/traces/trace-17-complexity.cmd b/traces/trace-17-complexity.cmd index 6a68c9241..357e7a3bd 100644 --- a/traces/trace-17-complexity.cmd +++ b/traces/trace-17-complexity.cmd @@ -1,4 +1,4 @@ -# Test if time complexity of q_insert_tail, q_insert_head, q_remove_tail, and q_remove_head is constant +# Test if time complexity of 'q_insert_tail', 'q_insert_head', 'q_remove_tail', and 'q_remove_head' is constant option simulation 1 it ih