<?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-Assertion-Utilities-for-GValue">
<refmeta>
<refentrytitle role="top_of_page" id="cutter-Assertion-Utilities-for-GValue.top_of_page">Assertion Utilities for GValue</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>
  CUTTER Library
</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Assertion Utilities for GValue</refname>
<refpurpose>Utilities to write assertions related
to <link linkend="GValue"><type>GValue</type></link> more easily.</refpurpose>
</refnamediv>

<refsynopsisdiv id="cutter-Assertion-Utilities-for-GValue.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="gcut-value-equal">gcut_value_equal</link>                    (<parameter>const <link linkend="GValue"><type>GValue</type></link> *value1</parameter>,
                                                         <parameter>const <link linkend="GValue"><type>GValue</type></link> *value2</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="gcut-value-register-equal-func">gcut_value_register_equal_func</link>      (<parameter><link linkend="GType"><type>GType</type></link> type1</parameter>,
                                                         <parameter><link linkend="GType"><type>GType</type></link> type2</parameter>,
                                                         <parameter><link linkend="GEqualFunc"><type>GEqualFunc</type></link> equal_func</parameter>);
</synopsis>
</refsynopsisdiv>

<refsect1 id="cutter-Assertion-Utilities-for-GValue.description" role="desc">
<title role="desc.title">Description</title>
<para>
To write assertions, you need to check equality and show
expected and actual values.
</para>
<para>
The utilities help you to write assertions that are
related to <link linkend="GValue"><type>GValue</type></link>.
</para>
</refsect1>
<refsect1 id="cutter-Assertion-Utilities-for-GValue.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="gcut-value-equal" role="function" condition="since:1.0.5">
<title>gcut_value_equal ()</title>
<indexterm zone="gcut-value-equal" role="1.0.5"><primary>gcut_value_equal</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            gcut_value_equal                    (<parameter>const <link linkend="GValue"><type>GValue</type></link> *value1</parameter>,
                                                         <parameter>const <link linkend="GValue"><type>GValue</type></link> *value2</parameter>);</programlisting>
<para>
Compares two <link linkend="GValue"><type>GValue</type></link>, <parameter>value1</parameter> and <parameter>value2</parameter> by registered
equal function. (See <link linkend="gcut-value-register-equal-func"><function>gcut_value_register_equal_func()</function></link> for
detail of how to register equal function of <link linkend="GValue"><type>GValue</type></link>)
</para><variablelist role="params">
<varlistentry><term><parameter>value1</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GValue"><type>GValue</type></link> to be compared.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value2</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GValue"><type>GValue</type></link> to be compared.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> TRUE if <parameter>value1</parameter> equals to <parameter>value2</parameter>, FALSE
otherwise.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.5</para></refsect2>
<refsect2 id="gcut-value-register-equal-func" role="function" condition="since:1.0.5">
<title>gcut_value_register_equal_func ()</title>
<indexterm zone="gcut-value-register-equal-func" role="1.0.5"><primary>gcut_value_register_equal_func</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                gcut_value_register_equal_func      (<parameter><link linkend="GType"><type>GType</type></link> type1</parameter>,
                                                         <parameter><link linkend="GType"><type>GType</type></link> type2</parameter>,
                                                         <parameter><link linkend="GEqualFunc"><type>GEqualFunc</type></link> equal_func</parameter>);</programlisting>
<para>
e.g.:
<informalexample><programlisting>
TODO
</programlisting></informalexample>
</para>
<para>
Registers equality check function between <link linkend="GValue"><type>GValue</type></link> of
<parameter>type1</parameter> and <link linkend="GValue"><type>GValue</type></link> of <parameter>type2</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>type1</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GType"><type>GType</type></link> of compared <link linkend="GValue"><type>GValue</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>type2</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GType"><type>GType</type></link> of compared <link linkend="GValue"><type>GValue</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>equal_func</parameter>&#160;:</term>
<listitem><simpara>a function that compares <parameter>type1</parameter>'s <link linkend="GValue"><type>GValue</type></link>
with <parameter>type2</parameter>'s <link linkend="GValue"><type>GValue</type></link>.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.5</para></refsect2>

</refsect1>

</refentry>
