Skip to content

Latest commit

 

History

History
20 lines (13 loc) · 556 Bytes

File metadata and controls

20 lines (13 loc) · 556 Bytes

assert_true

Asserts that a boolean value is true.

Use assert_true when the value under test is already a boolean result. Prefer a more specific assertion when the actual intent is equality, ordering, nullness, containment, matching, or exception behavior.

#include <kaycxx/assert.hpp>

using namespace kaycxx::assert;

int main() {
    auto connected = true;

    assert_true(connected);
    assert_true(connected, "The connection must be established before sending data");
}

On failure, assert_true(false) throws assertion_error.