tests: tap: remove semicolons in pass / fail definitions
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 20 Aug 2021 19:36:50 +0000 (15:36 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 24 Aug 2021 20:56:20 +0000 (16:56 -0400)
commit4f002736e957daab4ae95c01613950aa415ab005
tree799d33910d715812e60e22c08e22fc24e0204879
parentd0004d4bfc7d0f7e411b905b83da56d336768238
tests: tap: remove semicolons in pass / fail definitions

I wanted to write something like this in a test:

    if (cond)
      fail("message 1");
    else
      fail("message 2");

And was met with

      CC       test_action.o
    /home/simark/src/lttng-tools/tests/unit/test_action.c: In function ‘main’:
    /home/simark/src/lttng-tools/tests/unit/test_action.c:544:9: error: ‘else’ without a previous ‘if’
      544 |         else
          |         ^~~~

I then remembered that it was in our coding style to use braces:

    if (cond) {
      fail("message 1");
    } else {
      fail("message 2");
    }

... which avoids the error.  But still, the former form should work.
Fix this by removing the semi-colons in the pass and fail definitions, I
don't think they belong there.  Doing so finds a spot in ini_config.c
where a semi-colon is missing, add it.

Change-Id: I6ff09d496a0b12f34baa6f993cffc69eef611df0
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/unit/ini_config/ini_config.c
tests/utils/tap/tap.h
This page took 0.025496 seconds and 4 git commands to generate.