serenity/AK/Assertions.h
Andreas Kling 6560116b67 TestSuite: Hijack the ASSERT macros during unit tests.
Instead of aborting the program when we hit an assertion, just print a
message and keep going.

This allows us to write tests that provoke assertions on purpose.
2019-08-02 09:23:03 +02:00

25 lines
383 B
C++

#pragma once
#ifndef AK_TEST_SUITE
#ifdef KERNEL
# include <Kernel/Assertions.h>
#else
# include <assert.h>
# ifndef __serenity__
# define ASSERT assert
# define ASSERT_NOT_REACHED() assert(false)
# define RELEASE_ASSERT assert
# endif
#endif
#endif
namespace AK {
inline void not_implemented() { ASSERT(false); }
}
using AK::not_implemented;