summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2008-09-27 01:44:07 +0000
committerDan Winship <danw@src.gnome.org>2008-09-27 01:44:07 +0000
commit1ae3a4aec122b9cfcc71b68185dc0a687cc63c62 (patch)
treeb5716e59c7846dcc18c9d296c2c2a269267af0d3 /docs
parent29ddd48ff2844e80311b00275dd561c2c47fb94c (diff)
downloadglib-1ae3a4aec122b9cfcc71b68185dc0a687cc63c62.tar.gz
Fix lots of typos, document g_assert_error() and g_assert_no_error()
* glib/tmpl/testing.sgml: Fix lots of typos, document g_assert_error() and g_assert_no_error() svn path=/trunk/; revision=7557
Diffstat (limited to 'docs')
-rw-r--r--docs/reference/ChangeLog5
-rw-r--r--docs/reference/glib/glib-sections.txt3
-rw-r--r--docs/reference/glib/tmpl/testing.sgml56
3 files changed, 55 insertions, 9 deletions
diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog
index 662f3d942..91ae6e432 100644
--- a/docs/reference/ChangeLog
+++ b/docs/reference/ChangeLog
@@ -1,3 +1,8 @@
+2008-09-26 Dan Winship <danw@gnome.org>
+
+ * glib/tmpl/testing.sgml: Fix lots of typos, document
+ g_assert_error() and g_assert_no_error()
+
2008-09-26` Matthias Clasen <mclasen@redhat.com>
* glib/tmpl/iochannel.sgml: Move more docs inline
diff --git a/docs/reference/glib/glib-sections.txt b/docs/reference/glib/glib-sections.txt
index 8b3415aae..fc3df78e9 100644
--- a/docs/reference/glib/glib-sections.txt
+++ b/docs/reference/glib/glib-sections.txt
@@ -2611,6 +2611,8 @@ g_assert_cmpint
g_assert_cmpuint
g_assert_cmphex
g_assert_cmpfloat
+g_assert_no_error
+g_assert_error
GTestCase
GTestSuite
@@ -2627,6 +2629,7 @@ g_assertion_message
g_assertion_message_expr
g_assertion_message_cmpstr
g_assertion_message_cmpnum
+g_assertion_message_error
g_test_add_vtable
GTestConfig
diff --git a/docs/reference/glib/tmpl/testing.sgml b/docs/reference/glib/tmpl/testing.sgml
index 5f2c41852..e5ec5abb0 100644
--- a/docs/reference/glib/tmpl/testing.sgml
+++ b/docs/reference/glib/tmpl/testing.sgml
@@ -24,7 +24,7 @@ RUnit), which in turn is based on smalltalk unit testing concepts.
A test fixture consists of fixture data and setup and teardown methods
to establish the environment for the test functions. We use fresh
fixtures, i.e. fixtures are newly set up and torn down around each test
- invokation to avoid dependencies between tests.
+ invocation to avoid dependencies between tests.
</para></listitem>
</varlistentry>
<varlistentry>
@@ -53,7 +53,7 @@ is that the assertion messages can be more elaborate, and include the
values of the compared entities.
</para>
<para>
-GLib ships with two utilites called gtester and gtester-report to
+GLib ships with two utilities called gtester and gtester-report to
facilitate running tests and producing nicely formatted test reports.
</para>
@@ -433,7 +433,7 @@ The strings are compared using g_strcmp0().
</para>
<para>
The effect of <literal>g_assert_cmpstr (s1, op, s2)</literal> is the same
-as <literal>g_assert (s1 op s2)</literal>. The advantage of this macro
+as <literal>g_assert (g_strcmp0 (s1, s2) op 0)</literal>. The advantage of this macro
is that it can produce a message that includes the actual values of @s1
and @s2.
</para>
@@ -442,7 +442,7 @@ and @s2.
</programlisting></informalexample>
@s1: a string (may be %NULL)
-@cmp: The comparsion operator to use. One of ==, !=, &lt;, &gt;, &lt;=, &gt;=.
+@cmp: The comparison operator to use. One of ==, !=, &lt;, &gt;, &lt;=, &gt;=.
@s2: another string (may be %NULL)
@Since: 2.16
@@ -460,7 +460,7 @@ and @n2.
</para>
@n1: an integer
-@cmp: The comparsion operator to use. One of ==, !=, &lt;, &gt;, &lt;=, &gt;=.
+@cmp: The comparison operator to use. One of ==, !=, &lt;, &gt;, &lt;=, &gt;=.
@n2: another integer
@Since: 2.16
@@ -478,7 +478,7 @@ and @n2.
</para>
@n1: an unsigned integer
-@cmp: The comparsion operator to use. One of ==, !=, &lt;, &gt;, &lt;=, &gt;=.
+@cmp: The comparison operator to use. One of ==, !=, &lt;, &gt;, &lt;=, &gt;=.
@n2: another unsigned integer
@Since: 2.16
@@ -492,7 +492,7 @@ in the message.
</para>
@n1: an unsigned integer
-@cmp: The comparsion operator to use. One of ==, !=, &lt;, &gt;, &lt;=, &gt;=.
+@cmp: The comparison operator to use. One of ==, !=, &lt;, &gt;, &lt;=, &gt;=.
@n2: another unsigned integer
@Since: 2.16
@@ -503,18 +503,56 @@ Debugging macro to terminate the application with a warning message
if a floating point number comparison fails.
</para>
<para>
-The effect of <literal>g_assert_cmpflott (n1, op, n2)</literal> is the same
+The effect of <literal>g_assert_cmpfloat (n1, op, n2)</literal> is the same
as <literal>g_assert (n1 op n2)</literal>. The advantage of this function
is that it can produce a message that includes the actual values of @n1
and @n2.
</para>
@n1: an floating point number
-@cmp: The comparsion operator to use. One of ==, !=, &lt;, &gt;, &lt;=, &gt;=.
+@cmp: The comparison operator to use. One of ==, !=, &lt;, &gt;, &lt;=, &gt;=.
@n2: another floating point number
@Since: 2.16
+<!-- ##### MACRO g_assert_no_error ##### -->
+<para>
+Debugging macro to terminate the application with a warning message
+if a method has returned a #GError.
+</para>
+<para>
+The effect of <literal>g_assert_no_error (err)</literal> is the same
+as <literal>g_assert (err == NULL)</literal>. The advantage of this macro
+is that it can produce a message that includes the error message and code.
+</para>
+
+@err: a #GError, possibly %NULL
+@Since: 2.20
+
+
+<!-- ##### MACRO g_assert_error ##### -->
+<para>
+Debugging macro to terminate the application with a warning message
+if a method has not returned the correct #GError.
+</para>
+<para>
+The effect of <literal>g_assert_error (err, dom, c)</literal> is the same
+as <literal>g_assert (err != NULL &amp;&amp; err->domain == dom &amp;&amp; err->code == c)</literal>.
+The advantage of this macro is that it can produce a message that
+includes the incorrect error message and code.
+</para>
+<para>
+This can only be used to test for a specific error. If you want to
+test that @err is set, but don't care what it's set to, just use
+<literal>g_assert (err != NULL)</literal>
+</para>
+
+@err: a #GError, possibly %NULL
+@dom: the expected error domain (a #GQuark)
+@c: the expected error code
+@Since: 2.20
+
+
<!-- ##### TYPEDEF GTestCase ##### -->
<para>
An opaque structure representing a test case.