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:
parent
181f759dc9
commit
0ec35d6d81
2 changed files with 18 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
set(TEST_SOURCES
|
||||
TestAbort.cpp
|
||||
TestAssert.cpp
|
||||
TestIo.cpp
|
||||
TestLibCExec.cpp
|
||||
TestLibCDirEnt.cpp
|
||||
|
|
17
Tests/LibC/TestAssert.cpp
Normal file
17
Tests/LibC/TestAssert.cpp
Normal 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;
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue