Skip to content

Commit

Permalink
Updated documentation on asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
Snaipe committed Sep 14, 2015
1 parent 8986414 commit 5e275da
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions doc/assert.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,51 @@ cr_assert_arr_gt_cmp(Actual, Reference, Size, Cmp, [Message, [Args...]]) ``Ac
cr_assert_arr_geq_cmp(Actual, Reference, Size, Cmp, [Message, [Args...]]) ``Actual`` is comparatively greater or equal to ``Reference`` Only available in C++ and GNU C99
=========================================================================== =========================================================================== ===========================================

Exception Assertions
--------------------

The following assertion macros are only defined for C++.

=========================================================================== =========================================================================== ===========================================
Macro Passes if and only if Notes
=========================================================================== =========================================================================== ===========================================
cr_assert_throw(Statement, Exception, [Message, [Args...]]) ``Statement`` throws an instance of ``Exception``.
--------------------------------------------------------------------------- --------------------------------------------------------------------------- -------------------------------------------
cr_assert_no_throw(Statement, Exception, [Message, [Args...]]) ``Statement`` does not throws an instance of ``Exception``.
--------------------------------------------------------------------------- --------------------------------------------------------------------------- -------------------------------------------
cr_assert_any_throw(Statement, [Message, [Args...]]) ``Statement`` throws any kind of exception.
--------------------------------------------------------------------------- --------------------------------------------------------------------------- -------------------------------------------
cr_assert_none_throw(Statement, [Message, [Args...]]) ``Statement`` does not throw any exception.
=========================================================================== =========================================================================== ===========================================

File Assertions
---------------

=============================================================================== ============================================================================ ===========================================
Macro Passes if and only if Notes
=============================================================================== ============================================================================ ===========================================
cr_assert_file_contents_eq_str(File, ExpectedContents, [Message, [Args...]]) The contents of ``File`` are equal to the string ``ExpectedContents``.
------------------------------------------------------------------------------- ---------------------------------------------------------------------------- -------------------------------------------
cr_assert_file_contents_neq_str(File, ExpectedContents, [Message, [Args...]]) The contents of ``File`` are not equal to the string ``ExpectedContents``.
------------------------------------------------------------------------------- ---------------------------------------------------------------------------- -------------------------------------------
cr_assert_stdout_eq_str(ExpectedContents, [Message, [Args...]]) The contents of ``stdout`` are equal to the string ``ExpectedContents``.
------------------------------------------------------------------------------- ---------------------------------------------------------------------------- -------------------------------------------
cr_assert_stdout_neq_str(ExpectedContents, [Message, [Args...]]) The contents of ``stdout`` are not equal to the string ``ExpectedContents``.
------------------------------------------------------------------------------- ---------------------------------------------------------------------------- -------------------------------------------
cr_assert_stderr_eq_str(ExpectedContents, [Message, [Args...]]) The contents of ``stderr`` are equal to the string ``ExpectedContents``.
------------------------------------------------------------------------------- ---------------------------------------------------------------------------- -------------------------------------------
cr_assert_stderr_neq_str(ExpectedContents, [Message, [Args...]]) The contents of ``stderr`` are not equal to the string ``ExpectedContents``.
------------------------------------------------------------------------------- ---------------------------------------------------------------------------- -------------------------------------------
cr_assert_file_contents_eq(File, RefFile, [Message, [Args...]]) The contents of ``File`` are equal to the contents of ``RefFile``.
------------------------------------------------------------------------------- ---------------------------------------------------------------------------- -------------------------------------------
cr_assert_file_contents_neq(File, RefFile, [Message, [Args...]]) The contents of ``File`` are not equal to the contents of ``RefFile``.
------------------------------------------------------------------------------- ---------------------------------------------------------------------------- -------------------------------------------
cr_assert_stdout_eq(RefFile, [Message, [Args...]]) The contents of ``stdout`` are equal to the contents of ``RefFile``.
------------------------------------------------------------------------------- ---------------------------------------------------------------------------- -------------------------------------------
cr_assert_stdout_neq(RefFile, [Message, [Args...]]) The contents of ``stdout`` are not equal to the contents of ``RefFile``.
------------------------------------------------------------------------------- ---------------------------------------------------------------------------- -------------------------------------------
cr_assert_stderr_eq(RefFile, [Message, [Args...]]) The contents of ``stderr`` are equal to the contents of ``RefFile``.
------------------------------------------------------------------------------- ---------------------------------------------------------------------------- -------------------------------------------
cr_assert_stderr_neq(RefFile, [Message, [Args...]]) The contents of ``stderr`` are not equal to the contents of ``RefFile``.
=============================================================================== ============================================================================ ===========================================

0 comments on commit 5e275da

Please sign in to comment.