g_open
g_rename
g_mkdir
+GStatBuf
g_stat
g_lstat
g_unlink
g_date_days_in_month
g_date_monday_weeks_in_year
g_date_sunday_weeks_in_year
-tm
</SECTION>
<SECTION>
g_test_verbose
g_test_quiet
g_test_run
+GTestFunc
g_test_add_func
+GTestDataFunc
g_test_add_data_func
g_test_add
GTestCase
GTestSuite
+GTestFixtureFunc
g_test_create_case
g_test_create_suite
g_test_get_root
g_test_add_vtable
GTestConfig
-g_test_config_vars
GTestLogType
GTestLogMsg
GTestLogBuffer
G_VARIANT_TYPE_UNIT
G_VARIANT_TYPE_DICT_ENTRY
G_VARIANT_TYPE_DICTIONARY
+G_VARIANT_TYPE_STRING_ARRAY
+G_VARIANT_TYPE_BYTESTRING
+G_VARIANT_TYPE_BYTESTRING_ARRAY
<SUBSECTION>
G_VARIANT_TYPE
@Returns:
+<!-- ##### TYPEDEF GStatBuf ##### -->
+<para>
+
+</para>
+
+
<!-- ##### FUNCTION g_stat ##### -->
<para>
@Returns:
+<!-- ##### USER_FUNCTION GTestFunc ##### -->
+<para>
+
+</para>
+
+@void:
+
+
<!-- ##### FUNCTION g_test_add_func ##### -->
<para>
</para>
@testpath:
-@void:
+@test_func:
+
+
+<!-- ##### USER_FUNCTION GTestDataFunc ##### -->
+<para>
+
+</para>
+
+@user_data:
<!-- ##### FUNCTION g_test_add_data_func ##### -->
@testpath:
@test_data:
-@gconstpointer:
+@test_func:
<!-- ##### MACRO g_test_add ##### -->
</para>
+<!-- ##### USER_FUNCTION GTestFixtureFunc ##### -->
+<para>
+
+</para>
+
+@fixture:
+@user_data:
+
+
<!-- ##### FUNCTION g_test_create_case ##### -->
<para>
@test_name:
@data_size:
@test_data:
-@void:
-@void:
-@void:
+@data_setup:
+@data_test:
+@data_teardown:
@Returns:
}
/**
+ * GStatBuf:
+ *
+ * A type corresponding to the appropriate struct type for the stat
+ * system call, depending on the platform and/or compiler being used.
+ *
+ * See g_stat() for more information.
+ **/
+/**
* g_stat:
* @filename: a pathname in the GLib file name encoding (UTF-8 on Windows)
* @buf: a pointer to a <structname>stat</structname> struct, which
* strcat() or strncat(), but for real security g_strconcat() is harder
* to mess up.</para></note>
*
- * Returns size of attempted result, which is
- * MIN (dest_size, strlen (original dest)) + strlen (src),
- * so if retval >= dest_size, truncation occurred.
- */
+ * Returns: size of attempted result, which is MIN (dest_size, strlen
+ * (original dest)) + strlen (src), so if retval >= dest_size,
+ * truncation occurred.
+ **/
gsize
g_strlcat (gchar *dest,
const gchar *src,
}
/**
- * g_dgettext:
+ * g_dcgettext:
* @domain: (allow-none): the translation domain to use, or %NULL to use
* the domain set with textdomain()
* @msgid: message to translate
* Since: 2.16
*/
GTestCase*
-g_test_create_case (const char *test_name,
- gsize data_size,
- gconstpointer test_data,
- void (*data_setup) (void),
- void (*data_test) (void),
- void (*data_teardown) (void))
+g_test_create_case (const char *test_name,
+ gsize data_size,
+ gconstpointer test_data,
+ GTestFixtureFunc data_setup,
+ GTestFixtureFunc data_test,
+ GTestFixtureFunc data_teardown)
{
GTestCase *tc;
g_return_val_if_fail (test_name != NULL, NULL);
return tc;
}
+/**
+ * GTestFixtureFunc:
+ * @fixture: the test fixture
+ * @user_data: the data provided when registering the test
+ *
+ * The type used for functions that operate on test fixtures. This is
+ * used for the fixture setup and teardown functions as well as for the
+ * testcases themselves.
+ *
+ * @user_data is a pointer to the data that was given when registering
+ * the test case.
+ *
+ * @fixture will be a pointer to the area of memory allocated by the
+ * test framework, of the size requested. If the requested size was
+ * zero then @fixture will be equal to @user_data.
+ **/
void
-g_test_add_vtable (const char *testpath,
- gsize data_size,
- gconstpointer test_data,
- void (*data_setup) (void),
- void (*fixture_test_func) (void),
- void (*data_teardown) (void))
+g_test_add_vtable (const char *testpath,
+ gsize data_size,
+ gconstpointer test_data,
+ GTestFixtureFunc data_setup,
+ GTestFixtureFunc fixture_test_func,
+ GTestFixtureFunc data_teardown)
{
gchar **segments;
guint ui;
}
/**
+ * GTestFunc:
+ *
+ * The type used for test case functions.
+ **/
+/**
* g_test_add_func:
* @testpath: Slash-separated test case path name for the test.
* @test_func: The test function to invoke for this test.
* Since: 2.16
*/
void
-g_test_add_func (const char *testpath,
- void (*test_func) (void))
+g_test_add_func (const char *testpath,
+ GTestFunc test_func)
{
g_return_if_fail (testpath != NULL);
g_return_if_fail (testpath[0] == '/');
g_return_if_fail (test_func != NULL);
- g_test_add_vtable (testpath, 0, NULL, NULL, test_func, NULL);
+ g_test_add_vtable (testpath, 0, NULL, NULL, (GTestFixtureFunc) test_func, NULL);
}
/**
+ * GTestDataFunc:
+ * @user_data: the data provided when registering the test
+ *
+ * The type used for test case functions that take an extra pointer
+ * argument.
+ **/
+/**
* g_test_add_data_func:
* @testpath: Slash-separated test case path name for the test.
* @test_data: Test data argument for the test function.
void
g_test_add_data_func (const char *testpath,
gconstpointer test_data,
- void (*test_func) (gconstpointer))
+ GTestDataFunc test_func)
{
g_return_if_fail (testpath != NULL);
g_return_if_fail (testpath[0] == '/');
g_return_if_fail (test_func != NULL);
- g_test_add_vtable (testpath, 0, test_data, NULL, (void(*)(void)) test_func, NULL);
+ g_test_add_vtable (testpath, 0, test_data, NULL, (GTestFixtureFunc) test_func, NULL);
}
/**
typedef struct GTestCase GTestCase;
typedef struct GTestSuite GTestSuite;
+typedef void (*GTestFunc) (void);
+typedef void (*GTestDataFunc) (gconstpointer user_data);
+typedef void (*GTestFixtureFunc) (gpointer fixture,
+ gconstpointer user_data);
/* assertion API */
#define g_assert_cmpstr(s1, cmp, s2) do { const char *__s1 = (s1), *__s2 = (s2); \
int g_test_run (void);
/* hook up a test functions under test path */
void g_test_add_func (const char *testpath,
- void (*test_func) (void));
+ GTestFunc test_func);
+
void g_test_add_data_func (const char *testpath,
gconstpointer test_data,
- void (*test_func) (gconstpointer));
+ GTestDataFunc test_func);
+
/* hook up a test with fixture under test path */
#define g_test_add(testpath, Fixture, tdata, fsetup, ftest, fteardown) \
G_STMT_START { \
double range_end);
/* semi-internal API */
-GTestCase* g_test_create_case (const char *test_name,
- gsize data_size,
- gconstpointer test_data,
- void (*data_setup) (void),
- void (*data_test) (void),
- void (*data_teardown) (void));
-GTestSuite* g_test_create_suite (const char *suite_name);
+GTestCase* g_test_create_case (const char *test_name,
+ gsize data_size,
+ gconstpointer test_data,
+ GTestFixtureFunc data_setup,
+ GTestFixtureFunc data_test,
+ GTestFixtureFunc data_teardown);
+GTestSuite* g_test_create_suite (const char *suite_name);
GTestSuite* g_test_get_root (void);
void g_test_suite_add (GTestSuite *suite,
GTestCase *test_case);
void g_test_add_vtable (const char *testpath,
gsize data_size,
gconstpointer test_data,
- void (*data_setup) (void),
- void (*data_test) (void),
- void (*data_teardown) (void));
+ GTestFixtureFunc data_setup,
+ GTestFixtureFunc data_test,
+ GTestFixtureFunc data_teardown);
typedef struct {
gboolean test_initialized;
gboolean test_quick; /* disable thorough tests */
(Result) |= ((Chars)[(Count)] & 0x3f); \
}
-/**
+/*
* Check whether a Unicode (5.2) char is in a valid range.
*
* The first check comes from the Unicode guarantee to never encode
/**
* g_variant_new_bytestring_array:
- * @strv (array length=length): an array of strings
+ * @strv: (array length=length): an array of strings
* @length: the length of @strv, or -1
* @returns: a new floating #GVariant instance
*