Skip to content

AUI_ASSERT_NO_CONDITION#

Always triggers assertion fail.

Header:#include <AUI/Util/Assert.h>
CMake:aui_link(my_target PUBLIC aui::core)

Definition#

#define AUI_ASSERT_NO_CONDITION(what) AUI_IMPL_FAIL(what)

Detailed Description#

Throws AAssertionFailedException. See also: AUI_ASSERT.

switch (i) {
  case 0: // ...
  default:
    AUI_ASSERT_NO_CONDITION("invalid i");
}

Examples#

examples/ui/views/src/ExampleWindow.cpp

Views Example — All-in-one views building example.

                                     ALogger::info("Example") << "Response: " << int(response);
                                     /// [AMessageBox]
                                 }),
                    _new<AButton>("Cause assertion fail")
                        .connect(&AView::clicked, this, [&] { AUI_ASSERT_NO_CONDITION("assertion fail"); }),
                    _new<AButton>("Cause hang")
                        .connect(&AView::clicked, this,
                                 [&] {
                                     for (;;)
                                         ;

Examples#