<?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-Test-Utilities">
<refmeta>
<refentrytitle role="top_of_page" id="cutter-Test-Utilities.top_of_page">Test Utilities</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>CUTTER Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Test Utilities</refname>
<refpurpose>Utilities to write tests more easily.</refpurpose>
</refnamediv>

<refsect1 id="cutter-Test-Utilities.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="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="cut-take">cut_take</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="void"><returnvalue>void</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="cut-take-memory">cut_take_memory</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="cut-take-string">cut_take_string</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="cut-take-strdup">cut_take_strdup</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="cut-take-strndup">cut_take_strndup</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="void"><returnvalue>void</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="cut-take-memdup">cut_take_memdup</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="cut-take-printf">cut_take_printf</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="char"><returnvalue>char</returnvalue></link>&#160;**
</entry><entry role="function_name"><link linkend="cut-take-string-array">cut_take_string_array</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="cut-take-diff">cut_take_diff</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="cut-take-replace">cut_take_replace</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="cut-take-convert">cut_take_convert</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="cut-take-inspect-string">cut_take_inspect_string</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="cut-set-fixture-data-dir">cut_set_fixture_data_dir</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="cut-build-fixture-data-path">cut_build_fixture_data_path</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="cut-build-fixture-path">cut_build_fixture_path</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="cut-get-fixture-data-string">cut_get_fixture_data_string</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="cut-get-fixture-data">cut_get_fixture_data</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="cut-remove-path">cut_remove_path</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="cut-build-path">cut_build_path</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="cut-build-path-array">cut_build_path_array</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="cut-make-directory">cut_make_directory</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

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


<refsect1 id="cutter-Test-Utilities.description" role="desc">
<title role="desc.title">Description</title>
<para>To write tests, you need to write codes that
set up/tear down test environment, prepare expected and
actual values and so on. Cutter provides test utilities
to you write your tests more easily.</para>
<para>The utilities work without GLib support.</para>

</refsect1>
<refsect1 id="cutter-Test-Utilities.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="cut-take" role="function" condition="since:1.0.5">
<title>cut_take&#160;()</title>
<indexterm zone="cut-take" role="1.0.5"><primary>cut_take</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>&#160;*
cut_take (<parameter><link linkend="void"><type>void</type></link> *object</parameter>,
          <parameter><link linkend="CutDestroyFunction"><type>CutDestroyFunction</type></link> destroy_function</parameter>);</programlisting>
<para>Passes ownership of <parameter>object</parameter>
 to Cutter and returns <parameter>object</parameter>

itself. <parameter>object</parameter>
 is destroyed by <parameter>destroy_func</parameter>
.</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>the object to be owned by Cutter.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>destroy_function</para></entry>
<entry role="parameter_description"><para>the destroy function for the object.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> <parameter>object</parameter>
owned by Cutter. Don't free it.</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.0.5">1.0.5</link></para></refsect2>
<refsect2 id="cut-take-memory" role="function" condition="since:1.0.5">
<title>cut_take_memory&#160;()</title>
<indexterm zone="cut-take-memory" role="1.0.5"><primary>cut_take_memory</primary></indexterm>
<programlisting language="C">const <link linkend="void"><returnvalue>void</returnvalue></link>&#160;*
cut_take_memory (<parameter><link linkend="void"><type>void</type></link> *memory</parameter>);</programlisting>
<para>Passes ownership of <parameter>memory</parameter>
 to Cutter and returns <parameter>memory</parameter>

itself. <parameter>memory</parameter>
 is destroyed by <link linkend="free"><function>free()</function></link>.</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>memory</para></entry>
<entry role="parameter_description"><para>the memory to be owned by Cutter.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> <parameter>memory</parameter>
owned by Cutter. Don't free it.</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.0.5">1.0.5</link></para></refsect2>
<refsect2 id="cut-take-string" role="function">
<title>cut_take_string&#160;()</title>
<indexterm zone="cut-take-string"><primary>cut_take_string</primary></indexterm>
<programlisting language="C">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
cut_take_string (<parameter><link linkend="char"><type>char</type></link> *string</parameter>);</programlisting>
<para>Passes ownership of <parameter>string</parameter>
 to Cutter and returns <parameter>string</parameter>

itself.</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>string</para></entry>
<entry role="parameter_description"><para>the string to be owned by Cutter.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> <parameter>string</parameter>
owned by Cutter. Don't free it.</para>
</refsect3></refsect2>
<refsect2 id="cut-take-strdup" role="function" condition="since:1.0.5">
<title>cut_take_strdup&#160;()</title>
<indexterm zone="cut-take-strdup" role="1.0.5"><primary>cut_take_strdup</primary></indexterm>
<programlisting language="C">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
cut_take_strdup (<parameter>const <link linkend="char"><type>char</type></link> *string</parameter>);</programlisting>
<para>Duplicates <parameter>string</parameter>
, passes ownership of the duplicated
string to Cutter and returns the duplicated string.</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>string</para></entry>
<entry role="parameter_description"><para>the string to be duplicated.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> a duplicated string owned by Cutter. Don't free it.</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.0.5">1.0.5</link></para></refsect2>
<refsect2 id="cut-take-strndup" role="function" condition="since:1.0.5">
<title>cut_take_strndup&#160;()</title>
<indexterm zone="cut-take-strndup" role="1.0.5"><primary>cut_take_strndup</primary></indexterm>
<programlisting language="C">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
cut_take_strndup (<parameter>const <link linkend="char"><type>char</type></link> *string</parameter>,
                  <parameter><link linkend="size-t"><type>size_t</type></link> size</parameter>);</programlisting>
<para>Duplicates the first <parameter>size</parameter>
 bytes of <parameter>string</parameter>
, passes
ownership of the duplicated string to Cutter and returns
the duplicated string. The duplicated string is always
<link linkend="NULL:CAPS"><literal>NULL</literal></link>-terminated.</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>string</para></entry>
<entry role="parameter_description"><para>the string to be duplicated.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>size</para></entry>
<entry role="parameter_description"><para>the number of bytes to duplicate.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> a duplicated string owned by Cutter. Don't free it.</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.0.5">1.0.5</link></para></refsect2>
<refsect2 id="cut-take-memdup" role="function" condition="since:1.0.5">
<title>cut_take_memdup&#160;()</title>
<indexterm zone="cut-take-memdup" role="1.0.5"><primary>cut_take_memdup</primary></indexterm>
<programlisting language="C">const <link linkend="void"><returnvalue>void</returnvalue></link>&#160;*
cut_take_memdup (<parameter>const <link linkend="void"><type>void</type></link> *memory</parameter>,
                 <parameter><link linkend="size-t"><type>size_t</type></link> size</parameter>);</programlisting>
<para>Duplicates <parameter>size</parameter>
 bytes of <parameter>memory</parameter>
, passes ownership of
the duplicated memory to Cutter and returns the
duplicated memory.</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>memory</para></entry>
<entry role="parameter_description"><para>the memory to be duplicated.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>size</para></entry>
<entry role="parameter_description"><para>the number of bytes to duplicate.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> a duplicated memory owned by Cutter. Don't free it.</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.0.5">1.0.5</link></para></refsect2>
<refsect2 id="cut-take-printf" role="function">
<title>cut_take_printf&#160;()</title>
<indexterm zone="cut-take-printf"><primary>cut_take_printf</primary></indexterm>
<programlisting language="C">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
cut_take_printf (<parameter>const <link linkend="char"><type>char</type></link> *format</parameter>,
                 <parameter>...</parameter>);</programlisting>
<para>Formats a string like <link linkend="printf"><function>printf()</function></link> but the formatted string
is owned by Cutter.</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>format</para></entry>
<entry role="parameter_description"><para>the message format. See the <link linkend="printf"><function>printf()</function></link> documentation.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>the parameters to insert into the format string.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> a formatted string owned by Cutter. Don't free it.</para>
</refsect3></refsect2>
<refsect2 id="cut-take-string-array" role="function">
<title>cut_take_string_array&#160;()</title>
<indexterm zone="cut-take-string-array"><primary>cut_take_string_array</primary></indexterm>
<programlisting language="C"><link linkend="char"><returnvalue>char</returnvalue></link>&#160;**
cut_take_string_array (<parameter><link linkend="char"><type>char</type></link> **strings</parameter>);</programlisting>
<para>Passes ownership of the array of strings to Cutter and
returns <parameter>strings</parameter>
 itself.</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>strings</para></entry>
<entry role="parameter_description"><para>the array of strings to be owned by Cutter.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> <parameter>strings</parameter>
owned by Cutter. Don't free it.</para>
</refsect3></refsect2>
<refsect2 id="cut-take-diff" role="function">
<title>cut_take_diff&#160;()</title>
<indexterm zone="cut-take-diff"><primary>cut_take_diff</primary></indexterm>
<programlisting language="C">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
cut_take_diff (<parameter>const <link linkend="char"><type>char</type></link> *from</parameter>,
               <parameter>const <link linkend="char"><type>char</type></link> *to</parameter>);</programlisting>
<para>Computes diff between <parameter>from</parameter>
 and <parameter>to</parameter>
 that is owned by Cutter.</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>from</para></entry>
<entry role="parameter_description"><para>the original string.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>to</para></entry>
<entry role="parameter_description"><para>the modified string.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> a diff between <parameter>from</parameter>
and <parameter>to</parameter>
owned by Cutter. Don't free it.</para>
</refsect3></refsect2>
<refsect2 id="cut-take-replace" role="function" condition="since:1.0.6">
<title>cut_take_replace&#160;()</title>
<indexterm zone="cut-take-replace" role="1.0.6"><primary>cut_take_replace</primary></indexterm>
<programlisting language="C">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
cut_take_replace (<parameter>const <link linkend="char"><type>char</type></link> *target</parameter>,
                  <parameter>const <link linkend="char"><type>char</type></link> *pattern</parameter>,
                  <parameter>const <link linkend="char"><type>char</type></link> *replacement</parameter>);</programlisting>
<para>Replaces all occurrences of the <parameter>pattern</parameter>
 with the
<parameter>replacement</parameter>
 in the <parameter>target</parameter>
 string.</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>target</para></entry>
<entry role="parameter_description"><para>the replace target string.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>pattern</para></entry>
<entry role="parameter_description"><para>the regular expression pattern as string.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>replacement</para></entry>
<entry role="parameter_description"><para>text to replace each match with</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> a replaced string owned by Cutter. Don't free it.</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.0.6">1.0.6</link></para></refsect2>
<refsect2 id="cut-take-convert" role="macro" condition="since:1.1.3">
<title>cut_take_convert()</title>
<indexterm zone="cut-take-convert" role="1.1.3"><primary>cut_take_convert</primary></indexterm>
<programlisting language="C">#define             cut_take_convert(string, to_code_set, from_code_set)</programlisting>
<para>Converts <parameter>string</parameter>
 code set to <parameter>to_code_set</parameter>
 from
<parameter>from_code_set</parameter>
.</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>string</para></entry>
<entry role="parameter_description"><para>the convert target string. It should be <link linkend="NULL:CAPS"><literal>NULL</literal></link>-terminated.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>to_code_set</para></entry>
<entry role="parameter_description"><para>the code set name which to convert <parameter>string</parameter>
.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>from_code_set</para></entry>
<entry role="parameter_description"><para>the code set name of <parameter>string</parameter>
.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> a converted string owned by Cutter. Don't free it.</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.1.3">1.1.3</link></para></refsect2>
<refsect2 id="cut-take-inspect-string" role="function" condition="since:1.1.4">
<title>cut_take_inspect_string&#160;()</title>
<indexterm zone="cut-take-inspect-string" role="1.1.4"><primary>cut_take_inspect_string</primary></indexterm>
<programlisting language="C">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
cut_take_inspect_string (<parameter>const <link linkend="char"><type>char</type></link> *string</parameter>);</programlisting>
<para>Inspects <parameter>string</parameter>
.</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>string</para></entry>
<entry role="parameter_description"><para>the inspect target string. It should be <link linkend="NULL:CAPS"><literal>NULL</literal></link> or
<link linkend="NULL:CAPS"><literal>NULL</literal></link>-terminated.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> a inspected string owned by Cutter. Don't free it.</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.1.4">1.1.4</link></para></refsect2>
<refsect2 id="cut-set-fixture-data-dir" role="function" condition="since:1.0.2">
<title>cut_set_fixture_data_dir&#160;()</title>
<indexterm zone="cut-set-fixture-data-dir" role="1.0.2"><primary>cut_set_fixture_data_dir</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
cut_set_fixture_data_dir (<parameter>const <link linkend="char"><type>char</type></link> *path</parameter>,
                          <parameter>...</parameter>);</programlisting>
<para>Set fixture data directory that is used by
<link linkend="cut-get-fixture-data-string"><function>cut_get_fixture_data_string()</function></link> and so on.</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>path</para></entry>
<entry role="parameter_description"><para>a first element of the path to the fixture data directory.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>remaining elements in path.
<link linkend="NULL:CAPS"><literal>NULL</literal></link>-terminate is required since 1.0.7.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-1.0.2">1.0.2</link></para></refsect2>
<refsect2 id="cut-build-fixture-data-path" role="function" condition="deprecated:1.1.6: Use cut_build_fixture_path() instead.|since:1.0.2">
<title>cut_build_fixture_data_path&#160;()</title>
<indexterm zone="cut-build-fixture-data-path" role="deprecated"><primary>cut_build_fixture_data_path</primary></indexterm><indexterm zone="cut-build-fixture-data-path" role="1.0.2"><primary>cut_build_fixture_data_path</primary></indexterm>
<programlisting language="C"><link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
cut_build_fixture_data_path (<parameter>const <link linkend="char"><type>char</type></link> *path</parameter>,
                             <parameter>...</parameter>);</programlisting>
<warning><para><literal>cut_build_fixture_data_path</literal> has been deprecated since version 1.1.6 and should not be used in newly-written code.</para> <para>Use <link linkend="cut-build-fixture-path"><function>cut_build_fixture_path()</function></link> instead.</para>
</warning>
<para>Builds a path to the fixture data. If <parameter>path</parameter>
 is relative
path, the path is handled as a relative path from a
directory that is specified by <link linkend="cut-set-fixture-data-dir"><function>cut_set_fixture_data_dir()</function></link>
or the current directory.</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>path</para></entry>
<entry role="parameter_description"><para>a first element of the path to the fixture data.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>remaining elements in path.
<link linkend="NULL:CAPS"><literal>NULL</literal></link>-terminate is required since 1.0.7.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> a path to the fixture data. It should be freed
when no longer needed.</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.0.2">1.0.2</link></para></refsect2>
<refsect2 id="cut-build-fixture-path" role="function" condition="since:1.1.6">
<title>cut_build_fixture_path&#160;()</title>
<indexterm zone="cut-build-fixture-path" role="1.1.6"><primary>cut_build_fixture_path</primary></indexterm>
<programlisting language="C">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
cut_build_fixture_path (<parameter>const <link linkend="char"><type>char</type></link> *path</parameter>,
                        <parameter>...</parameter>);</programlisting>
<para>Builds a path to the fixture data. If <parameter>path</parameter>
 is relative
path, the path is handled as a relative path from a
directory that is specified by <link linkend="cut-set-fixture-data-dir"><function>cut_set_fixture_data_dir()</function></link>
or the current directory.</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>path</para></entry>
<entry role="parameter_description"><para>a first element of the path to the fixture data.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>remaining elements in path.
<link linkend="NULL:CAPS"><literal>NULL</literal></link>-terminate is required.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> a path to the fixture data. It is owned by
Cutter. Don't free it.</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.1.6">1.1.6</link></para></refsect2>
<refsect2 id="cut-get-fixture-data-string" role="function" condition="since:1.0.2">
<title>cut_get_fixture_data_string&#160;()</title>
<indexterm zone="cut-get-fixture-data-string" role="1.0.2"><primary>cut_get_fixture_data_string</primary></indexterm>
<programlisting language="C">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
cut_get_fixture_data_string (<parameter>const <link linkend="char"><type>char</type></link> *path</parameter>,
                             <parameter>...</parameter>);</programlisting>
<para>Reads the fixture data at "<parameter>path</parameter>
/..." and returns it as a
string that is owned by Cutter. The description of
<link linkend="cut-build-fixture-path"><function>cut_build_fixture_path()</function></link> shows how the fixture data path
is determined.</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>path</para></entry>
<entry role="parameter_description"><para>a first element of the path to the fixture data.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>remaining elements in path.
<link linkend="NULL:CAPS"><literal>NULL</literal></link>-terminate is required since 1.0.7.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> a content of the fixture data as string owend by
Cutter.  Don't free it.</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.0.2">1.0.2</link></para></refsect2>
<refsect2 id="cut-get-fixture-data" role="function" condition="since:1.1.6">
<title>cut_get_fixture_data&#160;()</title>
<indexterm zone="cut-get-fixture-data" role="1.1.6"><primary>cut_get_fixture_data</primary></indexterm>
<programlisting language="C">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
cut_get_fixture_data (<parameter><link linkend="size-t"><type>size_t</type></link> *size</parameter>,
                      <parameter>const <link linkend="char"><type>char</type></link> *path</parameter>,
                      <parameter>...</parameter>);</programlisting>
<para>Reads the fixture data at "<parameter>path</parameter>
/..." and returns it as a
string that is owned by Cutter. The description of
<link linkend="cut-build-fixture-path"><function>cut_build_fixture_path()</function></link> shows how the fixture data path
is determined.</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>size</para></entry>
<entry role="parameter_description"><para>return location for a size of the fixture data, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>path</para></entry>
<entry role="parameter_description"><para>a first element of the path to the fixture data.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>remaining elements in path.
<link linkend="NULL:CAPS"><literal>NULL</literal></link>-terminate is required.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> a content of the fixture data as string owend by
Cutter. Don't free it.</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.1.6">1.1.6</link></para></refsect2>
<refsect2 id="cut-remove-path" role="function" condition="since:1.0.2">
<title>cut_remove_path&#160;()</title>
<indexterm zone="cut-remove-path" role="1.0.2"><primary>cut_remove_path</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
cut_remove_path (<parameter>const <link linkend="char"><type>char</type></link> *path</parameter>,
                 <parameter>...</parameter>);</programlisting>
<para>Removes <parameter>path</parameter>
 and it's children recursively. It doesn't
report any errors.</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>path</para></entry>
<entry role="parameter_description"><para>a first element of the path to be removed.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>remaining elements in path.
<link linkend="NULL:CAPS"><literal>NULL</literal></link>-terminate is required since 1.0.7.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-1.0.2">1.0.2</link></para></refsect2>
<refsect2 id="cut-build-path" role="function" condition="since:1.0.7">
<title>cut_build_path&#160;()</title>
<indexterm zone="cut-build-path" role="1.0.7"><primary>cut_build_path</primary></indexterm>
<programlisting language="C">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
cut_build_path (<parameter>const <link linkend="char"><type>char</type></link> *path</parameter>,
                <parameter>...</parameter>);</programlisting>
<para>Builds path from <parameter>path</parameter>
 and the following elements.</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>path</para></entry>
<entry role="parameter_description"><para>a first element of the path.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>remaining elements in path. <link linkend="NULL:CAPS"><literal>NULL</literal></link> terminated.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> built path owned by Cutter. Don't free it.</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.0.7">1.0.7</link></para></refsect2>
<refsect2 id="cut-build-path-array" role="function" condition="since:1.1.5">
<title>cut_build_path_array&#160;()</title>
<indexterm zone="cut-build-path-array" role="1.1.5"><primary>cut_build_path_array</primary></indexterm>
<programlisting language="C">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
cut_build_path_array (<parameter>const <link linkend="char"><type>char</type></link> **paths</parameter>);</programlisting>
<para>Builds path from <parameter>paths</parameter>
.</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>paths</para></entry>
<entry role="parameter_description"><para><link linkend="NULL:CAPS"><literal>NULL</literal></link>-terminated array of strings containing the path elements.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> built path owned by Cutter. Don't free it.</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.1.5">1.1.5</link></para></refsect2>
<refsect2 id="cut-make-directory" role="function" condition="since:1.1.1">
<title>cut_make_directory&#160;()</title>
<indexterm zone="cut-make-directory" role="1.1.1"><primary>cut_make_directory</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
cut_make_directory (<parameter>const <link linkend="char"><type>char</type></link> *path</parameter>,
                    <parameter>...</parameter>);</programlisting>
<para>Makes <parameter>path</parameter>
 and it's parents recursively. It doesn't
report any errors.</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>path</para></entry>
<entry role="parameter_description"><para>a first element of the path to be made.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>remaining elements in path. <link linkend="NULL:CAPS"><literal>NULL</literal></link> terminated.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-1.1.1">1.1.1</link></para></refsect2>

</refsect1>
<refsect1 id="cutter-Test-Utilities.other_details" role="details">
<title role="details.title">Types and Values</title>

</refsect1>

</refentry>
