mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 22:16:16 +01:00
Fix some glib docs warnings
Remove some symbols from glib-sections.txt that gtk-doc has no idea about. Add proper callback typedefs for GTester (gtk-doc dislikes inline function types). Fix some other minor issues.
This commit is contained in:
parent
dc8cf867c8
commit
7791fce38a
@ -1168,6 +1168,7 @@ g_mapped_file_get_contents
|
||||
g_open
|
||||
g_rename
|
||||
g_mkdir
|
||||
GStatBuf
|
||||
g_stat
|
||||
g_lstat
|
||||
g_unlink
|
||||
@ -1399,7 +1400,6 @@ g_date_sunday_week_of_year
|
||||
g_date_days_in_month
|
||||
g_date_monday_weeks_in_year
|
||||
g_date_sunday_weeks_in_year
|
||||
tm
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@ -2654,7 +2654,9 @@ g_test_perf
|
||||
g_test_verbose
|
||||
g_test_quiet
|
||||
g_test_run
|
||||
GTestFunc
|
||||
g_test_add_func
|
||||
GTestDataFunc
|
||||
g_test_add_data_func
|
||||
g_test_add
|
||||
|
||||
@ -2701,6 +2703,7 @@ g_assert_error
|
||||
|
||||
GTestCase
|
||||
GTestSuite
|
||||
GTestFixtureFunc
|
||||
g_test_create_case
|
||||
g_test_create_suite
|
||||
g_test_get_root
|
||||
@ -2718,7 +2721,6 @@ g_assertion_message_error
|
||||
|
||||
g_test_add_vtable
|
||||
GTestConfig
|
||||
g_test_config_vars
|
||||
GTestLogType
|
||||
GTestLogMsg
|
||||
GTestLogBuffer
|
||||
@ -2757,6 +2759,9 @@ G_VARIANT_TYPE_TUPLE
|
||||
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
|
||||
|
@ -382,6 +382,12 @@ not be accessed directly.
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### TYPEDEF GStatBuf ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### FUNCTION g_stat ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -150,13 +150,29 @@ Returns %TRUE if tests are run in quiet mode.
|
||||
@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 ##### -->
|
||||
@ -166,7 +182,7 @@ Returns %TRUE if tests are run in quiet mode.
|
||||
|
||||
@testpath:
|
||||
@test_data:
|
||||
@gconstpointer:
|
||||
@test_func:
|
||||
|
||||
|
||||
<!-- ##### MACRO g_test_add ##### -->
|
||||
@ -597,6 +613,15 @@ An opaque structure representing a test suite.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### USER_FUNCTION GTestFixtureFunc ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@fixture:
|
||||
@user_data:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION g_test_create_case ##### -->
|
||||
<para>
|
||||
|
||||
@ -605,9 +630,9 @@ An opaque structure representing a test suite.
|
||||
@test_name:
|
||||
@data_size:
|
||||
@test_data:
|
||||
@void:
|
||||
@void:
|
||||
@void:
|
||||
@data_setup:
|
||||
@data_test:
|
||||
@data_teardown:
|
||||
@Returns:
|
||||
|
||||
|
||||
|
@ -425,6 +425,14 @@ g_chdir (const gchar *path)
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
|
@ -1664,10 +1664,10 @@ g_strlcpy (gchar *dest,
|
||||
* 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,
|
||||
@ -3216,7 +3216,7 @@ g_dgettext (const gchar *domain,
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
@ -906,12 +906,12 @@ g_test_run (void)
|
||||
* 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);
|
||||
@ -928,13 +928,29 @@ g_test_create_case (const char *test_name,
|
||||
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;
|
||||
@ -969,6 +985,11 @@ g_test_add_vtable (const char *testpath,
|
||||
g_strfreev (segments);
|
||||
}
|
||||
|
||||
/**
|
||||
* GTestFunc:
|
||||
*
|
||||
* The type used for test case functions.
|
||||
**/
|
||||
/**
|
||||
* g_test_add_func:
|
||||
* @testpath: Slash-separated test case path name for the test.
|
||||
@ -982,15 +1003,22 @@ g_test_add_vtable (const char *testpath,
|
||||
* 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.
|
||||
@ -1008,12 +1036,12 @@ g_test_add_func (const char *testpath,
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -34,6 +34,10 @@ G_BEGIN_DECLS
|
||||
|
||||
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); \
|
||||
@ -98,10 +102,12 @@ void g_test_init (int *argc,
|
||||
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 { \
|
||||
@ -158,13 +164,13 @@ double g_test_rand_double_range (double range_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);
|
||||
@ -217,9 +223,9 @@ void g_assertion_message_error (const char *domain,
|
||||
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 */
|
||||
|
@ -95,7 +95,7 @@
|
||||
(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
|
||||
|
@ -1392,7 +1392,7 @@ g_variant_dup_bytestring (GVariant *value,
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user