summaryrefslogtreecommitdiff
path: root/AK
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-05-30 10:37:36 +0200
committerAndreas Kling <kling@serenityos.org>2020-05-30 11:31:49 +0200
commit1ef5d609d93619a22aad4baebf3c23e2a96affea (patch)
tree9f8748305d123787d7959e3b38c9c89e6e007fcd /AK
parentcfbd95f42a01d7fea2a5c83ebcaa107f34f6e4ef (diff)
downloadserenity-1ef5d609d93619a22aad4baebf3c23e2a96affea.zip
AK+LibC: Add TODO() as an alternative to ASSERT_NOT_REACHED()
I've been using this in the new HTML parser and it makes it much easier to understand the state of unfinished code branches. TODO() is for places where it's okay to end up but we need to implement something there. ASSERT_NOT_REACHED() is for places where it's not okay to end up, and something has gone wrong.
Diffstat (limited to 'AK')
-rw-r--r--AK/Assertions.h1
-rw-r--r--AK/TestSuite.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/AK/Assertions.h b/AK/Assertions.h
index 02dd366bd8..976e36e60c 100644
--- a/AK/Assertions.h
+++ b/AK/Assertions.h
@@ -36,6 +36,7 @@
# define ASSERT assert
# define ASSERT_NOT_REACHED() assert(false)
# define RELEASE_ASSERT assert
+# define TODO ASSERT_NOT_REACHED
# endif
# endif
diff --git a/AK/TestSuite.h b/AK/TestSuite.h
index ec68f780de..b792edc1a4 100644
--- a/AK/TestSuite.h
+++ b/AK/TestSuite.h
@@ -37,6 +37,7 @@
#define ASSERT_NOT_REACHED() fprintf(stderr, "\033[31;1mASSERT_NOT_REACHED\033[0m\n");
#define RELEASE_ASSERT ASSERT
+#define TODO ASSERT_NOT_REACHED
#include <AK/Function.h>
#include <AK/NonnullRefPtrVector.h>