Logo Search packages:      
Sourcecode: libnih version File versions  Download package

test_node.c

/* nih-dbus-tool
 *
 * test_node.c - test suite for nih-dbus-tool/node.c
 *
 * Copyright © 2009 Scott James Remnant <scott@netsplit.com>.
 * Copyright © 2009 Canonical Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2, as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#include <nih/test.h>

#include <expat.h>

#include <errno.h>
#include <assert.h>

#include <nih/macros.h>
#include <nih/alloc.h>
#include <nih/list.h>
#include <nih/string.h>
#include <nih/main.h>
#include <nih/error.h>

#include "type.h"
#include "node.h"
#include "interface.h"
#include "parse.h"
#include "errors.h"


void
test_path_valid (void)
{
      TEST_FUNCTION ("node_path_valid");

      /* Check that a typical node path is valid. */
      TEST_FEATURE ("with typical node path");
      TEST_TRUE (node_path_valid ("/com/netsplit/Nih/Test"));


      /* Check that an node path is not valid if it is missing the first
       * slash.
       */
      TEST_FEATURE ("without first slash");
      TEST_FALSE (node_path_valid ("com/netsplit/Nih/Test"));


      /* Check that an node path is not valid if it has multiple
       * consecutive slashes.
       */
      TEST_FEATURE ("with consecutive slashes");
      TEST_FALSE (node_path_valid ("/com//netsplit/Nih/Test"));


      /* Check that an node path is not valid if it ends in a slash. */
      TEST_FEATURE ("with final slash");
      TEST_FALSE (node_path_valid ("/com/netsplit/Nih/Test/"));


      /* Check that the root node path is valid */
      TEST_FEATURE ("with root node path");
      TEST_TRUE (node_path_valid ("/"));


      /* Check that a node path elements may contain numbers */
      TEST_FEATURE ("with numbers in node path");
      TEST_TRUE (node_path_valid ("/com/netsplit/a43b/Test"));


      /* Check that a node path elements may begin with numbers */
      TEST_FEATURE ("with numbers starting node path element");
      TEST_TRUE (node_path_valid ("/com/netsplit/43/Test"));


      /* Check that a node path elements may contain underscores */
      TEST_FEATURE ("with underscore in node path");
      TEST_TRUE (node_path_valid ("/com/netsplit/Nih_Test"));


      /* Check that a node path elements may begin with underscores */
      TEST_FEATURE ("with underscore starting node path element");
      TEST_TRUE (node_path_valid ("/com/netsplit/_Nih/Test"));


      /* Check that other characters are not permitted */
      TEST_FEATURE ("with non-permitted characters");
      TEST_FALSE (node_path_valid ("/com/netsplit/Nih.Test-Thing"));


      /* Check that an empty node path is invalid */
      TEST_FEATURE ("with empty string");
      TEST_FALSE (node_path_valid (""));
}


void
test_new (void)
{
      Node *node;

      TEST_FUNCTION ("node_new");

      /* Check that when given a name, the node structure is allocated,
       * the defaults filled in and the name copied into the structure.
       */
      TEST_FEATURE ("with name");
      TEST_ALLOC_FAIL {
            node = node_new (NULL, "test");

            if (test_alloc_failed) {
                  TEST_EQ_P (node, NULL);
                  continue;
            }

            TEST_ALLOC_SIZE (node, sizeof (Node));
            TEST_EQ_STR (node->path, "test");
            TEST_ALLOC_PARENT (node->path, node);
            TEST_LIST_EMPTY (&node->interfaces);

            nih_free (node);
      }


      /* Check that when a name is not given, NULL is stored instead. */
      TEST_FEATURE ("without name");
      TEST_ALLOC_FAIL {
            node = node_new (NULL, NULL);

            if (test_alloc_failed) {
                  TEST_EQ_P (node, NULL);
                  continue;
            }

            TEST_ALLOC_SIZE (node, sizeof (Node));
            TEST_EQ_P (node->path, NULL);
            TEST_LIST_EMPTY (&node->interfaces);

            nih_free (node);
      }
}


void
test_start_tag (void)
{
      ParseContext context;
      ParseStack * parent = NULL;
      ParseStack * entry;
      XML_Parser   xmlp;
      Node *       node = NULL;
      Interface *  interface = NULL;
      char *       attr[5];
      int          ret = 0;
      NihError *   err;
      FILE *       output;

      TEST_FUNCTION ("node_start_tag");
      context.parent = NULL;
      nih_list_init (&context.stack);
      context.filename = "foo";
      context.node = NULL;

      assert (xmlp = XML_ParserCreate ("UTF-8"));
      XML_SetUserData (xmlp, &context);

      output = tmpfile ();


      /* Check that an node tag for an node with the usual name
       * attribute results in an Node member being created and pushed
       * onto the stack with that attribute filled in correctly.
       */
      TEST_FEATURE ("with node and name");
      TEST_ALLOC_FAIL {
            attr[0] = "name";
            attr[1] = "/com/netsplit/Nih/Test";
            attr[2] = NULL;

            ret = node_start_tag (xmlp, "node", attr);

            if (test_alloc_failed) {
                  TEST_LT (ret, 0);

                  TEST_EQ_P (parse_stack_top (&context.stack), NULL);

                  err = nih_error_get ();
                  TEST_EQ (err->number, ENOMEM);
                  nih_free (err);

                  continue;
            }

            TEST_EQ (ret, 0);

            entry = parse_stack_top (&context.stack);
            TEST_NE_P (entry, NULL);
            TEST_ALLOC_SIZE (entry, sizeof (ParseStack));
            TEST_EQ (entry->type, PARSE_NODE);

            node = entry->node;
            TEST_ALLOC_SIZE (node, sizeof (Node));
            TEST_ALLOC_PARENT (node, entry);
            TEST_EQ_STR (node->path, "/com/netsplit/Nih/Test");
            TEST_ALLOC_PARENT (node->path, node);
            TEST_LIST_EMPTY (&node->interfaces);

            nih_free (entry);
      }


      /* Check that a node tag may be missing the name attribute, and
       * that still results in a Node member being created and pushed
       * onto the stack with that attribute filled in correctly.
       */
      TEST_FEATURE ("with node but no name");
      TEST_ALLOC_FAIL {
            attr[0] = NULL;

            ret = node_start_tag (xmlp, "node", attr);

            if (test_alloc_failed) {
                  TEST_LT (ret, 0);

                  TEST_EQ_P (parse_stack_top (&context.stack), NULL);

                  err = nih_error_get ();
                  TEST_EQ (err->number, ENOMEM);
                  nih_free (err);

                  continue;
            }

            TEST_EQ (ret, 0);

            entry = parse_stack_top (&context.stack);
            TEST_NE_P (entry, NULL);
            TEST_ALLOC_SIZE (entry, sizeof (ParseStack));
            TEST_EQ (entry->type, PARSE_NODE);

            node = entry->node;
            TEST_ALLOC_SIZE (node, sizeof (Node));
            TEST_ALLOC_PARENT (node, entry);
            TEST_EQ_P (node->path, NULL);
            TEST_LIST_EMPTY (&node->interfaces);

            nih_free (entry);
      }


      /* Check that a node may appear inside another node tag, but that
       * an ignored tag is pushed since we don't want to process children.
       */
      TEST_FEATURE ("with child node");
      TEST_ALLOC_FAIL {
            TEST_ALLOC_SAFE {
                  node = node_new (NULL, NULL);
                  parent = parse_stack_push (NULL, &context.stack,
                                       PARSE_NODE, node);
                  nih_discard (node);
            }

            attr[0] = "name";
            attr[1] = "/com/netsplit/Nih/Test";
            attr[2] = NULL;

            ret = node_start_tag (xmlp, "node", attr);

            if (test_alloc_failed) {
                  TEST_LT (ret, 0);

                  TEST_EQ_P (parse_stack_top (&context.stack), parent);

                  err = nih_error_get ();
                  TEST_EQ (err->number, ENOMEM);
                  nih_free (err);

                  nih_free (parent);
                  continue;
            }

            TEST_EQ (ret, 0);

            entry = parse_stack_top (&context.stack);
            TEST_NE_P (entry, NULL);
            TEST_ALLOC_SIZE (entry, sizeof (ParseStack));
            TEST_EQ (entry->type, PARSE_IGNORED);
            TEST_EQ_P (entry->data, NULL);

            nih_free (entry);
            nih_free (parent);
      }


      /* Check that a node with an invalid name results in an
       * error being raised.
       */
      TEST_FEATURE ("with invalid name");
      TEST_ALLOC_FAIL {
            TEST_ALLOC_SAFE {
                  attr[0] = "name";
                  attr[1] = "Test Node";
                  attr[2] = NULL;
            }

            ret = node_start_tag (xmlp, "node", attr);

            TEST_LT (ret, 0);

            TEST_EQ_P (parse_stack_top (&context.stack), NULL);

            err = nih_error_get ();
            TEST_EQ (err->number, NODE_INVALID_PATH);
            nih_free (err);
      }


      /* Check that an unknown node attribute results in a warning
       * being printed to standard error, but is otherwise ignored
       * and the normal processing finished.
       */
      TEST_FEATURE ("with unknown attribute");
      TEST_ALLOC_FAIL {
            TEST_ALLOC_SAFE {
                  attr[0] = "name";
                  attr[1] = "/com/netsplit/Nih/Test";
                  attr[2] = "frodo";
                  attr[3] = "baggins";
                  attr[4] = NULL;
            }

            TEST_DIVERT_STDERR (output) {
                  ret = node_start_tag (xmlp, "node", attr);
            }
            rewind (output);

            if (test_alloc_failed
                && (ret < 0)) {
                  err = nih_error_get ();
                  TEST_EQ (err->number, ENOMEM);
                  nih_free (err);

                  TEST_EQ_P (parse_stack_top (&context.stack), NULL);

                  TEST_FILE_RESET (output);
                  continue;
            }

            TEST_EQ (ret, 0);

            entry = parse_stack_top (&context.stack);
            TEST_NE_P (entry, NULL);
            TEST_ALLOC_SIZE (entry, sizeof (ParseStack));
            TEST_EQ (entry->type, PARSE_NODE);

            node = entry->node;
            TEST_ALLOC_SIZE (node, sizeof (Node));
            TEST_ALLOC_PARENT (node, entry);
            TEST_EQ_STR (node->path, "/com/netsplit/Nih/Test");
            TEST_ALLOC_PARENT (node->path, node);
            TEST_LIST_EMPTY (&node->interfaces);

            TEST_FILE_EQ (output, ("test:foo:1:0: Ignored unknown <node> attribute: "
                               "frodo\n"));
            TEST_FILE_END (output);
            TEST_FILE_RESET (output);

            nih_free (entry);
      }


      /* Check that a node on top of a stack entry results in a warning
       * being printed on standard error and an ignored element being
       * pushed onto the stack.
       */
      TEST_FEATURE ("with non-node on stack");
      TEST_ALLOC_FAIL {
            TEST_ALLOC_SAFE {
                  interface = interface_new (NULL, "com.netsplit.Nih.Test");
                  parent = parse_stack_push (NULL, &context.stack,
                                       PARSE_INTERFACE, interface);
                  nih_discard (interface);

                  attr[0] = "name";
                  attr[1] = "/com/netsplit/Nih/Test";
                  attr[2] = NULL;
            }

            TEST_DIVERT_STDERR (output) {
                  ret = node_start_tag (xmlp, "node", attr);
            }
            rewind (output);

            if (test_alloc_failed
                && (ret < 0)) {
                  err = nih_error_get ();
                  TEST_EQ (err->number, ENOMEM);
                  nih_free (err);

                  TEST_EQ_P (parse_stack_top (&context.stack), parent);

                  TEST_FILE_RESET (output);

                  nih_free (parent);
                  continue;
            }

            TEST_EQ (ret, 0);

            entry = parse_stack_top (&context.stack);
            TEST_NE_P (entry, parent);
            TEST_ALLOC_SIZE (entry, sizeof (ParseStack));
            TEST_EQ (entry->type, PARSE_IGNORED);
            TEST_EQ_P (entry->data, NULL);

            TEST_FILE_EQ (output, "test:foo:1:0: Ignored unexpected <node> tag\n");
            TEST_FILE_END (output);
            TEST_FILE_RESET (output);

            nih_free (entry);

            nih_free (parent);
      }


      XML_ParserFree (xmlp);
      fclose (output);
}

void
test_end_tag (void)
{
      ParseContext context;
      ParseStack * entry = NULL;
      XML_Parser   xmlp;
      Node *       node = NULL;
      int          ret;
      NihError *   err;
      void *       parent;

      TEST_FUNCTION ("node_end_tag");
      context.parent = NULL;
      nih_list_init (&context.stack);
      context.filename = "foo";
      context.node = NULL;

      assert (xmlp = XML_ParserCreate ("UTF-8"));
      XML_SetUserData (xmlp, &context);


      /* Check that when we parse the end tag for a node, we pop
       * the Node object off the stack and place it in the context's
       * node member.  The stack entry should be freed and removed from
       * the stack.
       */
      TEST_FEATURE ("with no parent");
      TEST_ALLOC_FAIL {
            TEST_ALLOC_SAFE {
                  node = node_new (NULL, "/com/netsplit/Nih/Test");
                  entry = parse_stack_push (NULL, &context.stack,
                                      PARSE_NODE, node);
                  nih_discard (node);
            }

            TEST_FREE_TAG (entry);

            ret = node_end_tag (xmlp, "node");

            if (test_alloc_failed) {
                  TEST_LT (ret, 0);

                  TEST_NOT_FREE (entry);

                  err = nih_error_get ();
                  TEST_EQ (err->number, ENOMEM);
                  nih_free (err);

                  nih_free (entry);
                  continue;
            }

            TEST_EQ (ret, 0);

            TEST_FREE (entry);
            TEST_ALLOC_PARENT (node, NULL);
            TEST_EQ_P (context.node, node);

            nih_free (node);
            context.node = NULL;
      }


      /* Check that when the context has a parent, the new node is
       * referenced by it.
       */
      TEST_FEATURE ("with parent");
      context.parent = parent = nih_alloc (NULL, 1);
      TEST_ALLOC_FAIL {
            TEST_ALLOC_SAFE {
                  node = node_new (NULL, "/com/netsplit/Nih/Test");
                  entry = parse_stack_push (NULL, &context.stack,
                                      PARSE_NODE, node);
                  nih_discard (node);

            }

            TEST_FREE_TAG (entry);

            ret = node_end_tag (xmlp, "node");

            if (test_alloc_failed) {
                  TEST_LT (ret, 0);

                  TEST_NOT_FREE (entry);

                  err = nih_error_get ();
                  TEST_EQ (err->number, ENOMEM);
                  nih_free (err);

                  nih_free (entry);
                  continue;
            }

            TEST_EQ (ret, 0);

            TEST_FREE (entry);
            TEST_ALLOC_PARENT (node, context.parent);
            TEST_EQ_P (context.node, node);

            nih_free (node);
            context.node = NULL;
      }
      nih_free (parent);


      XML_ParserFree (xmlp);
}


void
test_lookup_interface (void)
{
      Node *     node = NULL;
      Interface *interface1 = NULL;
      Interface *interface2 = NULL;
      Interface *interface3 = NULL;
      Interface *ret;

      TEST_FUNCTION ("node_lookup_interface");


      /* Check that the function returns the interface if there is one
       * with the given symbol.
       */
      TEST_FEATURE ("with matching symbol");
      TEST_ALLOC_FAIL {
            TEST_ALLOC_SAFE {
                  node = node_new (NULL, NULL);

                  interface1 = interface_new (node, "com.netsplit.Nih.Test");
                  interface1->symbol = nih_strdup (interface1, "test");
                  nih_list_add (&node->interfaces, &interface1->entry);

                  interface2 = interface_new (node, "com.netsplit.Nih.Foo");
                  nih_list_add (&node->interfaces, &interface2->entry);

                  interface3 = interface_new (node, "com.netsplit.Nih.Bar");
                  interface3->symbol = nih_strdup (interface3, "bar");
                  nih_list_add (&node->interfaces, &interface3->entry);
            }

            ret = node_lookup_interface (node, "bar");

            TEST_EQ_P (ret, interface3);

            nih_free (node);
      }


      /* Check that the function returns the interface if there is one
       * with no symbol and NULL is given.
       */
      TEST_FEATURE ("with no specified symbol");
      TEST_ALLOC_FAIL {
            TEST_ALLOC_SAFE {
                  node = node_new (NULL, NULL);

                  interface1 = interface_new (node, "com.netsplit.Nih.Test");
                  interface1->symbol = nih_strdup (interface1, "test");
                  nih_list_add (&node->interfaces, &interface1->entry);

                  interface2 = interface_new (node, "com.netsplit.Nih.Foo");
                  nih_list_add (&node->interfaces, &interface2->entry);

                  interface3 = interface_new (node, "com.netsplit.Nih.Bar");
                  interface3->symbol = nih_strdup (interface3, "bar");
                  nih_list_add (&node->interfaces, &interface3->entry);
            }

            ret = node_lookup_interface (node, NULL);

            TEST_EQ_P (ret, interface2);

            nih_free (node);
      }


      /* Check that the function returns NULL if there is no interface
       * with the given symbol.
       */
      TEST_FEATURE ("with non-matching symbol");
      TEST_ALLOC_FAIL {
            TEST_ALLOC_SAFE {
                  node = node_new (NULL, NULL);

                  interface1 = interface_new (node, "com.netsplit.Nih.Test");
                  interface1->symbol = nih_strdup (interface1, "test");
                  nih_list_add (&node->interfaces, &interface1->entry);

                  interface2 = interface_new (node, "com.netsplit.Nih.Foo");
                  nih_list_add (&node->interfaces, &interface2->entry);

                  interface3 = interface_new (node, "com.netsplit.Nih.Bar");
                  interface3->symbol = nih_strdup (interface3, "bar");
                  nih_list_add (&node->interfaces, &interface3->entry);
            }

            ret = node_lookup_interface (node, "baz");

            TEST_EQ_P (ret, NULL);

            nih_free (node);
      }
}


void
test_interfaces_array (void)
{
      NihList    prototypes;
      Node *     node = NULL;
      Interface *interface = NULL;
      Method *   method = NULL;
      Signal *   signal = NULL;
      Argument * arg = NULL;
      Property * property = NULL;
      char *     str;
      TypeVar *  var;

      TEST_FUNCTION ("node_interfaces_array");

      /* Check that we can generate the interfaces array code for a
       * node with multiple interfaces.  We want the members set up for
       * an object implementation, so the method and property function
       * pointers should be set and not the signal filter pointer.
       * Since the interface structures themselves are not made static,
       * the prototypes should contain those as well.
       */
      TEST_FEATURE ("with object");
      TEST_ALLOC_FAIL {
            nih_list_init (&prototypes);

            TEST_ALLOC_SAFE {
                  node = node_new (NULL, NULL);

                  interface = interface_new (node, "com.netsplit.Nih.Test");
                  interface->symbol = "test";
                  nih_list_add (&node->interfaces, &interface->entry);

                  method = method_new (interface, "Poke");
                  method->symbol = "poke";
                  nih_list_add (&interface->methods, &method->entry);

                  arg = argument_new (method, "address",
                                  "u", NIH_DBUS_ARG_IN);
                  arg->symbol = "address";
                  nih_list_add (&method->arguments, &arg->entry);

                  arg = argument_new (method, "value",
                                  "s", NIH_DBUS_ARG_IN);
                  arg->symbol = "value";
                  nih_list_add (&method->arguments, &arg->entry);

                  method = method_new (interface, "Peek");
                  method->symbol = "peek";
                  nih_list_add (&interface->methods, &method->entry);

                  arg = argument_new (method, "address",
                                  "u", NIH_DBUS_ARG_IN);
                  arg->symbol = "address";
                  nih_list_add (&method->arguments, &arg->entry);

                  arg = argument_new (method, "value",
                                  "s", NIH_DBUS_ARG_OUT);
                  arg->symbol = "value";
                  nih_list_add (&method->arguments, &arg->entry);

                  method = method_new (interface, "IsValidAddress");
                  method->symbol = "is_valid_address";
                  nih_list_add (&interface->methods, &method->entry);

                  arg = argument_new (method, "address",
                                  "u", NIH_DBUS_ARG_IN);
                  arg->symbol = "address";
                  nih_list_add (&method->arguments, &arg->entry);


                  signal = signal_new (interface, "Bounce");
                  signal->symbol = "bounce";
                  nih_list_add (&interface->signals, &signal->entry);

                  arg = argument_new (signal, "height",
                                  "u", NIH_DBUS_ARG_OUT);
                  arg->symbol = "height";
                  nih_list_add (&signal->arguments, &arg->entry);

                  arg = argument_new (signal, "velocity",
                                  "i", NIH_DBUS_ARG_OUT);
                  arg->symbol = "velocity";
                  nih_list_add (&signal->arguments, &arg->entry);

                  signal = signal_new (interface, "Exploded");
                  signal->symbol = "exploded";
                  nih_list_add (&interface->signals, &signal->entry);


                  property = property_new (interface, "colour",
                                     "s", NIH_DBUS_READWRITE);
                  property->symbol = "colour";
                  nih_list_add (&interface->properties, &property->entry);

                  property = property_new (interface, "size",
                                     "u", NIH_DBUS_READ);
                  property->symbol = "size";
                  nih_list_add (&interface->properties, &property->entry);

                  property = property_new (interface, "touch",
                                     "b", NIH_DBUS_WRITE);
                  property->symbol = "touch";
                  nih_list_add (&interface->properties, &property->entry);

                  interface = interface_new (node, "com.netsplit.Nih.Foo");
                  interface->symbol = "foo";
                  nih_list_add (&node->interfaces, &interface->entry);
            }

            str = node_interfaces_array (NULL, "my", node, TRUE,
                                   &prototypes);

            if (test_alloc_failed) {
                  TEST_EQ_P (str, NULL);
                  TEST_LIST_EMPTY (&prototypes);

                  nih_free (node);
                  continue;
            }

            TEST_EXPECTED_STR (str, "test_node_interfaces_array_object.c");

            TEST_LIST_NOT_EMPTY (&prototypes);

            var = (TypeVar *)prototypes.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, str);
            TEST_EQ_STR (var->type, "extern const NihDBusInterface");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "my_com_netsplit_Nih_Test");
            TEST_ALLOC_PARENT (var->name, var);
            TEST_FALSE (var->array);
            nih_free (var);

            TEST_LIST_NOT_EMPTY (&prototypes);

            var = (TypeVar *)prototypes.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, str);
            TEST_EQ_STR (var->type, "extern const NihDBusInterface");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "my_com_netsplit_Nih_Foo");
            TEST_ALLOC_PARENT (var->name, var);
            TEST_FALSE (var->array);
            nih_free (var);

            TEST_LIST_NOT_EMPTY (&prototypes);

            var = (TypeVar *)prototypes.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, str);
            TEST_EQ_STR (var->type, "extern const NihDBusInterface *");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "my_interfaces");
            TEST_ALLOC_PARENT (var->name, var);
            TEST_TRUE (var->array);
            nih_free (var);

            TEST_LIST_EMPTY (&prototypes);

            nih_free (str);
            nih_free (node);
      }


      /* Check that we can generate the interfaces array code for a
       * node with multiple interfaces.  We want the members set up for
       * a proxy implementation, so the signal filter pointer should be
       * set but not the method or property function pointers.
       * Since the interface structures themselves are not made static,
       * the prototypes should contain those as well.
       */
      TEST_FEATURE ("with proxy");
      TEST_ALLOC_FAIL {
            nih_list_init (&prototypes);

            TEST_ALLOC_SAFE {
                  node = node_new (NULL, NULL);

                  interface = interface_new (node, "com.netsplit.Nih.Test");
                  interface->symbol = "test";
                  nih_list_add (&node->interfaces, &interface->entry);

                  method = method_new (interface, "Poke");
                  method->symbol = "poke";
                  nih_list_add (&interface->methods, &method->entry);

                  arg = argument_new (method, "address",
                                  "u", NIH_DBUS_ARG_IN);
                  arg->symbol = "address";
                  nih_list_add (&method->arguments, &arg->entry);

                  arg = argument_new (method, "value",
                                  "s", NIH_DBUS_ARG_IN);
                  arg->symbol = "value";
                  nih_list_add (&method->arguments, &arg->entry);

                  method = method_new (interface, "Peek");
                  method->symbol = "peek";
                  nih_list_add (&interface->methods, &method->entry);

                  arg = argument_new (method, "address",
                                  "u", NIH_DBUS_ARG_IN);
                  arg->symbol = "address";
                  nih_list_add (&method->arguments, &arg->entry);

                  arg = argument_new (method, "value",
                                  "s", NIH_DBUS_ARG_OUT);
                  arg->symbol = "value";
                  nih_list_add (&method->arguments, &arg->entry);

                  method = method_new (interface, "IsValidAddress");
                  method->symbol = "is_valid_address";
                  nih_list_add (&interface->methods, &method->entry);

                  arg = argument_new (method, "address",
                                  "u", NIH_DBUS_ARG_IN);
                  arg->symbol = "address";
                  nih_list_add (&method->arguments, &arg->entry);


                  signal = signal_new (interface, "Bounce");
                  signal->symbol = "bounce";
                  nih_list_add (&interface->signals, &signal->entry);

                  arg = argument_new (signal, "height",
                                  "u", NIH_DBUS_ARG_OUT);
                  arg->symbol = "height";
                  nih_list_add (&signal->arguments, &arg->entry);

                  arg = argument_new (signal, "velocity",
                                  "i", NIH_DBUS_ARG_OUT);
                  arg->symbol = "velocity";
                  nih_list_add (&signal->arguments, &arg->entry);

                  signal = signal_new (interface, "Exploded");
                  signal->symbol = "exploded";
                  nih_list_add (&interface->signals, &signal->entry);


                  property = property_new (interface, "colour",
                                     "s", NIH_DBUS_READWRITE);
                  property->symbol = "colour";
                  nih_list_add (&interface->properties, &property->entry);

                  property = property_new (interface, "size",
                                     "u", NIH_DBUS_READ);
                  property->symbol = "size";
                  nih_list_add (&interface->properties, &property->entry);

                  property = property_new (interface, "touch",
                                     "b", NIH_DBUS_WRITE);
                  property->symbol = "touch";
                  nih_list_add (&interface->properties, &property->entry);

                  interface = interface_new (node, "com.netsplit.Nih.Foo");
                  interface->symbol = "foo";
                  nih_list_add (&node->interfaces, &interface->entry);
            }

            str = node_interfaces_array (NULL, "my", node, FALSE,
                                   &prototypes);

            if (test_alloc_failed) {
                  TEST_EQ_P (str, NULL);
                  TEST_LIST_EMPTY (&prototypes);

                  nih_free (node);
                  continue;
            }

            TEST_EXPECTED_STR (str, "test_node_interfaces_array_proxy.c");

            TEST_LIST_NOT_EMPTY (&prototypes);

            var = (TypeVar *)prototypes.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, str);
            TEST_EQ_STR (var->type, "extern const NihDBusInterface");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "my_com_netsplit_Nih_Test");
            TEST_ALLOC_PARENT (var->name, var);
            TEST_FALSE (var->array);
            nih_free (var);

            TEST_LIST_NOT_EMPTY (&prototypes);

            var = (TypeVar *)prototypes.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, str);
            TEST_EQ_STR (var->type, "extern const NihDBusInterface");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "my_com_netsplit_Nih_Foo");
            TEST_ALLOC_PARENT (var->name, var);
            TEST_FALSE (var->array);
            nih_free (var);

            TEST_LIST_NOT_EMPTY (&prototypes);

            var = (TypeVar *)prototypes.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, str);
            TEST_EQ_STR (var->type, "extern const NihDBusInterface *");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "my_interfaces");
            TEST_ALLOC_PARENT (var->name, var);
            TEST_TRUE (var->array);
            nih_free (var);

            TEST_LIST_EMPTY (&prototypes);

            nih_free (str);
            nih_free (node);
      }


      /* Check that we can still generate an interfaces array even when
       * there are no interfaces.
       */
      TEST_FEATURE ("with no interfaces");
      TEST_ALLOC_FAIL {
            nih_list_init (&prototypes);

            TEST_ALLOC_SAFE {
                  node = node_new (NULL, NULL);
            }

            str = node_interfaces_array (NULL, "my", node, TRUE,
                                   &prototypes);

            if (test_alloc_failed) {
                  TEST_EQ_P (str, NULL);
                  TEST_LIST_EMPTY (&prototypes);

                  nih_free (node);
                  continue;
            }

            TEST_EXPECTED_STR (str, "test_node_interfaces_array_none.c");

            TEST_LIST_NOT_EMPTY (&prototypes);

            var = (TypeVar *)prototypes.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, str);
            TEST_EQ_STR (var->type, "extern const NihDBusInterface *");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "my_interfaces");
            TEST_ALLOC_PARENT (var->name, var);
            TEST_TRUE (var->array);
            nih_free (var);

            TEST_LIST_EMPTY (&prototypes);

            nih_free (str);
            nih_free (node);
      }
}


void
test_object_functions (void)
{
      NihList       prototypes;
      NihList       handlers;
      NihList       structs;
      NihList       externs;
      Node *        node = NULL;
      Interface *   interface = NULL;
      Method *      method = NULL;
      Signal *      signal = NULL;
      Argument *    argument = NULL;
      Property *    property = NULL;
      char *        str;
      TypeFunc *    func;
      TypeVar *     arg;
      TypeStruct *  structure;
      TypeVar *     var;
      NihListEntry *attrib;

      TEST_FUNCTION ("node_object_functions");


      /* Check that we can generate all of the functions needed for a Node's
       * object implementation, wrapping externally defined functions.  Each
       * static function should have its prototype returned, each externally
       * defined function should have the extern prototype returned and
       * each API function its prototype returned.  Property functions
       * should only be generated as access allows.
       */
      TEST_FEATURE ("with node");
      TEST_ALLOC_FAIL {
            nih_list_init (&prototypes);
            nih_list_init (&handlers);
            nih_list_init (&structs);
            nih_list_init (&externs);

            TEST_ALLOC_SAFE {
                  node = node_new (NULL, NULL);

                  interface = interface_new (node, "com.netsplit.Nih.Test");
                  interface->symbol = "test";
                  nih_list_add (&node->interfaces, &interface->entry);

                  method = method_new (interface, "Poke");
                  method->symbol = "poke";
                  nih_list_add (&interface->methods, &method->entry);

                  argument = argument_new (method, "address",
                                     "u", NIH_DBUS_ARG_IN);
                  argument->symbol = "address";
                  nih_list_add (&method->arguments, &argument->entry);

                  argument = argument_new (method, "value",
                                     "s", NIH_DBUS_ARG_IN);
                  argument->symbol = "value";
                  nih_list_add (&method->arguments, &argument->entry);

                  method = method_new (interface, "Peek");
                  method->symbol = "peek";
                  method->async = TRUE;
                  nih_list_add (&interface->methods, &method->entry);

                  argument = argument_new (method, "address",
                                     "u", NIH_DBUS_ARG_IN);
                  argument->symbol = "address";
                  nih_list_add (&method->arguments, &argument->entry);

                  argument = argument_new (method, "value",
                                     "s", NIH_DBUS_ARG_OUT);
                  argument->symbol = "value";
                  nih_list_add (&method->arguments, &argument->entry);

                  method = method_new (interface, "IsValidAddress");
                  method->symbol = "is_valid_address";
                  nih_list_add (&interface->methods, &method->entry);

                  argument = argument_new (method, "address",
                                     "u", NIH_DBUS_ARG_IN);
                  argument->symbol = "address";
                  nih_list_add (&method->arguments, &argument->entry);

                  argument = argument_new (method, "is_valid",
                                     "b", NIH_DBUS_ARG_OUT);
                  argument->symbol = "is_valid";
                  nih_list_add (&method->arguments, &argument->entry);


                  signal = signal_new (interface, "Bounce");
                  signal->symbol = "bounce";
                  nih_list_add (&interface->signals, &signal->entry);

                  argument = argument_new (signal, "height",
                                     "u", NIH_DBUS_ARG_OUT);
                  argument->symbol = "height";
                  nih_list_add (&signal->arguments, &argument->entry);

                  argument = argument_new (signal, "velocity",
                                     "i", NIH_DBUS_ARG_OUT);
                  argument->symbol = "velocity";
                  nih_list_add (&signal->arguments, &argument->entry);

                  signal = signal_new (interface, "Exploded");
                  signal->symbol = "exploded";
                  nih_list_add (&interface->signals, &signal->entry);


                  property = property_new (interface, "colour",
                                     "s", NIH_DBUS_READWRITE);
                  property->symbol = "colour";
                  nih_list_add (&interface->properties, &property->entry);

                  property = property_new (interface, "size",
                                     "u", NIH_DBUS_READ);
                  property->symbol = "size";
                  nih_list_add (&interface->properties, &property->entry);

                  property = property_new (interface, "touch",
                                     "b", NIH_DBUS_WRITE);
                  property->symbol = "touch";
                  nih_list_add (&interface->properties, &property->entry);


                  interface = interface_new (node, "com.netsplit.Nih.Foo");
                  interface->symbol = "foo";
                  nih_list_add (&node->interfaces, &interface->entry);

                  method = method_new (interface, "Bing");
                  method->symbol = "bing";
                  nih_list_add (&interface->methods, &method->entry);

                  signal = signal_new (interface, "NewResult");
                  signal->symbol = "new_result";
                  nih_list_add (&interface->signals, &signal->entry);
            }

            str = node_object_functions (NULL, "my", node,
                                   &prototypes, &handlers,
                                   &structs, &externs);

            if (test_alloc_failed) {
                  TEST_EQ_P (str, NULL);
                  TEST_LIST_EMPTY (&prototypes);
                  TEST_LIST_EMPTY (&handlers);
                  TEST_LIST_EMPTY (&structs);
                  TEST_LIST_EMPTY (&externs);

                  nih_free (node);
                  continue;
            }

            TEST_EXPECTED_STR (str, "test_node_object_functions_standard.c");

            /* Poke */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static DBusHandlerResult");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_Poke_method");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);

            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_poke");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "address");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* Peek */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static DBusHandlerResult");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_Peek_method");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);

            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_peek");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "address");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_peek_reply");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* IsValidAddress */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static DBusHandlerResult");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_IsValidAddress_method");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);

            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_is_valid_address");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "address");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "is_valid");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* bounce */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_emit_bounce");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusConnection *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "connection");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "origin_path");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "height");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);


            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "velocity");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* exploded */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_emit_exploded");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusConnection *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "connection");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "origin_path");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* colour (get) */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_colour_get");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessageIter *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "iter");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_colour");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "char **");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* colour (set) */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_colour_set");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessageIter *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "iter");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_colour");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* size (get) */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_size_get");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessageIter *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "iter");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_size");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* touch (set) */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_touch_set");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessageIter *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "iter");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_touch");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* Bing */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static DBusHandlerResult");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Foo_Bing_method");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);

            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_foo_bing");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* NewResult */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_foo_emit_new_result");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusConnection *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "connection");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "origin_path");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_EMPTY (&prototypes);
            TEST_LIST_EMPTY (&handlers);
            TEST_LIST_EMPTY (&structs);
            TEST_LIST_EMPTY (&externs);

            nih_free (str);
            nih_free (node);
      }


      /* Check that we can still generate all of the functions even if
       * there are no methods in the object implementation.
       */
      TEST_FEATURE ("with no methods");
      TEST_ALLOC_FAIL {
            nih_list_init (&prototypes);
            nih_list_init (&handlers);
            nih_list_init (&structs);
            nih_list_init (&externs);

            TEST_ALLOC_SAFE {
                  node = node_new (NULL, NULL);

                  interface = interface_new (node, "com.netsplit.Nih.Test");
                  interface->symbol = "test";
                  nih_list_add (&node->interfaces, &interface->entry);

                  signal = signal_new (interface, "Bounce");
                  signal->symbol = "bounce";
                  nih_list_add (&interface->signals, &signal->entry);

                  argument = argument_new (signal, "height",
                                     "u", NIH_DBUS_ARG_OUT);
                  argument->symbol = "height";
                  nih_list_add (&signal->arguments, &argument->entry);

                  argument = argument_new (signal, "velocity",
                                     "i", NIH_DBUS_ARG_OUT);
                  argument->symbol = "velocity";
                  nih_list_add (&signal->arguments, &argument->entry);

                  signal = signal_new (interface, "Exploded");
                  signal->symbol = "exploded";
                  nih_list_add (&interface->signals, &signal->entry);


                  property = property_new (interface, "colour",
                                     "s", NIH_DBUS_READWRITE);
                  property->symbol = "colour";
                  nih_list_add (&interface->properties, &property->entry);

                  property = property_new (interface, "size",
                                     "u", NIH_DBUS_READ);
                  property->symbol = "size";
                  nih_list_add (&interface->properties, &property->entry);

                  property = property_new (interface, "touch",
                                     "b", NIH_DBUS_WRITE);
                  property->symbol = "touch";
                  nih_list_add (&interface->properties, &property->entry);


                  interface = interface_new (node, "com.netsplit.Nih.Foo");
                  interface->symbol = "foo";
                  nih_list_add (&node->interfaces, &interface->entry);

                  signal = signal_new (interface, "NewResult");
                  signal->symbol = "new_result";
                  nih_list_add (&interface->signals, &signal->entry);
            }

            str = node_object_functions (NULL, "my", node,
                                   &prototypes, &handlers,
                                   &structs, &externs);

            if (test_alloc_failed) {
                  TEST_EQ_P (str, NULL);
                  TEST_LIST_EMPTY (&prototypes);
                  TEST_LIST_EMPTY (&handlers);
                  TEST_LIST_EMPTY (&structs);
                  TEST_LIST_EMPTY (&externs);

                  nih_free (node);
                  continue;
            }

            TEST_EXPECTED_STR (str, "test_node_object_functions_no_methods.c");

            /* bounce */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_emit_bounce");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusConnection *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "connection");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "origin_path");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "height");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);


            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "velocity");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* exploded */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_emit_exploded");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusConnection *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "connection");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "origin_path");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* colour (get) */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_colour_get");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessageIter *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "iter");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_colour");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "char **");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* colour (set) */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_colour_set");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessageIter *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "iter");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_colour");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* size (get) */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_size_get");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessageIter *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "iter");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_size");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* touch (set) */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_touch_set");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessageIter *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "iter");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_touch");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* NewResult */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_foo_emit_new_result");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusConnection *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "connection");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "origin_path");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_EMPTY (&prototypes);
            TEST_LIST_EMPTY (&handlers);
            TEST_LIST_EMPTY (&structs);
            TEST_LIST_EMPTY (&externs);

            nih_free (str);
            nih_free (node);
      }


      /* Check that we can still generate all of the functions even if
       * there are no signals in the object implementation.
       */
      TEST_FEATURE ("with no signals");
      TEST_ALLOC_FAIL {
            nih_list_init (&prototypes);
            nih_list_init (&handlers);
            nih_list_init (&structs);
            nih_list_init (&externs);

            TEST_ALLOC_SAFE {
                  node = node_new (NULL, NULL);

                  interface = interface_new (node, "com.netsplit.Nih.Test");
                  interface->symbol = "test";
                  nih_list_add (&node->interfaces, &interface->entry);

                  method = method_new (interface, "Poke");
                  method->symbol = "poke";
                  nih_list_add (&interface->methods, &method->entry);

                  argument = argument_new (method, "address",
                                     "u", NIH_DBUS_ARG_IN);
                  argument->symbol = "address";
                  nih_list_add (&method->arguments, &argument->entry);

                  argument = argument_new (method, "value",
                                     "s", NIH_DBUS_ARG_IN);
                  argument->symbol = "value";
                  nih_list_add (&method->arguments, &argument->entry);

                  method = method_new (interface, "Peek");
                  method->symbol = "peek";
                  method->async = TRUE;
                  nih_list_add (&interface->methods, &method->entry);

                  argument = argument_new (method, "address",
                                     "u", NIH_DBUS_ARG_IN);
                  argument->symbol = "address";
                  nih_list_add (&method->arguments, &argument->entry);

                  argument = argument_new (method, "value",
                                     "s", NIH_DBUS_ARG_OUT);
                  argument->symbol = "value";
                  nih_list_add (&method->arguments, &argument->entry);

                  method = method_new (interface, "IsValidAddress");
                  method->symbol = "is_valid_address";
                  nih_list_add (&interface->methods, &method->entry);

                  argument = argument_new (method, "address",
                                     "u", NIH_DBUS_ARG_IN);
                  argument->symbol = "address";
                  nih_list_add (&method->arguments, &argument->entry);

                  argument = argument_new (method, "is_valid",
                                     "b", NIH_DBUS_ARG_OUT);
                  argument->symbol = "is_valid";
                  nih_list_add (&method->arguments, &argument->entry);


                  property = property_new (interface, "colour",
                                     "s", NIH_DBUS_READWRITE);
                  property->symbol = "colour";
                  nih_list_add (&interface->properties, &property->entry);

                  property = property_new (interface, "size",
                                     "u", NIH_DBUS_READ);
                  property->symbol = "size";
                  nih_list_add (&interface->properties, &property->entry);

                  property = property_new (interface, "touch",
                                     "b", NIH_DBUS_WRITE);
                  property->symbol = "touch";
                  nih_list_add (&interface->properties, &property->entry);


                  interface = interface_new (node, "com.netsplit.Nih.Foo");
                  interface->symbol = "foo";
                  nih_list_add (&node->interfaces, &interface->entry);

                  method = method_new (interface, "Bing");
                  method->symbol = "bing";
                  nih_list_add (&interface->methods, &method->entry);
            }

            str = node_object_functions (NULL, "my", node,
                                   &prototypes, &handlers,
                                   &structs, &externs);

            if (test_alloc_failed) {
                  TEST_EQ_P (str, NULL);
                  TEST_LIST_EMPTY (&prototypes);
                  TEST_LIST_EMPTY (&handlers);
                  TEST_LIST_EMPTY (&structs);
                  TEST_LIST_EMPTY (&externs);

                  nih_free (node);
                  continue;
            }

            TEST_EXPECTED_STR (str, "test_node_object_functions_no_signals.c");

            /* Poke */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static DBusHandlerResult");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_Poke_method");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);

            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_poke");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "address");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* Peek */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static DBusHandlerResult");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_Peek_method");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);

            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_peek");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "address");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_peek_reply");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* IsValidAddress */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static DBusHandlerResult");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_IsValidAddress_method");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);

            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_is_valid_address");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "address");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "is_valid");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* colour (get) */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_colour_get");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessageIter *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "iter");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_colour");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "char **");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* colour (set) */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_colour_set");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessageIter *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "iter");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_colour");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* size (get) */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_size_get");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessageIter *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "iter");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_size");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* touch (set) */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_touch_set");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessageIter *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "iter");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_touch");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* Bing */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static DBusHandlerResult");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Foo_Bing_method");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);

            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_foo_bing");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_EMPTY (&prototypes);
            TEST_LIST_EMPTY (&handlers);
            TEST_LIST_EMPTY (&structs);
            TEST_LIST_EMPTY (&externs);

            nih_free (str);
            nih_free (node);
      }


      /* Check that we can still generate all of the functions even if
       * there are no properties in the object implementation.
       */
      TEST_FEATURE ("with no properties");
      TEST_ALLOC_FAIL {
            nih_list_init (&prototypes);
            nih_list_init (&handlers);
            nih_list_init (&structs);
            nih_list_init (&externs);

            TEST_ALLOC_SAFE {
                  node = node_new (NULL, NULL);

                  interface = interface_new (node, "com.netsplit.Nih.Test");
                  interface->symbol = "test";
                  nih_list_add (&node->interfaces, &interface->entry);

                  method = method_new (interface, "Poke");
                  method->symbol = "poke";
                  nih_list_add (&interface->methods, &method->entry);

                  argument = argument_new (method, "address",
                                     "u", NIH_DBUS_ARG_IN);
                  argument->symbol = "address";
                  nih_list_add (&method->arguments, &argument->entry);

                  argument = argument_new (method, "value",
                                     "s", NIH_DBUS_ARG_IN);
                  argument->symbol = "value";
                  nih_list_add (&method->arguments, &argument->entry);

                  method = method_new (interface, "Peek");
                  method->symbol = "peek";
                  method->async = TRUE;
                  nih_list_add (&interface->methods, &method->entry);

                  argument = argument_new (method, "address",
                                     "u", NIH_DBUS_ARG_IN);
                  argument->symbol = "address";
                  nih_list_add (&method->arguments, &argument->entry);

                  argument = argument_new (method, "value",
                                     "s", NIH_DBUS_ARG_OUT);
                  argument->symbol = "value";
                  nih_list_add (&method->arguments, &argument->entry);

                  method = method_new (interface, "IsValidAddress");
                  method->symbol = "is_valid_address";
                  nih_list_add (&interface->methods, &method->entry);

                  argument = argument_new (method, "address",
                                     "u", NIH_DBUS_ARG_IN);
                  argument->symbol = "address";
                  nih_list_add (&method->arguments, &argument->entry);

                  argument = argument_new (method, "is_valid",
                                     "b", NIH_DBUS_ARG_OUT);
                  argument->symbol = "is_valid";
                  nih_list_add (&method->arguments, &argument->entry);


                  signal = signal_new (interface, "Bounce");
                  signal->symbol = "bounce";
                  nih_list_add (&interface->signals, &signal->entry);

                  argument = argument_new (signal, "height",
                                     "u", NIH_DBUS_ARG_OUT);
                  argument->symbol = "height";
                  nih_list_add (&signal->arguments, &argument->entry);

                  argument = argument_new (signal, "velocity",
                                     "i", NIH_DBUS_ARG_OUT);
                  argument->symbol = "velocity";
                  nih_list_add (&signal->arguments, &argument->entry);

                  signal = signal_new (interface, "Exploded");
                  signal->symbol = "exploded";
                  nih_list_add (&interface->signals, &signal->entry);


                  interface = interface_new (node, "com.netsplit.Nih.Foo");
                  interface->symbol = "foo";
                  nih_list_add (&node->interfaces, &interface->entry);

                  method = method_new (interface, "Bing");
                  method->symbol = "bing";
                  nih_list_add (&interface->methods, &method->entry);

                  signal = signal_new (interface, "NewResult");
                  signal->symbol = "new_result";
                  nih_list_add (&interface->signals, &signal->entry);
            }

            str = node_object_functions (NULL, "my", node,
                                   &prototypes, &handlers,
                                   &structs, &externs);

            if (test_alloc_failed) {
                  TEST_EQ_P (str, NULL);
                  TEST_LIST_EMPTY (&prototypes);
                  TEST_LIST_EMPTY (&handlers);
                  TEST_LIST_EMPTY (&structs);
                  TEST_LIST_EMPTY (&externs);

                  nih_free (node);
                  continue;
            }

            TEST_EXPECTED_STR (str, "test_node_object_functions_no_properties.c");

            /* Poke */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static DBusHandlerResult");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_Poke_method");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);

            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_poke");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "address");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* Peek */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static DBusHandlerResult");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_Peek_method");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);

            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_peek");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "address");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_peek_reply");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* IsValidAddress */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static DBusHandlerResult");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_IsValidAddress_method");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);

            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_is_valid_address");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "address");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "is_valid");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* bounce */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_emit_bounce");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusConnection *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "connection");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "origin_path");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "height");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);


            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "velocity");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* exploded */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_emit_exploded");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusConnection *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "connection");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "origin_path");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* Bing */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static DBusHandlerResult");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Foo_Bing_method");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);

            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_foo_bing");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* NewResult */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_foo_emit_new_result");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusConnection *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "connection");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "origin_path");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_EMPTY (&prototypes);
            TEST_LIST_EMPTY (&handlers);
            TEST_LIST_EMPTY (&structs);
            TEST_LIST_EMPTY (&externs);

            nih_free (str);
            nih_free (node);
      }


      /* Check that we can still generate all of the functions even if
       * there are no methods or signals in the object implementation.
       */
      TEST_FEATURE ("with no methods or signals");
      TEST_ALLOC_FAIL {
            nih_list_init (&prototypes);
            nih_list_init (&handlers);
            nih_list_init (&structs);
            nih_list_init (&externs);

            TEST_ALLOC_SAFE {
                  node = node_new (NULL, NULL);

                  interface = interface_new (node, "com.netsplit.Nih.Test");
                  interface->symbol = "test";
                  nih_list_add (&node->interfaces, &interface->entry);

                  property = property_new (interface, "colour",
                                     "s", NIH_DBUS_READWRITE);
                  property->symbol = "colour";
                  nih_list_add (&interface->properties, &property->entry);

                  property = property_new (interface, "size",
                                     "u", NIH_DBUS_READ);
                  property->symbol = "size";
                  nih_list_add (&interface->properties, &property->entry);

                  property = property_new (interface, "touch",
                                     "b", NIH_DBUS_WRITE);
                  property->symbol = "touch";
                  nih_list_add (&interface->properties, &property->entry);


                  interface = interface_new (node, "com.netsplit.Nih.Foo");
                  interface->symbol = "foo";
                  nih_list_add (&node->interfaces, &interface->entry);
            }

            str = node_object_functions (NULL, "my", node,
                                   &prototypes, &handlers,
                                   &structs, &externs);

            if (test_alloc_failed) {
                  TEST_EQ_P (str, NULL);
                  TEST_LIST_EMPTY (&prototypes);
                  TEST_LIST_EMPTY (&handlers);
                  TEST_LIST_EMPTY (&structs);
                  TEST_LIST_EMPTY (&externs);

                  nih_free (node);
                  continue;
            }

            TEST_EXPECTED_STR (str, "test_node_object_functions_only_properties.c");

            /* colour (get) */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_colour_get");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessageIter *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "iter");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_colour");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "char **");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* colour (set) */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_colour_set");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessageIter *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "iter");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_colour");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* size (get) */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_size_get");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessageIter *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "iter");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_size");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* touch (set) */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_touch_set");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessageIter *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "iter");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_touch");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_EMPTY (&prototypes);
            TEST_LIST_EMPTY (&handlers);
            TEST_LIST_EMPTY (&structs);
            TEST_LIST_EMPTY (&externs);

            nih_free (str);
            nih_free (node);
      }


      /* Check that methods, signals and properties with structure
       * arguments all pass the struct definitions back in the structs
       * list.  Make sure that output arguments from an async method
       * call aren't duplicated and make sure those from readwrite
       * properties aren't duplicated while read and write only are
       * still returned.
       */
      TEST_FEATURE ("with structure arguments");
      TEST_ALLOC_FAIL {
            nih_list_init (&prototypes);
            nih_list_init (&handlers);
            nih_list_init (&structs);
            nih_list_init (&externs);

            TEST_ALLOC_SAFE {
                  node = node_new (NULL, NULL);

                  interface = interface_new (node, "com.netsplit.Nih.Test");
                  interface->symbol = "test";
                  nih_list_add (&node->interfaces, &interface->entry);

                  method = method_new (interface, "Search");
                  method->async = TRUE;
                  method->symbol = "search";
                  nih_list_add (&interface->methods, &method->entry);

                  argument = argument_new (method, "item",
                                     "(su)", NIH_DBUS_ARG_IN);
                  argument->symbol = "item";
                  nih_list_add (&method->arguments, &argument->entry);

                  argument = argument_new (method, "result",
                                     "(ss)", NIH_DBUS_ARG_OUT);
                  argument->symbol = "result";
                  nih_list_add (&method->arguments, &argument->entry);


                  signal = signal_new (interface, "NewSearch");
                  signal->symbol = "new_search";
                  nih_list_add (&interface->signals, &signal->entry);

                  argument = argument_new (signal, "query",
                                     "(ssu)", NIH_DBUS_ARG_OUT);
                  argument->symbol = "query";
                  nih_list_add (&signal->arguments, &argument->entry);


                  property = property_new (interface, "last_search",
                                     "(su)", NIH_DBUS_READ);
                  property->symbol = "last_search";
                  nih_list_add (&interface->properties, &property->entry);

                  property = property_new (interface, "annotation",
                                     "(ss)", NIH_DBUS_WRITE);
                  property->symbol = "annotation";
                  nih_list_add (&interface->properties, &property->entry);

                  property = property_new (interface, "preferences",
                                     "(us)", NIH_DBUS_READWRITE);
                  property->symbol = "preferences";
                  nih_list_add (&interface->properties, &property->entry);
            }

            str = node_object_functions (NULL, "my", node,
                                   &prototypes, &handlers,
                                   &structs, &externs);

            if (test_alloc_failed) {
                  TEST_EQ_P (str, NULL);
                  TEST_LIST_EMPTY (&prototypes);
                  TEST_LIST_EMPTY (&handlers);
                  TEST_LIST_EMPTY (&structs);
                  TEST_LIST_EMPTY (&externs);

                  nih_free (node);
                  continue;
            }

            TEST_EXPECTED_STR (str, "test_node_object_functions_structure.c");

            /* Search */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static DBusHandlerResult");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_Search_method");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);

            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_search");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const MyTestSearchItem *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "item");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_search_reply");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const MyTestSearchResult *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "result");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&structs);

            structure = (TypeStruct *)structs.next;
            TEST_ALLOC_SIZE (structure, sizeof (TypeStruct));
            TEST_ALLOC_PARENT (structure, str);
            TEST_EQ_STR (structure->name, "MyTestSearchItem");
            TEST_ALLOC_PARENT (structure->name, structure);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "char *");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "item0");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "uint32_t");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "item1");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_EMPTY (&structure->members);
            nih_free (structure);


            TEST_LIST_NOT_EMPTY (&structs);

            structure = (TypeStruct *)structs.next;
            TEST_ALLOC_SIZE (structure, sizeof (TypeStruct));
            TEST_ALLOC_PARENT (structure, str);
            TEST_EQ_STR (structure->name, "MyTestSearchResult");
            TEST_ALLOC_PARENT (structure->name, structure);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "char *");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "item0");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "char *");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "item1");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_EMPTY (&structure->members);
            nih_free (structure);


            /* NewSearch */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_emit_new_search");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusConnection *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "connection");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "origin_path");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const MyTestNewSearchQuery *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "query");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);


            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&structs);

            structure = (TypeStruct *)structs.next;
            TEST_ALLOC_SIZE (structure, sizeof (TypeStruct));
            TEST_ALLOC_PARENT (structure, str);
            TEST_EQ_STR (structure->name, "MyTestNewSearchQuery");
            TEST_ALLOC_PARENT (structure->name, structure);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "char *");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "item0");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "char *");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "item1");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "uint32_t");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "item2");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_EMPTY (&structure->members);
            nih_free (structure);


            /* last_search (get) */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_last_search_get");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessageIter *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "iter");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_last_search");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestLastSearch **");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&structs);

            structure = (TypeStruct *)structs.next;
            TEST_ALLOC_SIZE (structure, sizeof (TypeStruct));
            TEST_ALLOC_PARENT (structure, str);
            TEST_EQ_STR (structure->name, "MyTestLastSearch");
            TEST_ALLOC_PARENT (structure->name, structure);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "char *");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "item0");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "uint32_t");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "item1");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_EMPTY (&structure->members);
            nih_free (structure);


            /* annotation (set) */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_annotation_set");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessageIter *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "iter");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_annotation");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const MyTestAnnotation *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&structs);

            structure = (TypeStruct *)structs.next;
            TEST_ALLOC_SIZE (structure, sizeof (TypeStruct));
            TEST_ALLOC_PARENT (structure, str);
            TEST_EQ_STR (structure->name, "MyTestAnnotation");
            TEST_ALLOC_PARENT (structure->name, structure);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "char *");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "item0");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "char *");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "item1");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_EMPTY (&structure->members);
            nih_free (structure);


            /* preferences (get) */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_preferences_get");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessageIter *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "iter");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_preferences");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestPreferences **");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* preferences (set) */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_preferences_set");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusObject *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "object");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessageIter *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "iter");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&handlers);

            func = (TypeFunc *)handlers.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "extern int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_preferences");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const MyTestPreferences *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&structs);

            structure = (TypeStruct *)structs.next;
            TEST_ALLOC_SIZE (structure, sizeof (TypeStruct));
            TEST_ALLOC_PARENT (structure, str);
            TEST_EQ_STR (structure->name, "MyTestPreferences");
            TEST_ALLOC_PARENT (structure->name, structure);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "uint32_t");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "item0");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "char *");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "item1");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_EMPTY (&structure->members);
            nih_free (structure);


            TEST_LIST_EMPTY (&prototypes);
            TEST_LIST_EMPTY (&handlers);
            TEST_LIST_EMPTY (&structs);
            TEST_LIST_EMPTY (&externs);

            nih_free (str);
            nih_free (node);
      }


      /* Check that when there are no interface members, an empty string
       * is returned.
       */
      TEST_FEATURE ("with no members");
      TEST_ALLOC_FAIL {
            nih_list_init (&prototypes);
            nih_list_init (&handlers);
            nih_list_init (&structs);
            nih_list_init (&externs);

            TEST_ALLOC_SAFE {
                  node = node_new (NULL, NULL);

                  interface = interface_new (node, "com.netsplit.Nih.Test");
                  interface->symbol = "test";
                  nih_list_add (&node->interfaces, &interface->entry);

                  interface = interface_new (node, "com.netsplit.Nih.Foo");
                  interface->symbol = "foo";
                  nih_list_add (&node->interfaces, &interface->entry);
            }

            str = node_object_functions (NULL, "my", node,
                                   &prototypes, &handlers,
                                   &structs, &externs);

            if (test_alloc_failed) {
                  TEST_EQ_P (str, NULL);
                  TEST_LIST_EMPTY (&prototypes);
                  TEST_LIST_EMPTY (&handlers);
                  TEST_LIST_EMPTY (&structs);
                  TEST_LIST_EMPTY (&externs);

                  nih_free (node);
                  continue;
            }

            TEST_EQ_STR (str, "");

            TEST_LIST_EMPTY (&prototypes);
            TEST_LIST_EMPTY (&handlers);
            TEST_LIST_EMPTY (&structs);
            TEST_LIST_EMPTY (&externs);

            nih_free (str);
            nih_free (node);
      }


      /* Check that when there are no interfaces, an empty string
       * is returned.
       */
      TEST_FEATURE ("with no interfaces");
      TEST_ALLOC_FAIL {
            nih_list_init (&prototypes);
            nih_list_init (&handlers);
            nih_list_init (&structs);
            nih_list_init (&externs);

            TEST_ALLOC_SAFE {
                  node = node_new (NULL, NULL);
            }

            str = node_object_functions (NULL, "my", node,
                                   &prototypes, &handlers,
                                   &structs, &externs);

            if (test_alloc_failed) {
                  TEST_EQ_P (str, NULL);
                  TEST_LIST_EMPTY (&prototypes);
                  TEST_LIST_EMPTY (&handlers);
                  TEST_LIST_EMPTY (&structs);
                  TEST_LIST_EMPTY (&externs);

                  nih_free (node);
                  continue;
            }

            TEST_EQ_STR (str, "");

            TEST_LIST_EMPTY (&prototypes);
            TEST_LIST_EMPTY (&handlers);
            TEST_LIST_EMPTY (&structs);
            TEST_LIST_EMPTY (&externs);

            nih_free (str);
            nih_free (node);
      }
}

void
test_proxy_functions (void)
{
      NihList       prototypes;
      NihList       structs;
      NihList       typedefs;
      NihList       externs;
      Node *        node = NULL;
      Interface *   interface = NULL;
      Method *      method = NULL;
      Signal *      signal = NULL;
      Argument *    argument = NULL;
      Property *    property = NULL;
      char *        str;
      TypeFunc *    func;
      TypeVar *     arg;
      TypeStruct *  structure;
      TypeVar *     var;
      NihListEntry *attrib;

      TEST_FUNCTION ("node_proxy_functions");


      /* Check that we can generate all of the functions needed for a remote
       * Node's proxy implementation.  Each static function should have its
       * prototype returned, each callback or handler function should have
       * its typedef returned and each API function its prototype returned.
       * Property functions should only be generated as access allows.
       */
      TEST_FEATURE ("with node");
      TEST_ALLOC_FAIL {
            nih_list_init (&prototypes);
            nih_list_init (&structs);
            nih_list_init (&typedefs);
            nih_list_init (&externs);

            TEST_ALLOC_SAFE {
                  node = node_new (NULL, NULL);

                  interface = interface_new (node, "com.netsplit.Nih.Test");
                  interface->symbol = "test";
                  nih_list_add (&node->interfaces, &interface->entry);

                  method = method_new (interface, "Poke");
                  method->symbol = "poke";
                  nih_list_add (&interface->methods, &method->entry);

                  argument = argument_new (method, "address",
                                     "u", NIH_DBUS_ARG_IN);
                  argument->symbol = "address";
                  nih_list_add (&method->arguments, &argument->entry);

                  argument = argument_new (method, "value",
                                     "s", NIH_DBUS_ARG_IN);
                  argument->symbol = "value";
                  nih_list_add (&method->arguments, &argument->entry);

                  method = method_new (interface, "Peek");
                  method->symbol = "peek";
                  nih_list_add (&interface->methods, &method->entry);

                  argument = argument_new (method, "address",
                                     "u", NIH_DBUS_ARG_IN);
                  argument->symbol = "address";
                  nih_list_add (&method->arguments, &argument->entry);

                  argument = argument_new (method, "value",
                                     "s", NIH_DBUS_ARG_OUT);
                  argument->symbol = "value";
                  nih_list_add (&method->arguments, &argument->entry);

                  method = method_new (interface, "IsValidAddress");
                  method->symbol = "is_valid_address";
                  nih_list_add (&interface->methods, &method->entry);

                  argument = argument_new (method, "address",
                                     "u", NIH_DBUS_ARG_IN);
                  argument->symbol = "address";
                  nih_list_add (&method->arguments, &argument->entry);


                  signal = signal_new (interface, "Bounce");
                  signal->symbol = "bounce";
                  nih_list_add (&interface->signals, &signal->entry);

                  argument = argument_new (signal, "height",
                                     "u", NIH_DBUS_ARG_OUT);
                  argument->symbol = "height";
                  nih_list_add (&signal->arguments, &argument->entry);

                  argument = argument_new (signal, "velocity",
                                     "i", NIH_DBUS_ARG_OUT);
                  argument->symbol = "velocity";
                  nih_list_add (&signal->arguments, &argument->entry);

                  signal = signal_new (interface, "Exploded");
                  signal->symbol = "exploded";
                  nih_list_add (&interface->signals, &signal->entry);


                  property = property_new (interface, "colour",
                                     "s", NIH_DBUS_READWRITE);
                  property->symbol = "colour";
                  nih_list_add (&interface->properties, &property->entry);

                  property = property_new (interface, "size",
                                     "u", NIH_DBUS_READ);
                  property->symbol = "size";
                  nih_list_add (&interface->properties, &property->entry);

                  property = property_new (interface, "touch",
                                     "b", NIH_DBUS_WRITE);
                  property->symbol = "touch";
                  nih_list_add (&interface->properties, &property->entry);


                  interface = interface_new (node, "com.netsplit.Nih.Foo");
                  interface->symbol = "foo";
                  nih_list_add (&node->interfaces, &interface->entry);

                  method = method_new (interface, "Bing");
                  method->symbol = "bing";
                  nih_list_add (&interface->methods, &method->entry);

                  signal = signal_new (interface, "NewResult");
                  signal->symbol = "new_result";
                  nih_list_add (&interface->signals, &signal->entry);
            }

            str = node_proxy_functions (NULL, "my", node,
                                  &prototypes,
                                  &structs, &typedefs, &externs);

            if (test_alloc_failed) {
                  TEST_EQ_P (str, NULL);
                  TEST_LIST_EMPTY (&prototypes);
                  TEST_LIST_EMPTY (&typedefs);
                  TEST_LIST_EMPTY (&structs);
                  TEST_LIST_EMPTY (&externs);

                  nih_free (node);
                  continue;
            }

            TEST_EXPECTED_STR (str, "test_node_proxy_functions_standard.c");

            /* Poke */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_poke");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "address");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestPokeReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_Poke_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestPokeReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_poke_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "address");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* Peek */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_peek");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "address");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestPeekReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_Peek_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestPeekReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_peek_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "address");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "char **");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* IsValidAddress */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_is_valid_address");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "address");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestIsValidAddressReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_IsValidAddress_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestIsValidAddressReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_is_valid_address_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "address");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* Bounce */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static DBusHandlerResult");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_Bounce_signal");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusConnection *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "connection");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "signal");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxySignal *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxied");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestBounceHandler)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "height");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "velocity");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* Exploded */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static DBusHandlerResult");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_Exploded_signal");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusConnection *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "connection");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "signal");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxySignal *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxied");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestExplodedHandler)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* colour (get) */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_colour");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestGetColourReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_colour_get_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestGetColourReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_colour_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "char **");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* colour (set) */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_colour");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestSetColourReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_colour_set_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestSetColourReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_colour_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* size (get) */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_size");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestGetSizeReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_size_get_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestGetSizeReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_size_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* touch (set) */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_touch");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestSetTouchReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_touch_set_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestSetTouchReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_touch_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* Get All */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_all");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestGetAllReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_get_all_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestGetAllReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const MyTestProperties *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "properties");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_all_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestProperties **");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "properties");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&structs);

            structure = (TypeStruct *)structs.next;
            TEST_ALLOC_SIZE (structure, sizeof (TypeStruct));
            TEST_ALLOC_PARENT (structure, str);
            TEST_EQ_STR (structure->name, "MyTestProperties");
            TEST_ALLOC_PARENT (structure->name, structure);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "char *");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "colour");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "uint32_t");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "size");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_EMPTY (&structure->members);
            nih_free (structure);


            /* Bing */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_foo_bing");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyFooBingReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Foo_Bing_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyFooBingReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_foo_bing_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* NewResult */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static DBusHandlerResult");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Foo_NewResult_signal");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusConnection *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "connection");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "signal");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxySignal *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxied");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyFooNewResultHandler)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_EMPTY (&prototypes);
            TEST_LIST_EMPTY (&structs);
            TEST_LIST_EMPTY (&typedefs);
            TEST_LIST_EMPTY (&externs);

            nih_free (str);
            nih_free (node);
      }


      /* Check that we can still generate all of the functions even if
       * there are no methods in the object implementation.
       */
      TEST_FEATURE ("with no methods");
      TEST_ALLOC_FAIL {
            nih_list_init (&prototypes);
            nih_list_init (&structs);
            nih_list_init (&typedefs);
            nih_list_init (&externs);

            TEST_ALLOC_SAFE {
                  node = node_new (NULL, NULL);

                  interface = interface_new (node, "com.netsplit.Nih.Test");
                  interface->symbol = "test";
                  nih_list_add (&node->interfaces, &interface->entry);

                  signal = signal_new (interface, "Bounce");
                  signal->symbol = "bounce";
                  nih_list_add (&interface->signals, &signal->entry);

                  argument = argument_new (signal, "height",
                                     "u", NIH_DBUS_ARG_OUT);
                  argument->symbol = "height";
                  nih_list_add (&signal->arguments, &argument->entry);

                  argument = argument_new (signal, "velocity",
                                     "i", NIH_DBUS_ARG_OUT);
                  argument->symbol = "velocity";
                  nih_list_add (&signal->arguments, &argument->entry);

                  signal = signal_new (interface, "Exploded");
                  signal->symbol = "exploded";
                  nih_list_add (&interface->signals, &signal->entry);


                  property = property_new (interface, "colour",
                                     "s", NIH_DBUS_READWRITE);
                  property->symbol = "colour";
                  nih_list_add (&interface->properties, &property->entry);

                  property = property_new (interface, "size",
                                     "u", NIH_DBUS_READ);
                  property->symbol = "size";
                  nih_list_add (&interface->properties, &property->entry);

                  property = property_new (interface, "touch",
                                     "b", NIH_DBUS_WRITE);
                  property->symbol = "touch";
                  nih_list_add (&interface->properties, &property->entry);


                  interface = interface_new (node, "com.netsplit.Nih.Foo");
                  interface->symbol = "foo";
                  nih_list_add (&node->interfaces, &interface->entry);

                  signal = signal_new (interface, "NewResult");
                  signal->symbol = "new_result";
                  nih_list_add (&interface->signals, &signal->entry);
            }

            str = node_proxy_functions (NULL, "my", node,
                                  &prototypes,
                                  &structs, &typedefs, &externs);

            if (test_alloc_failed) {
                  TEST_EQ_P (str, NULL);
                  TEST_LIST_EMPTY (&prototypes);
                  TEST_LIST_EMPTY (&structs);
                  TEST_LIST_EMPTY (&typedefs);
                  TEST_LIST_EMPTY (&externs);

                  nih_free (node);
                  continue;
            }

            TEST_EXPECTED_STR (str, "test_node_proxy_functions_no_methods.c");

            /* Bounce */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static DBusHandlerResult");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_Bounce_signal");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusConnection *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "connection");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "signal");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxySignal *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxied");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestBounceHandler)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "height");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "velocity");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* Exploded */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static DBusHandlerResult");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_Exploded_signal");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusConnection *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "connection");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "signal");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxySignal *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxied");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestExplodedHandler)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* colour (get) */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_colour");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestGetColourReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_colour_get_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestGetColourReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_colour_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "char **");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* colour (set) */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_colour");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestSetColourReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_colour_set_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestSetColourReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_colour_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* size (get) */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_size");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestGetSizeReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_size_get_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestGetSizeReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_size_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* touch (set) */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_touch");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestSetTouchReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_touch_set_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestSetTouchReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_touch_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* Get All */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_all");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestGetAllReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_get_all_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestGetAllReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const MyTestProperties *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "properties");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_all_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestProperties **");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "properties");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&structs);

            structure = (TypeStruct *)structs.next;
            TEST_ALLOC_SIZE (structure, sizeof (TypeStruct));
            TEST_ALLOC_PARENT (structure, str);
            TEST_EQ_STR (structure->name, "MyTestProperties");
            TEST_ALLOC_PARENT (structure->name, structure);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "char *");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "colour");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "uint32_t");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "size");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_EMPTY (&structure->members);
            nih_free (structure);


            /* NewResult */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static DBusHandlerResult");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Foo_NewResult_signal");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusConnection *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "connection");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "signal");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxySignal *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxied");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyFooNewResultHandler)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_EMPTY (&prototypes);
            TEST_LIST_EMPTY (&structs);
            TEST_LIST_EMPTY (&typedefs);
            TEST_LIST_EMPTY (&externs);

            nih_free (str);
            nih_free (node);
      }


      /* Check that we can still generate all of the functions even if
       * there are no signals in the object implementation.
       */
      TEST_FEATURE ("with no signals");
      TEST_ALLOC_FAIL {
            nih_list_init (&prototypes);
            nih_list_init (&structs);
            nih_list_init (&typedefs);
            nih_list_init (&externs);

            TEST_ALLOC_SAFE {
                  node = node_new (NULL, NULL);

                  interface = interface_new (node, "com.netsplit.Nih.Test");
                  interface->symbol = "test";
                  nih_list_add (&node->interfaces, &interface->entry);

                  method = method_new (interface, "Poke");
                  method->symbol = "poke";
                  nih_list_add (&interface->methods, &method->entry);

                  argument = argument_new (method, "address",
                                     "u", NIH_DBUS_ARG_IN);
                  argument->symbol = "address";
                  nih_list_add (&method->arguments, &argument->entry);

                  argument = argument_new (method, "value",
                                     "s", NIH_DBUS_ARG_IN);
                  argument->symbol = "value";
                  nih_list_add (&method->arguments, &argument->entry);

                  method = method_new (interface, "Peek");
                  method->symbol = "peek";
                  nih_list_add (&interface->methods, &method->entry);

                  argument = argument_new (method, "address",
                                     "u", NIH_DBUS_ARG_IN);
                  argument->symbol = "address";
                  nih_list_add (&method->arguments, &argument->entry);

                  argument = argument_new (method, "value",
                                     "s", NIH_DBUS_ARG_OUT);
                  argument->symbol = "value";
                  nih_list_add (&method->arguments, &argument->entry);

                  method = method_new (interface, "IsValidAddress");
                  method->symbol = "is_valid_address";
                  nih_list_add (&interface->methods, &method->entry);

                  argument = argument_new (method, "address",
                                     "u", NIH_DBUS_ARG_IN);
                  argument->symbol = "address";
                  nih_list_add (&method->arguments, &argument->entry);


                  property = property_new (interface, "colour",
                                     "s", NIH_DBUS_READWRITE);
                  property->symbol = "colour";
                  nih_list_add (&interface->properties, &property->entry);

                  property = property_new (interface, "size",
                                     "u", NIH_DBUS_READ);
                  property->symbol = "size";
                  nih_list_add (&interface->properties, &property->entry);

                  property = property_new (interface, "touch",
                                     "b", NIH_DBUS_WRITE);
                  property->symbol = "touch";
                  nih_list_add (&interface->properties, &property->entry);


                  interface = interface_new (node, "com.netsplit.Nih.Foo");
                  interface->symbol = "foo";
                  nih_list_add (&node->interfaces, &interface->entry);

                  method = method_new (interface, "Bing");
                  method->symbol = "bing";
                  nih_list_add (&interface->methods, &method->entry);
            }

            str = node_proxy_functions (NULL, "my", node,
                                  &prototypes,
                                  &structs, &typedefs, &externs);

            if (test_alloc_failed) {
                  TEST_EQ_P (str, NULL);
                  TEST_LIST_EMPTY (&prototypes);
                  TEST_LIST_EMPTY (&structs);
                  TEST_LIST_EMPTY (&typedefs);
                  TEST_LIST_EMPTY (&externs);

                  nih_free (node);
                  continue;
            }

            TEST_EXPECTED_STR (str, "test_node_proxy_functions_no_signals.c");

            /* Poke */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_poke");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "address");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestPokeReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_Poke_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestPokeReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_poke_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "address");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* Peek */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_peek");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "address");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestPeekReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_Peek_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestPeekReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_peek_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "address");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "char **");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* IsValidAddress */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_is_valid_address");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "address");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestIsValidAddressReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_IsValidAddress_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestIsValidAddressReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_is_valid_address_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "address");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* colour (get) */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_colour");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestGetColourReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_colour_get_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestGetColourReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_colour_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "char **");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* colour (set) */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_colour");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestSetColourReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_colour_set_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestSetColourReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_colour_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* size (get) */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_size");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestGetSizeReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_size_get_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestGetSizeReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_size_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* touch (set) */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_touch");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestSetTouchReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_touch_set_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestSetTouchReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_touch_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* Get All */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_all");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestGetAllReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_get_all_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestGetAllReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const MyTestProperties *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "properties");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_all_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestProperties **");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "properties");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&structs);

            structure = (TypeStruct *)structs.next;
            TEST_ALLOC_SIZE (structure, sizeof (TypeStruct));
            TEST_ALLOC_PARENT (structure, str);
            TEST_EQ_STR (structure->name, "MyTestProperties");
            TEST_ALLOC_PARENT (structure->name, structure);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "char *");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "colour");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "uint32_t");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "size");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_EMPTY (&structure->members);
            nih_free (structure);


            /* Bing */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_foo_bing");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyFooBingReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Foo_Bing_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyFooBingReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_foo_bing_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_EMPTY (&prototypes);
            TEST_LIST_EMPTY (&structs);
            TEST_LIST_EMPTY (&typedefs);
            TEST_LIST_EMPTY (&externs);

            nih_free (str);
            nih_free (node);
      }


      /* Check that we can still generate all of the functions even if
       * there are no prototypes in the object implementation.
       */
      TEST_FEATURE ("with no properties");
      TEST_ALLOC_FAIL {
            nih_list_init (&prototypes);
            nih_list_init (&structs);
            nih_list_init (&typedefs);
            nih_list_init (&externs);

            TEST_ALLOC_SAFE {
                  node = node_new (NULL, NULL);

                  interface = interface_new (node, "com.netsplit.Nih.Test");
                  interface->symbol = "test";
                  nih_list_add (&node->interfaces, &interface->entry);

                  method = method_new (interface, "Poke");
                  method->symbol = "poke";
                  nih_list_add (&interface->methods, &method->entry);

                  argument = argument_new (method, "address",
                                     "u", NIH_DBUS_ARG_IN);
                  argument->symbol = "address";
                  nih_list_add (&method->arguments, &argument->entry);

                  argument = argument_new (method, "value",
                                     "s", NIH_DBUS_ARG_IN);
                  argument->symbol = "value";
                  nih_list_add (&method->arguments, &argument->entry);

                  method = method_new (interface, "Peek");
                  method->symbol = "peek";
                  nih_list_add (&interface->methods, &method->entry);

                  argument = argument_new (method, "address",
                                     "u", NIH_DBUS_ARG_IN);
                  argument->symbol = "address";
                  nih_list_add (&method->arguments, &argument->entry);

                  argument = argument_new (method, "value",
                                     "s", NIH_DBUS_ARG_OUT);
                  argument->symbol = "value";
                  nih_list_add (&method->arguments, &argument->entry);

                  method = method_new (interface, "IsValidAddress");
                  method->symbol = "is_valid_address";
                  nih_list_add (&interface->methods, &method->entry);

                  argument = argument_new (method, "address",
                                     "u", NIH_DBUS_ARG_IN);
                  argument->symbol = "address";
                  nih_list_add (&method->arguments, &argument->entry);


                  signal = signal_new (interface, "Bounce");
                  signal->symbol = "bounce";
                  nih_list_add (&interface->signals, &signal->entry);

                  argument = argument_new (signal, "height",
                                     "u", NIH_DBUS_ARG_OUT);
                  argument->symbol = "height";
                  nih_list_add (&signal->arguments, &argument->entry);

                  argument = argument_new (signal, "velocity",
                                     "i", NIH_DBUS_ARG_OUT);
                  argument->symbol = "velocity";
                  nih_list_add (&signal->arguments, &argument->entry);

                  signal = signal_new (interface, "Exploded");
                  signal->symbol = "exploded";
                  nih_list_add (&interface->signals, &signal->entry);


                  interface = interface_new (node, "com.netsplit.Nih.Foo");
                  interface->symbol = "foo";
                  nih_list_add (&node->interfaces, &interface->entry);

                  method = method_new (interface, "Bing");
                  method->symbol = "bing";
                  nih_list_add (&interface->methods, &method->entry);

                  signal = signal_new (interface, "NewResult");
                  signal->symbol = "new_result";
                  nih_list_add (&interface->signals, &signal->entry);
            }

            str = node_proxy_functions (NULL, "my", node,
                                  &prototypes,
                                  &structs, &typedefs, &externs);

            if (test_alloc_failed) {
                  TEST_EQ_P (str, NULL);
                  TEST_LIST_EMPTY (&prototypes);
                  TEST_LIST_EMPTY (&structs);
                  TEST_LIST_EMPTY (&typedefs);
                  TEST_LIST_EMPTY (&externs);

                  nih_free (node);
                  continue;
            }

            TEST_EXPECTED_STR (str, "test_node_proxy_functions_no_properties.c");

            /* Poke */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_poke");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "address");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestPokeReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_Poke_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestPokeReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_poke_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "address");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* Peek */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_peek");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "address");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestPeekReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_Peek_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestPeekReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_peek_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "address");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "char **");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* IsValidAddress */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_is_valid_address");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "address");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestIsValidAddressReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_IsValidAddress_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestIsValidAddressReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_is_valid_address_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "address");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* Bounce */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static DBusHandlerResult");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_Bounce_signal");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusConnection *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "connection");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "signal");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxySignal *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxied");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestBounceHandler)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "height");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "velocity");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* Exploded */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static DBusHandlerResult");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_Exploded_signal");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusConnection *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "connection");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "signal");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxySignal *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxied");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestExplodedHandler)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* Bing */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_foo_bing");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyFooBingReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Foo_Bing_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyFooBingReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_foo_bing_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* NewResult */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static DBusHandlerResult");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Foo_NewResult_signal");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusConnection *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "connection");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "signal");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxySignal *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxied");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyFooNewResultHandler)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_EMPTY (&prototypes);
            TEST_LIST_EMPTY (&structs);
            TEST_LIST_EMPTY (&typedefs);
            TEST_LIST_EMPTY (&externs);

            nih_free (str);
            nih_free (node);
      }


      /* Check that we can still generate all of the functions even if
       * there are no methods or signals in the object implementation.
       */
      TEST_FEATURE ("with no methods or signals");
      TEST_ALLOC_FAIL {
            nih_list_init (&prototypes);
            nih_list_init (&structs);
            nih_list_init (&typedefs);
            nih_list_init (&externs);

            TEST_ALLOC_SAFE {
                  node = node_new (NULL, NULL);

                  interface = interface_new (node, "com.netsplit.Nih.Test");
                  interface->symbol = "test";
                  nih_list_add (&node->interfaces, &interface->entry);

                  property = property_new (interface, "colour",
                                     "s", NIH_DBUS_READWRITE);
                  property->symbol = "colour";
                  nih_list_add (&interface->properties, &property->entry);

                  property = property_new (interface, "size",
                                     "u", NIH_DBUS_READ);
                  property->symbol = "size";
                  nih_list_add (&interface->properties, &property->entry);

                  property = property_new (interface, "touch",
                                     "b", NIH_DBUS_WRITE);
                  property->symbol = "touch";
                  nih_list_add (&interface->properties, &property->entry);


                  interface = interface_new (node, "com.netsplit.Nih.Foo");
                  interface->symbol = "foo";
                  nih_list_add (&node->interfaces, &interface->entry);
            }

            str = node_proxy_functions (NULL, "my", node,
                                  &prototypes,
                                  &structs, &typedefs, &externs);

            if (test_alloc_failed) {
                  TEST_EQ_P (str, NULL);
                  TEST_LIST_EMPTY (&prototypes);
                  TEST_LIST_EMPTY (&structs);
                  TEST_LIST_EMPTY (&typedefs);
                  TEST_LIST_EMPTY (&externs);

                  nih_free (node);
                  continue;
            }

            TEST_EXPECTED_STR (str, "test_node_proxy_functions_only_properties.c");

            /* colour (get) */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_colour");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestGetColourReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_colour_get_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestGetColourReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_colour_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "char **");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* colour (set) */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_colour");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestSetColourReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_colour_set_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestSetColourReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_colour_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const char *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* size (get) */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_size");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestGetSizeReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_size_get_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestGetSizeReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_size_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "uint32_t *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* touch (set) */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_touch");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestSetTouchReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_touch_set_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestSetTouchReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_touch_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* Get All */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_all");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestGetAllReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_get_all_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestGetAllReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const MyTestProperties *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "properties");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_all_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestProperties **");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "properties");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&structs);

            structure = (TypeStruct *)structs.next;
            TEST_ALLOC_SIZE (structure, sizeof (TypeStruct));
            TEST_ALLOC_PARENT (structure, str);
            TEST_EQ_STR (structure->name, "MyTestProperties");
            TEST_ALLOC_PARENT (structure->name, structure);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "char *");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "colour");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "uint32_t");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "size");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_EMPTY (&structure->members);
            nih_free (structure);


            TEST_LIST_EMPTY (&prototypes);
            TEST_LIST_EMPTY (&structs);
            TEST_LIST_EMPTY (&typedefs);
            TEST_LIST_EMPTY (&externs);

            nih_free (str);
            nih_free (node);
      }


      /* Check that methods, signals and properties with structure
       * arguments all pass the struct definitions back in the structs
       * list.  Make sure that output arguments from an async method
       * call aren't duplicated and make sure those from readwrite
       * properties aren't duplicated while read and write only are
       * still returned.
       */
      TEST_FEATURE ("with structure arguments");
      TEST_ALLOC_FAIL {
            nih_list_init (&prototypes);
            nih_list_init (&structs);
            nih_list_init (&typedefs);
            nih_list_init (&externs);

            TEST_ALLOC_SAFE {
                  node = node_new (NULL, NULL);

                  interface = interface_new (node, "com.netsplit.Nih.Test");
                  interface->symbol = "test";
                  nih_list_add (&node->interfaces, &interface->entry);

                  method = method_new (interface, "Search");
                  method->async = TRUE;
                  method->symbol = "search";
                  nih_list_add (&interface->methods, &method->entry);

                  argument = argument_new (method, "item",
                                     "(su)", NIH_DBUS_ARG_IN);
                  argument->symbol = "item";
                  nih_list_add (&method->arguments, &argument->entry);

                  argument = argument_new (method, "result",
                                     "(ss)", NIH_DBUS_ARG_OUT);
                  argument->symbol = "result";
                  nih_list_add (&method->arguments, &argument->entry);


                  signal = signal_new (interface, "NewSearch");
                  signal->symbol = "new_search";
                  nih_list_add (&interface->signals, &signal->entry);

                  argument = argument_new (signal, "query",
                                     "(ssu)", NIH_DBUS_ARG_OUT);
                  argument->symbol = "query";
                  nih_list_add (&signal->arguments, &argument->entry);


                  property = property_new (interface, "last_search",
                                     "(su)", NIH_DBUS_READ);
                  property->symbol = "last_search";
                  nih_list_add (&interface->properties, &property->entry);

                  property = property_new (interface, "annotation",
                                     "(ss)", NIH_DBUS_WRITE);
                  property->symbol = "annotation";
                  nih_list_add (&interface->properties, &property->entry);

                  property = property_new (interface, "preferences",
                                     "(us)", NIH_DBUS_READWRITE);
                  property->symbol = "preferences";
                  nih_list_add (&interface->properties, &property->entry);
            }

            str = node_proxy_functions (NULL, "my", node,
                                  &prototypes,
                                  &structs, &typedefs, &externs);

            if (test_alloc_failed) {
                  TEST_EQ_P (str, NULL);
                  TEST_LIST_EMPTY (&prototypes);
                  TEST_LIST_EMPTY (&structs);
                  TEST_LIST_EMPTY (&typedefs);
                  TEST_LIST_EMPTY (&externs);

                  nih_free (node);
                  continue;
            }

            TEST_EXPECTED_STR (str, "test_node_proxy_functions_structure.c");

            /* Search */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_search");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const MyTestSearchItem *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "item");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestSearchReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_Search_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestSearchReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const MyTestSearchResult *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "result");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_search_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const MyTestSearchItem *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "item");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestSearchResult **");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "result");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&structs);

            structure = (TypeStruct *)structs.next;
            TEST_ALLOC_SIZE (structure, sizeof (TypeStruct));
            TEST_ALLOC_PARENT (structure, str);
            TEST_EQ_STR (structure->name, "MyTestSearchItem");
            TEST_ALLOC_PARENT (structure->name, structure);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "char *");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "item0");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "uint32_t");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "item1");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_EMPTY (&structure->members);
            nih_free (structure);


            TEST_LIST_NOT_EMPTY (&structs);

            structure = (TypeStruct *)structs.next;
            TEST_ALLOC_SIZE (structure, sizeof (TypeStruct));
            TEST_ALLOC_PARENT (structure, str);
            TEST_EQ_STR (structure->name, "MyTestSearchResult");
            TEST_ALLOC_PARENT (structure->name, structure);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "char *");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "item0");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "char *");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "item1");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_EMPTY (&structure->members);
            nih_free (structure);


            /* NewSearch */
            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static DBusHandlerResult");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_NewSearch_signal");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusConnection *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "connection");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "signal");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxySignal *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxied");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestNewSearchHandler)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const MyTestNewSearchQuery *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "query");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&structs);

            structure = (TypeStruct *)structs.next;
            TEST_ALLOC_SIZE (structure, sizeof (TypeStruct));
            TEST_ALLOC_PARENT (structure, str);
            TEST_EQ_STR (structure->name, "MyTestNewSearchQuery");
            TEST_ALLOC_PARENT (structure->name, structure);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "char *");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "item0");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "char *");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "item1");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "uint32_t");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "item2");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_EMPTY (&structure->members);
            nih_free (structure);


            /* last_search (get) */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_last_search");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestGetLastSearchReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_last_search_get_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestGetLastSearchReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const MyTestLastSearch *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_last_search_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestLastSearch **");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* annotation (set) */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_annotation");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const MyTestAnnotation *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestSetAnnotationReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_annotation_set_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestSetAnnotationReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_annotation_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const MyTestAnnotation *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&structs);

            structure = (TypeStruct *)structs.next;
            TEST_ALLOC_SIZE (structure, sizeof (TypeStruct));
            TEST_ALLOC_PARENT (structure, str);
            TEST_EQ_STR (structure->name, "MyTestAnnotation");
            TEST_ALLOC_PARENT (structure->name, structure);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "char *");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "item0");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "char *");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "item1");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_EMPTY (&structure->members);
            nih_free (structure);


            /* preferences (get) */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_preferences");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestGetPreferencesReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_preferences_get_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestGetPreferencesReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const MyTestPreferences *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_preferences_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestPreferences **");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* preferences (set) */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_preferences");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const MyTestPreferences *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestSetPreferencesReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_preferences_set_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestSetPreferencesReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_set_preferences_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const MyTestPreferences *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "value");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            /* Get All */
            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_all");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestGetAllReply");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusErrorHandler");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "error_handler");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "int");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "timeout");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&prototypes);

            func = (TypeFunc *)prototypes.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "static void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_com_netsplit_Nih_Test_get_all_notify");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "DBusPendingCall *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_call");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusPendingData *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "pending_data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&typedefs);

            func = (TypeFunc *)typedefs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "typedef void");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "(*MyTestGetAllReply)");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "data");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusMessage *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "message");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const MyTestProperties *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "properties");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&externs);

            func = (TypeFunc *)externs.next;
            TEST_ALLOC_SIZE (func, sizeof (TypeFunc));
            TEST_ALLOC_PARENT (func, str);
            TEST_EQ_STR (func->type, "int");
            TEST_ALLOC_PARENT (func->type, func);
            TEST_EQ_STR (func->name, "my_test_get_all_sync");
            TEST_ALLOC_PARENT (func->name, func);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "const void *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "parent");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "NihDBusProxy *");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "proxy");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);

            TEST_LIST_NOT_EMPTY (&func->args);

            arg = (TypeVar *)func->args.next;
            TEST_ALLOC_SIZE (arg, sizeof (TypeVar));
            TEST_ALLOC_PARENT (arg, func);
            TEST_EQ_STR (arg->type, "MyTestProperties **");
            TEST_ALLOC_PARENT (arg->type, arg);
            TEST_EQ_STR (arg->name, "properties");
            TEST_ALLOC_PARENT (arg->name, arg);
            nih_free (arg);
            TEST_LIST_EMPTY (&func->args);

            TEST_LIST_NOT_EMPTY (&func->attribs);

            attrib = (NihListEntry *)func->attribs.next;
            TEST_ALLOC_SIZE (attrib, sizeof (NihListEntry *));
            TEST_ALLOC_PARENT (attrib, func);
            TEST_EQ_STR (attrib->str, "warn_unused_result");
            TEST_ALLOC_PARENT (attrib->str, attrib);
            nih_free (attrib);

            TEST_LIST_EMPTY (&func->attribs);
            nih_free (func);


            TEST_LIST_NOT_EMPTY (&structs);

            structure = (TypeStruct *)structs.next;
            TEST_ALLOC_SIZE (structure, sizeof (TypeStruct));
            TEST_ALLOC_PARENT (structure, str);
            TEST_EQ_STR (structure->name, "MyTestLastSearch");
            TEST_ALLOC_PARENT (structure->name, structure);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "char *");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "item0");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "uint32_t");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "item1");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_EMPTY (&structure->members);
            nih_free (structure);


            TEST_LIST_NOT_EMPTY (&structs);

            structure = (TypeStruct *)structs.next;
            TEST_ALLOC_SIZE (structure, sizeof (TypeStruct));
            TEST_ALLOC_PARENT (structure, str);
            TEST_EQ_STR (structure->name, "MyTestPreferences");
            TEST_ALLOC_PARENT (structure->name, structure);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "uint32_t");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "item0");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "char *");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "item1");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_EMPTY (&structure->members);
            nih_free (structure);


            TEST_LIST_NOT_EMPTY (&structs);

            structure = (TypeStruct *)structs.next;
            TEST_ALLOC_SIZE (structure, sizeof (TypeStruct));
            TEST_ALLOC_PARENT (structure, str);
            TEST_EQ_STR (structure->name, "MyTestProperties");
            TEST_ALLOC_PARENT (structure->name, structure);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "MyTestLastSearch *");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "last_search");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_NOT_EMPTY (&structure->members);

            var = (TypeVar *)structure->members.next;
            TEST_ALLOC_SIZE (var, sizeof (TypeVar));
            TEST_ALLOC_PARENT (var, structure);
            TEST_EQ_STR (var->type, "MyTestPreferences *");
            TEST_ALLOC_PARENT (var->type, var);
            TEST_EQ_STR (var->name, "preferences");
            TEST_ALLOC_PARENT (var->name, var);
            nih_free (var);

            TEST_LIST_EMPTY (&structure->members);
            nih_free (structure);


            TEST_LIST_EMPTY (&prototypes);
            TEST_LIST_EMPTY (&structs);
            TEST_LIST_EMPTY (&typedefs);
            TEST_LIST_EMPTY (&externs);

            nih_free (str);
            nih_free (node);
      }


      /* Check that when there are no interface members, an empty string
       * is returned.
       */
      TEST_FEATURE ("with no members");
      TEST_ALLOC_FAIL {
            nih_list_init (&prototypes);
            nih_list_init (&structs);
            nih_list_init (&typedefs);
            nih_list_init (&externs);

            TEST_ALLOC_SAFE {
                  node = node_new (NULL, NULL);

                  interface = interface_new (node, "com.netsplit.Nih.Test");
                  interface->symbol = "test";
                  nih_list_add (&node->interfaces, &interface->entry);

                  interface = interface_new (node, "com.netsplit.Nih.Foo");
                  interface->symbol = "foo";
                  nih_list_add (&node->interfaces, &interface->entry);
            }

            str = node_proxy_functions (NULL, "my", node,
                                  &prototypes,
                                  &structs, &typedefs, &externs);

            if (test_alloc_failed) {
                  TEST_EQ_P (str, NULL);
                  TEST_LIST_EMPTY (&prototypes);
                  TEST_LIST_EMPTY (&structs);
                  TEST_LIST_EMPTY (&typedefs);
                  TEST_LIST_EMPTY (&externs);

                  nih_free (node);
                  continue;
            }

            TEST_EQ_STR (str, "");

            TEST_LIST_EMPTY (&prototypes);
            TEST_LIST_EMPTY (&structs);
            TEST_LIST_EMPTY (&typedefs);
            TEST_LIST_EMPTY (&externs);

            nih_free (str);
            nih_free (node);
      }


      /* Check that when there are no interfaces, an empty string
       * is returned.
       */
      TEST_FEATURE ("with no interfaces");
      TEST_ALLOC_FAIL {
            nih_list_init (&prototypes);
            nih_list_init (&structs);
            nih_list_init (&typedefs);
            nih_list_init (&externs);

            TEST_ALLOC_SAFE {
                  node = node_new (NULL, NULL);
            }

            str = node_proxy_functions (NULL, "my", node,
                                  &prototypes,
                                  &structs, &typedefs, &externs);

            if (test_alloc_failed) {
                  TEST_EQ_P (str, NULL);
                  TEST_LIST_EMPTY (&prototypes);
                  TEST_LIST_EMPTY (&structs);
                  TEST_LIST_EMPTY (&typedefs);
                  TEST_LIST_EMPTY (&externs);

                  nih_free (node);
                  continue;
            }

            TEST_EQ_STR (str, "");

            TEST_LIST_EMPTY (&prototypes);
            TEST_LIST_EMPTY (&structs);
            TEST_LIST_EMPTY (&typedefs);
            TEST_LIST_EMPTY (&externs);

            nih_free (str);
            nih_free (node);
      }
}


int
main (int   argc,
      char *argv[])
{
      program_name = "test";
      nih_error_init ();

      test_path_valid ();
      test_new ();
      test_start_tag ();
      test_end_tag ();
      test_lookup_interface ();

      test_interfaces_array ();
      test_object_functions ();
      test_proxy_functions ();

      return 0;
}

Generated by  Doxygen 1.6.0   Back to index