diff --git a/Tests/LibC/CMakeLists.txt b/Tests/LibC/CMakeLists.txt index 312188b896..ba28c56ba5 100644 --- a/Tests/LibC/CMakeLists.txt +++ b/Tests/LibC/CMakeLists.txt @@ -1,5 +1,6 @@ set(TEST_SOURCES TestAbort.cpp + TestAssert.cpp TestIo.cpp TestLibCExec.cpp TestLibCDirEnt.cpp diff --git a/Tests/LibC/TestAssert.cpp b/Tests/LibC/TestAssert.cpp new file mode 100644 index 0000000000..296485d3b9 --- /dev/null +++ b/Tests/LibC/TestAssert.cpp @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2021, the SerenityOS developers. + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include + +#include + +TEST_CASE(assert) +{ + EXPECT_CRASH("This should assert", [] { + assert(!"This should assert"); + return Test::Crash::Failure::DidNotCrash; + }); +}