Function

GLibtest_get_filename

Declaration [src]

const gchar*
g_test_get_filename (
  GTestFileType file_type,
  const gchar* first_path,
  ...
)

Description [src]

Gets the pathname to a data file that is required for a test.

This is the same as g_test_build_filename() with two differences. The first difference is that must only use this function from within a testcase function. The second difference is that you need not free the return value — it will be automatically freed when the testcase finishes running.

It is safe to use this function from a thread inside of a testcase but you must ensure that all such uses occur before the main testcase function returns (ie: it is best to ensure that all threads have been joined).

Available since:2.38

Parameters

file_type GTestFileType
 

The type of file (built vs. distributed)

first_path const gchar*
 

The first segment of the pathname.

 The data is owned by the caller of the function.
 The string is a NUL terminated UTF-8 string.
...
 

NULL-terminated additional path segments.

Return value

Returns: const gchar*
 

The path, automatically freed at the end of the testcase.

 The data is owned by the called function.
 The string is a NUL terminated UTF-8 string.