Skip to the task
Layout
Back to classic view

You are looking ahead. Your place is still task 1: About.

RUNTask 15 of 17 · step 4: Task 1: a row of numbersRun the practice-test tests
Run the practice-test tests in practice/01/

In CLion pick All CTest and ▶, or run only the practice-test tests in the terminal.

Checklist

  • Every task is one commit with a clear message.
  • Zero compiler warnings: the code builds with -Werror.
  • Once per topic you step through your code in the debugger (CLion, gdb).
  • Every function has preconditions and postconditions, and assert tests check them.
Details & hint
$ ctest --preset debug -L test1
    Start 75: test1_numbers_1
1/6 Test #75: test1_numbers_1 ..................***Failed    0.07 sec

=== test1_numbers_1: FAILED ===
The output differs on line 1.
  expected: |How many numbers? 6|
  got:      (the output ended)
  (\t = tab, ~ = a space at the end of the line)

You should see: While numbers.c is empty, the test1_numbers tests say "the output ended". When all is well, the three test1_numbers tests pass.

Stuck? The test shows a space at the end of a line as ~. Check a negative even number with % 2 == 0.

practice 01 CMakeLists.txt Code Diff
UNCHANGED This step does not change this file.
add_executable(p01_hello main.c)
opened for this task
$ ctest --preset debug -L test1
    Start 75: test1_numbers_1
1/6 Test #75: test1_numbers_1 ..................***Failed    0.07 sec

=== test1_numbers_1: FAILED ===
The output differs on line 1.
  expected: |How many numbers? 6|
  got:      (the output ended)
  (\t = tab, ~ = a space at the end of the line)