Skip to content

core/lib/assert: consistify output and cleanup documentation #20701

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2024

Conversation

mguetschow
Copy link
Contributor

Contribution description

This PR

  • makes the output of assert() without DEBUG_ASSERT_VERBOSE consistent with the documentation (adding the prefix) and with the output of assert() with DEBUG_ASSERT_VERBOSE (changing to =>).
  • provides a documentation cleanup of the assert-related functions and macros

Testing procedure

Apply the following diff:

diff --git a/examples/hello-world/Makefile b/examples/hello-world/Makefile
index 258d8e9baf..17ca69df87 100644
--- a/examples/hello-world/Makefile
+++ b/examples/hello-world/Makefile
@@ -7,6 +7,8 @@ BOARD ?= native
 # This has to be the absolute path to the RIOT base directory:
 RIOTBASE ?= $(CURDIR)/../..
 
+# CFLAGS += -DDEBUG_ASSERT_VERBOSE
+
 # Comment this out to disable code in RIOT that does safety checking
 # which is not needed in a production environment but helps in the
 # development process:
diff --git a/examples/hello-world/main.c b/examples/hello-world/main.c
index 213128ac64..e3d79db42d 100644
--- a/examples/hello-world/main.c
+++ b/examples/hello-world/main.c
@@ -21,6 +21,8 @@
 
 #include <stdio.h>
 
+#include "assert.h"
+
 int main(void)
 {
     puts("Hello World!");
@@ -28,5 +30,7 @@ int main(void)
     printf("You are running RIOT on a(n) %s board.\n", RIOT_BOARD);
     printf("This board features a(n) %s CPU.\n", RIOT_CPU);
 
+    assert(0);
+
     return 0;
 }

and play around with DEBUG_ASSERT_VERBOSE on different platforms.

Also proof-read the generated documentation.

Issues/PRs references

@mguetschow mguetschow requested a review from kaspar030 as a code owner May 27, 2024 15:18
@mguetschow mguetschow added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label May 27, 2024
@github-actions github-actions bot added Area: core Area: RIOT kernel. Handle PRs marked with this with care! and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels May 27, 2024
@mguetschow mguetschow added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label May 27, 2024
@riot-ci
Copy link

riot-ci commented May 27, 2024

Murdock results

✔️ PASSED

d5d5e9f core/lib/assert: consistify output and cleanup documentation

Success Failures Total Runtime
10143 0 10143 18m:36s

Artifacts

@benpicco benpicco added this pull request to the merge queue May 27, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks May 28, 2024
@benpicco benpicco added this pull request to the merge queue May 28, 2024
Merged via the queue into RIOT-OS:master with commit 0b7cd0e May 28, 2024
@mguetschow mguetschow deleted the core-assert-cleanup branch May 28, 2024 11:58
@mguetschow mguetschow added this to the Release 2024.07 milestone Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: core Area: RIOT kernel. Handle PRs marked with this with care! CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants