---
name: "ASSERT"
section: "3alleg"
platform: "linux"
package: "liballegro-doc"
version: "2:4.2.2-2.2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/ASSERT"
---

# ASSERT(3alleg)

Debugging helper macro to assert. Allegro game programming library.

## NAME

ASSERT - Debugging helper macro to assert. Allegro game programming library.

## SYNOPSIS

**#include \<allegro.h\>**

**void ASSERT(condition);**

## DESCRIPTION

Debugging helper macro. Normally compiles away to nothing, but if you  defined the preprocessor symbol DEBUGMODE before including Allegro headers, it will check the supplied condition and call al\_assert() if it fails, whose default action is to stop the program and report the assert. You can use this macro even when Allegro has not been initialised. Example:

```
   #define DEBUGMODE
   #include
   ...
   void my_blitter(BITMAP *source, int flags)
   {
      int some_variables;
      ASSERT(source != NULL);
      ASSERT(flags & GAME_RUNNING);
      ...
   }
```

## SEE ALSO

[**al\_assert**(3alleg)](/al_assert/3alleg.md), [**TRACE**(3alleg)](/TRACE/3alleg.md), [**register\_assert\_handler**(3alleg)](/register_assert_handler/3alleg.md), [**expackf**(3alleg)](/expackf/3alleg.md)
