Skip to content

tests: Replace deprecated fail_unless calls#123

Open
neuschaefer wants to merge 1 commit into
sigrokproject:masterfrom
neuschaefer:check
Open

tests: Replace deprecated fail_unless calls#123
neuschaefer wants to merge 1 commit into
sigrokproject:masterfrom
neuschaefer:check

Conversation

@neuschaefer

@neuschaefer neuschaefer commented May 15, 2025

Copy link
Copy Markdown

A new API (ck_assert) to replace fail_* was introduced in check 0.9.6 (released in 2008), and fail_* has been deprecated since at least 0.9.10 (released in 2013).

This patch was automated with coccinelle:

spatch --sp-file patch.coc --in-place tests/*.c

A new API (ck_assert) to replace fail_* was introduced in check
0.9.6 (released in 2008), and fail_* has been deprecated since at least
0.9.10 (released in 2013).

This patch was automated with coccinelle:

  spatch --sp-file patch.coc --in-place tests/*.c

@@
expression msg;
@@
 <...
- fail(msg);
+ ck_abort_msg(msg);
  ...>

@@
expression msg, arg1;
@@
 <...
- fail(msg, arg1);
+ ck_abort_msg(msg, arg1);
  ...>

@@
expression msg, arg1, arg2;
@@
 <...
- fail(msg, arg1, arg2);
+ ck_abort_msg(msg, arg1, arg2);
  ...>

@@
expression expr;
@@

  <...
- fail_unless(expr);
+ ck_assert(expr);
  ...>

@@
expression expr, msg;
@@

  <...
- fail_unless(expr, msg);
+ ck_assert_msg(expr, msg);
  ...>

@@
expression expr, msg, arg1;
@@

  <...
- fail_unless(expr, msg, arg1);
+ ck_assert_msg(expr, msg, arg1);
  ...>

@@
expression expr, msg, arg1, arg2;
@@

  <...
- fail_unless(expr, msg, arg1, arg2);
+ ck_assert_msg(expr, msg, arg1, arg2);
  ...>

@@
expression expr, msg, arg1, arg2, arg3;
@@

  <...
- fail_unless(expr, msg, arg1, arg2, arg3);
+ ck_assert_msg(expr, msg, arg1, arg2, arg3);
  ...>

@@
expression expr, msg, arg1, arg2, arg3, arg4;
@@

  <...
- fail_unless(expr, msg, arg1, arg2, arg3, arg4);
+ ck_assert_msg(expr, msg, arg1, arg2, arg3, arg4);
  ...>

@@
expression expr, msg, arg1, arg2, arg3, arg4, arg5;
@@

  <...
- fail_unless(expr, msg, arg1, arg2, arg3, arg4, arg5);
+ ck_assert_msg(expr, msg, arg1, arg2, arg3, arg4, arg5);
  ...>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant