aboutsummaryrefslogtreecommitdiffstats
path: root/doc/html/assert_8h.html
blob: fd253543143d616fe07066cbd010d51c07c73665 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<!-- HTML header for doxygen 1.8.3.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>Templates -- Meow: /home/cathook/Projects/template_meow/meowpp/debug/assert.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
<link href="custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">Templates -- Meow
   &#160;<span id="projectnumber">2.0.-1</span>
   </div>
   <div id="projectbrief">A C++ template contains kinds of interesting classes and functions</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('assert_8h.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#namespaces">Namespaces</a> &#124;
<a href="#define-members">Macros</a>  </div>
  <div class="headertitle">
<div class="title">assert.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Contains assert macro for meowpp's debugging tools.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;cstdio&gt;</code><br/>
<code>#include &lt;cstdlib&gt;</code><br/>
</div>
<p><a href="assert_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:namespacemeow"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemeow.html">meow</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a169313358c98b52a4d5dab2eea8433a7"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="assert_8h.html#a169313358c98b52a4d5dab2eea8433a7">MEOWPP_STRINGIFY</a>(x)&#160;&#160;&#160;#x</td></tr>
<tr class="separator:a169313358c98b52a4d5dab2eea8433a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab7387cb8c60705c6118316fc182340cd"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="assert_8h.html#ab7387cb8c60705c6118316fc182340cd">MEOWPP_TOSTRING</a>(x)&#160;&#160;&#160;<a class="el" href="assert_8h.html#a169313358c98b52a4d5dab2eea8433a7">MEOWPP_STRINGIFY</a>(x)</td></tr>
<tr class="separator:ab7387cb8c60705c6118316fc182340cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6e509ba096551a0924ec024afadba810"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="assert_8h.html#a6e509ba096551a0924ec024afadba810">Assert</a>(expr,...)</td></tr>
<tr class="memdesc:a6e509ba096551a0924ec024afadba810"><td class="mdescLeft">&#160;</td><td class="mdescRight">A macro for assert whether a expression is failed or not.  <a href="#a6e509ba096551a0924ec024afadba810">More...</a><br/></td></tr>
<tr class="separator:a6e509ba096551a0924ec024afadba810"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Contains assert macro for meowpp's debugging tools. </p>
<p>You can use </p>
<div class="fragment"><div class="line"><span class="preprocessor">#define MEOWPP_NODEBUG</span></div>
</div><!-- fragment --><p> to remove all the debugging code.</p>
<dl class="section author"><dt>Author</dt><dd>cathook </dd></dl>

<p>Definition in file <a class="el" href="assert_8h_source.html">assert.h</a>.</p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="a6e509ba096551a0924ec024afadba810"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define Assert</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">expr, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>...</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">while</span> (((expr) || \</div>
<div class="line">          (fprintf(stderr, <span class="stringliteral">&quot;Assertion error at &quot;</span> \</div>
<div class="line">                   __FILE__ <span class="stringliteral">&quot;:&quot;</span> <a class="code" href="assert_8h.html#ab7387cb8c60705c6118316fc182340cd">MEOWPP_TOSTRING</a>(__LINE__) \</div>
<div class="line">                   <span class="stringliteral">&quot; &gt;&gt;&gt;&quot;</span> __VA_ARGS__), \</div>
<div class="line">           abort(), <span class="keyword">false</span>)) &amp;&amp; <span class="keyword">false</span>)</div>
<div class="ttc" id="assert_8h_html_ab7387cb8c60705c6118316fc182340cd"><div class="ttname"><a href="assert_8h.html#ab7387cb8c60705c6118316fc182340cd">MEOWPP_TOSTRING</a></div><div class="ttdeci">#define MEOWPP_TOSTRING(x)</div><div class="ttdef"><b>Definition:</b> <a href="assert_8h_source.html#l00045">assert.h:45</a></div></div>
</div><!-- fragment -->
<p>A macro for assert whether a expression is failed or not. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">expr</td><td>The expression to be tested. </td></tr>
    <tr><td class="paramname">...</td><td>Error information to be printed to stderr when the expr is failed.</td></tr>
  </table>
  </dd>
</dl>
<p>When expression is failed, it will call <code>fprintf(stderr, ...)</code> to print out the message follows by calling <code>abort()</code> to halt the program.</p>
<dl class="section note"><dt>Note</dt><dd>You can use <div class="fragment"><div class="line"><span class="preprocessor">#define MEOWPP_TESTING</span></div>
</div><!-- fragment --> to tell this macro calls <code>test::abort()</code> instead of normal <code>abort()</code> function. </dd></dl>

<p>Definition at line <a class="el" href="assert_8h_source.html#l00049">49</a> of file <a class="el" href="assert_8h_source.html">assert.h</a>.</p>

</div>
</div>
<a class="anchor" id="a169313358c98b52a4d5dab2eea8433a7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MEOWPP_STRINGIFY</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">x</td><td>)</td>
          <td>&#160;&#160;&#160;#x</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="assert_8h_source.html#l00044">44</a> of file <a class="el" href="assert_8h_source.html">assert.h</a>.</p>

</div>
</div>
<a class="anchor" id="ab7387cb8c60705c6118316fc182340cd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MEOWPP_TOSTRING</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">x</td><td>)</td>
          <td>&#160;&#160;&#160;<a class="el" href="assert_8h.html#a169313358c98b52a4d5dab2eea8433a7">MEOWPP_STRINGIFY</a>(x)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="assert_8h_source.html#l00045">45</a> of file <a class="el" href="assert_8h_source.html">assert.h</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.3.1-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_92fecd8d02dd5e7a67429447fdf0f60f.html">meowpp</a></li><li class="navelem"><a class="el" href="dir_33ab824d5df7449c06d9279d1a3e3363.html">debug</a></li><li class="navelem"><a class="el" href="assert_8h.html">assert.h</a></li>
    <li class="footer">Generated on Mon Sep 29 2014 16:55:35 for Templates -- Meow by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
  </ul>
</div>
</body>
</html>