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

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

<synopsis><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="gcut-object-equal">gcut_object_equal</link>                   (<parameter>const <link linkend="GObject"><type>GObject</type></link> *object1</parameter>,
                                                         <parameter>const <link linkend="GObject"><type>GObject</type></link> *object2</parameter>,
                                                         <parameter><link linkend="GEqualFunc"><type>GEqualFunc</type></link> equal_func</parameter>);
<link linkend="gchar"><returnvalue>gchar</returnvalue></link> *             <link linkend="gcut-object-inspect">gcut_object_inspect</link>                 (<parameter>const <link linkend="GObject"><type>GObject</type></link> *object</parameter>);
<link linkend="gchar"><returnvalue>gchar</returnvalue></link> *             <link linkend="gcut-object-inspect-custom">gcut_object_inspect_custom</link>          (<parameter>const <link linkend="GObject"><type>GObject</type></link> *object</parameter>,
                                                         <parameter><link linkend="GCutInspectFunction"><type>GCutInspectFunction</type></link> inspect_func</parameter>,
                                                         <parameter><link linkend="gpointer"><type>gpointer</type></link> user_data</parameter>);
</synopsis>
</refsynopsisdiv>

<refsect1 id="cutter-Assertion-Utilities-for-GObject.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="GObject"><type>GObject</type></link>.
</para>
</refsect1>
<refsect1 id="cutter-Assertion-Utilities-for-GObject.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="gcut-object-equal" role="function" condition="since:1.0.5">
<title>gcut_object_equal ()</title>
<indexterm zone="gcut-object-equal" role="1.0.5"><primary>gcut_object_equal</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            gcut_object_equal                   (<parameter>const <link linkend="GObject"><type>GObject</type></link> *object1</parameter>,
                                                         <parameter>const <link linkend="GObject"><type>GObject</type></link> *object2</parameter>,
                                                         <parameter><link linkend="GEqualFunc"><type>GEqualFunc</type></link> equal_func</parameter>);</programlisting>
<para>
Compares two <link linkend="GObject"><type>GObject</type></link>, <parameter>object1</parameter> and <parameter>object2</parameter> by
<parameter>equal_func</parameter>. If <parameter>equal_func</parameter> is NULL, <parameter>object1</parameter> and
<parameter>object2</parameter> is just only compared by memory location.
</para><variablelist role="params">
<varlistentry><term><parameter>object1</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GObject"><type>GObject</type></link> to be compared.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>object2</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GObject"><type>GObject</type></link> to be compared.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>equal_func</parameter>&#160;:</term>
<listitem><simpara>a function that compares two <link linkend="GObject"><type>GObject</type></link>. NULL
is OK.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> TRUE if <parameter>object1</parameter> == <parameter>object2</parameter> or
<parameter>equal_func</parameter>(<parameter>object1</parameter>, <parameter>object2</parameter>), FALSE otherwise.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.5</para></refsect2>
<refsect2 id="gcut-object-inspect" role="function" condition="since:1.0.5">
<title>gcut_object_inspect ()</title>
<indexterm zone="gcut-object-inspect" role="1.0.5"><primary>gcut_object_inspect</primary></indexterm>
<programlisting><link linkend="gchar"><returnvalue>gchar</returnvalue></link> *             gcut_object_inspect                 (<parameter>const <link linkend="GObject"><type>GObject</type></link> *object</parameter>);</programlisting>
<para>
Inspects <parameter>object</parameter>'s property. The returned string should
be freed when no longer needed.
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GObject"><type>GObject</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> inspected <parameter>object</parameter> as a string.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.5</para></refsect2>
<refsect2 id="gcut-object-inspect-custom" role="function" condition="since:1.0.5">
<title>gcut_object_inspect_custom ()</title>
<indexterm zone="gcut-object-inspect-custom" role="1.0.5"><primary>gcut_object_inspect_custom</primary></indexterm>
<programlisting><link linkend="gchar"><returnvalue>gchar</returnvalue></link> *             gcut_object_inspect_custom          (<parameter>const <link linkend="GObject"><type>GObject</type></link> *object</parameter>,
                                                         <parameter><link linkend="GCutInspectFunction"><type>GCutInspectFunction</type></link> inspect_func</parameter>,
                                                         <parameter><link linkend="gpointer"><type>gpointer</type></link> user_data</parameter>);</programlisting>
<para>
Inspects <parameter>object</parameter> by <parameter>inspect_func</parameter>. The returned string
should be freed when no longer needed.
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GObject"><type>GObject</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>inspect_func</parameter>&#160;:</term>
<listitem><simpara>a function that inspects <parameter>object</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data to pass to the function.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> inspected <parameter>object</parameter> as a string.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.0.5</para></refsect2>

</refsect1>

</refentry>
