tests: Replace deprecated fail_unless calls#123
Open
neuschaefer wants to merge 1 commit intosigrokproject:masterfrom
Open
tests: Replace deprecated fail_unless calls#123neuschaefer wants to merge 1 commit intosigrokproject:masterfrom
neuschaefer wants to merge 1 commit intosigrokproject:masterfrom
Conversation
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); ...>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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