diff mbox

[7/7] lib: Make igt_skip noreturn

Message ID 1392160051-10998-7-git-send-email-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show

Commit Message

Daniel Vetter Feb. 11, 2014, 11:07 p.m. UTC
This is a remnant from the subtest code before we had proper
fixture blocks. With those there's no no reason to have igt_skip
calls outside of fixtures or subtests, so we can assert this and
hence always jump out.

Suggested by Thomas Wood since static analyzers got confused about
this.

To check for fallout I've run all tests as non-root so that they'll
all skip. Only very little fallout resulted.

Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 lib/drmtest.c | 4 ++--
 lib/drmtest.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/lib/drmtest.c b/lib/drmtest.c
index f6e6ccbee84a..46227c35cc8f 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -1027,8 +1027,8 @@  void igt_skip(const char *f, ...)
 		exit_subtest("SKIP");
 	} else if (test_with_subtests) {
 		skip_subtests_henceforth = SKIP;
-		if (in_fixture)
-			__igt_fixture_end();
+		assert(in_fixture);
+		__igt_fixture_end();
 	} else {
 		exit(77);
 	}
diff --git a/lib/drmtest.h b/lib/drmtest.h
index 8dd9f7906fd6..c03983295393 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -172,11 +172,11 @@  const char *igt_subtest_name(void);
  *
  * For normal tests without subtest it will directly exit.
  */
-__attribute__((format(printf, 1, 2))) void igt_skip(const char *f, ...);
+__attribute__((format(printf, 1, 2))) void igt_skip(const char *f, ...) __attribute__((noreturn));
 __attribute__((format(printf, 5, 6)))
 void __igt_skip_check(const char *file, const int line,
 		      const char *func, const char *check,
-		      const char *format, ...);
+		      const char *format, ...) __attribute__((noreturn));
 /**
  * igt_success - complete a (subtest) as successfull
  *