Skip to the task
Layout
Back to classic view

You are looking at: Practice test 1. Your place is still lesson 5, task 1: Functions.

RUNTask 15 of 17 · step 4: Task 1: a row of numbers

Run the practice-test tests

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.
$ 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.

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)