xContract - Contract Enforcement for C and C++ STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ... Synesis Software

examples/c/example.c.unexpected_condition/example.c.unexpected_condition.c

Demonstrates use of the XCONTRACT_ENFORCE_UNEXPECTED_CONDITION() enforcement macro.

#include <xcontract/xcontract.h>

int function(int argc, char** argv)
(
    if(0 == argc)
    {
        XCONTRACT_ENFORCE_UNEXPECTED_CONDITION("this should never happen");
    }

    return 0;
)

xContract Library documentation © Matthew Wilson and Synesis Software Pty Ltd, 2001-2008 SourceForge.net Logo