--- /dev/null
+/* Copyright (C) 2003 TSUTSUMI Kikuo.
+ This file is part of the CCUnit Library.
+
+ The CCUnit Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ The CCUnit Library 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 Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the CCUnit Library; see the file COPYING.LESSER.
+ If not, write to the Free Software Foundation, Inc., 59 Temple
+ Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+/*
+ * $Id$
+ */
+
+#include <stdlib.h>
+#include <CCUnit/CCUnitConfig.h>
+#include <CCUnit/CCUnitTestFixture.h>
+
+CCUnitTestFixture* ccunit_newTestFixture (const char* name,
+ const char* desc,
+ void (*runTest)())
+{
+ CCUnitTestFixture* fixture = calloc (1, sizeof (*fixture));
+ fixture->name = safe_strdup (name);
+ fixture->desc = !desc ? safe_strdup (name) : strdup (desc);
+ fixture->runTest = runTest;
+ return fixture;
+}
+
+void ccunit_deleteTestFixture (CCUnitTestFixture* fixture)
+{
+ if (!fixture)
+ return;
+ safe_free ((char*)fixture->name);
+ safe_free ((char*)fixture->desc);
+ free (fixture);
+}
--- /dev/null
+/* -*- mode: C; -*- */
+/* Copyright (C) 2003 TSUTSUMI Kikuo.
+ This file is part of the CCUnit Library.
+
+ The CCUnit Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ The CCUnit Library 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 Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the CCUnit Library; see the file COPYING.LESSER.
+ If not, write to the Free Software Foundation, Inc., 59 Temple
+ Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+/*
+ * $Id$
+ */
+
+#ifndef TESTFIXTURE_H
+#define TESTFIXTURE_H
+
+/**
+ * test fixture
+ */
+typedef struct CCUnitTestFixture
+{
+ const char* name; /**< test case name */
+ const char* desc; /**< test description */
+ void (*runTest) (); /**< run test function */
+} CCUnitTestFixture;
+
+/**
+ * create new test fixture.
+ * @param name fixture name.
+ * @param desc fixture description.
+ * @param runTest run test function.
+ * @return new test fixture
+ */
+extern CCUnitTestFixture* ccunit_newTestFixture (const char* name,
+ const char* desc,
+ void (*runTest)());
+
+/**
+ * delete test fixture.
+ * @param fixture deleting fixture.
+ */
+extern void ccunit_deleteTestFixture (CCUnitTestFixture* fixture);
+
+#endif /* !TESTFIXTURE_H */