1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:07:36 +00:00

Tests: Add test for assert

This commit is contained in:
Michel Hermier 2021-12-15 00:37:40 +01:00 committed by Brian Gianforcaro
parent 181f759dc9
commit 0ec35d6d81
2 changed files with 18 additions and 0 deletions

View file

@ -1,5 +1,6 @@
set(TEST_SOURCES set(TEST_SOURCES
TestAbort.cpp TestAbort.cpp
TestAssert.cpp
TestIo.cpp TestIo.cpp
TestLibCExec.cpp TestLibCExec.cpp
TestLibCDirEnt.cpp TestLibCDirEnt.cpp

17
Tests/LibC/TestAssert.cpp Normal file
View file

@ -0,0 +1,17 @@
/*
* Copyright (c) 2021, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibTest/TestCase.h>
#include <assert.h>
TEST_CASE(assert)
{
EXPECT_CRASH("This should assert", [] {
assert(!"This should assert");
return Test::Crash::Failure::DidNotCrash;
});
}