<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="cutter-Assertions-with-C++-support">
<refmeta>
<refentrytitle role="top_of_page" id="cutter-Assertions-with-C++-support.top_of_page">C++サポート付きの検証</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>Cutterライブラリ</refmiscinfo>
</refmeta>
<refnamediv>
<refname>C++サポート付きの検証</refname>
<refpurpose>C++サポート付きであなたのプログラムが期待通りに動作しているかを検証します。</refpurpose>
</refnamediv>

<refsect1 id="cutter-Assertions-with-C++-support.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_return" colwidth="150px"/>
<colspec colname="functions_name"/>
<tbody>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="cppcut-assert-equal">cppcut_assert_equal</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="cppcut-assert-not-equal">cppcut_assert_not_equal</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="cppcut-assert-null">cppcut_assert_null</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="cppcut-assert-not-null">cppcut_assert_not_null</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="cppcut-assert-operator">cppcut_assert_operator</link><phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>


<refsect1 id="cutter-Assertions-with-C++-support.description" role="desc">
<title role="desc.title">説明</title>

</refsect1>
<refsect1 id="cutter-Assertions-with-C++-support.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="cppcut-assert-equal" role="macro" condition="since:1.0.9">
<title>cppcut_assert_equal()</title>
<indexterm zone="cppcut-assert-equal" role="1.0.9"><primary>cppcut_assert_equal</primary></indexterm>
<programlisting language="C">#define             cppcut_assert_equal(expected, actual, ...)</programlisting>
<para>This assertion is a generic method based on template. You
can pass any object's reference as <parameter>expected</parameter>
 and <parameter>actual</parameter>
.</para>
<para>Passes if <parameter>expected</parameter>
 == <parameter>actual</parameter>
.</para>
<para>例:</para>
<informalexample><programlisting><![CDATA[
cppcut_assert_equal(3, 1 + 2);
cppcut_assert_equal(3, 1 + 2, cppcut_message("easy expression"));
cppcut_assert_equal(3, 1 + 2, cppcut_message() << "easy expression"));
]]></programlisting></informalexample>
<para/>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>expected</para></entry>
<entry role="parameter_description"><para>期待値。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>actual</para></entry>
<entry role="parameter_description"><para>実測値。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>追加メッセージ（省略可能）。詳細は<link linkend="cppcut-message"><function>cppcut_message()</function></link>を見てください。</para></entry>
<entry role="parameter_annotations"/></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-1.0.9">1.0.9</link></para></refsect2>
<refsect2 id="cppcut-assert-not-equal" role="macro" condition="since:1.2.0">
<title>cppcut_assert_not_equal()</title>
<indexterm zone="cppcut-assert-not-equal" role="1.2.0"><primary>cppcut_assert_not_equal</primary></indexterm>
<programlisting language="C">#define             cppcut_assert_not_equal(expected, actual, ...)</programlisting>
<para>This assertion is a generic method based on template. You
can pass any object's reference as <parameter>expected</parameter>
 and <parameter>actual</parameter>
.</para>
<para>Passes if <parameter>expected</parameter>
 != <parameter>actual</parameter>
.</para>
<para>例:</para>
<informalexample><programlisting><![CDATA[
cppcut_assert_not_equal(3, 3 + 1);
cppcut_assert_not_equal(3, 3 + 1, cppcut_message("easy expression"));
cppcut_assert_not_equal(3, 3 + 1, cppcut_message() << "easy expression"));
]]></programlisting></informalexample>
<para/>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>expected</para></entry>
<entry role="parameter_description"><para>期待値。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>actual</para></entry>
<entry role="parameter_description"><para>実測値。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>追加メッセージ（省略可能）。詳細は<link linkend="cppcut-message"><function>cppcut_message()</function></link>を見てください。</para></entry>
<entry role="parameter_annotations"/></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-1.2.0">1.2.0</link></para></refsect2>
<refsect2 id="cppcut-assert-null" role="macro" condition="since:1.2.0">
<title>cppcut_assert_null()</title>
<indexterm zone="cppcut-assert-null" role="1.2.0"><primary>cppcut_assert_null</primary></indexterm>
<programlisting language="C">#define             cppcut_assert_null(object, ...)</programlisting>
<para>This assertion is a generic method based on template. You
can pass any object's pointer as <parameter>object</parameter>
.</para>
<para><parameter>object</parameter>が<link linkend="NULL:CAPS"><literal>NULL</literal></link>のときパスします。</para>
<para>例:</para>
<informalexample><programlisting><![CDATA[
std::string message("hello");
std::string *not_null_string = &message;
std::string *null_string = NULL;
cppcut_assert_null(not_null_string); // fail
cppcut_assert_null(null_string);     // pass
]]></programlisting></informalexample>
<para/>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>object</para></entry>
<entry role="parameter_description"><para>チェックするオブジェクト。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>追加メッセージ（省略可能）。詳細は<link linkend="cppcut-message"><function>cppcut_message()</function></link>を見てください。</para></entry>
<entry role="parameter_annotations"/></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-1.2.0">1.2.0</link></para></refsect2>
<refsect2 id="cppcut-assert-not-null" role="macro" condition="since:1.2.0">
<title>cppcut_assert_not_null()</title>
<indexterm zone="cppcut-assert-not-null" role="1.2.0"><primary>cppcut_assert_not_null</primary></indexterm>
<programlisting language="C">#define             cppcut_assert_not_null(object, ...)</programlisting>
<para>This assertion is a generic method based on template. You
can pass any object's pointer as <parameter>object</parameter>
.</para>
<para><parameter>object</parameter>が<link linkend="NULL:CAPS"><literal>NULL</literal></link>以外のときパスします。</para>
<para>例:</para>
<informalexample><programlisting><![CDATA[
std::string message("hello");
std::string *not_null_string = &message;
std::string *null_string = NULL;
cppcut_assert_not_null(not_null_string); // pass
cppcut_assert_not_null(null_string);     // fail
]]></programlisting></informalexample>
<para/>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>object</para></entry>
<entry role="parameter_description"><para>チェックするオブジェクト。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>追加メッセージ（省略可能）。詳細は<link linkend="cppcut-message"><function>cppcut_message()</function></link>を見てください。</para></entry>
<entry role="parameter_annotations"/></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-1.2.0">1.2.0</link></para></refsect2>
<refsect2 id="cppcut-assert-operator" role="macro" condition="since:1.2.0">
<title>cppcut_assert_operator()</title>
<indexterm zone="cppcut-assert-operator" role="1.2.0"><primary>cppcut_assert_operator</primary></indexterm>
<programlisting language="C">#define             cppcut_assert_operator(lhs, operator, rhs, ...)</programlisting>
<para>This assertion is a generic method based on template. You
can pass any object as <parameter>lhs</parameter>
 and <parameter>rhs</parameter>
.</para>
<para>Passes if (<parameter>lhs</parameter>
 <parameter>operator</parameter>
 <parameter>rhs</parameter>
) is TRUE.</para>
<para>例:</para>
<informalexample><programlisting><![CDATA[
cppcut_assert_operator(1, <, 2); // pass
cppcut_assert_operator(1, >, 2); // fail
]]></programlisting></informalexample>
<para/>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>lhs</para></entry>
<entry role="parameter_description"><para>左辺値。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>operator</para></entry>
<entry role="parameter_description"><para>二項演算子。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>rhs</para></entry>
<entry role="parameter_description"><para>右辺値。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>追加メッセージ（省略可能）。詳細は<link linkend="cppcut-message"><function>cppcut_message()</function></link>を見てください。</para></entry>
<entry role="parameter_annotations"/></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-1.2.0">1.2.0</link></para></refsect2>

</refsect1>
<refsect1 id="cutter-Assertions-with-C++-support.other_details" role="details">
<title role="details.title">Types and Values</title>

</refsect1>

</refentry>
