Set the list of directories used by GIO to load the MIME database.
If dirs is null, the directories used are the default:
the mime subdirectory of the directory in $XDG_DATA_HOME
the mime subdirectory of every directory in $XDG_DATA_DIRS
This function is intended to be used when writing tests that depend on
information stored in the MIME database, in order to control the data.
Typically, in case your tests use G_TEST_OPTION_ISOLATE_DIRS, but they
depend on the system’s MIME database, you should call this function
with dirs set to null before calling g_test_init(), for instance:
// Load MIME data from the system g_content_type_set_mime_dirs (NULL); // Isolate the environment g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
…
returng_test_run ();
Parameters
Optionaldirs: string[]
null-terminated list of directories to load MIME data from, including any mime/ subdirectory, and with the first directory to try listed first
Set the list of directories used by GIO to load the MIME database. If
dirsisnull, the directories used are the default:mimesubdirectory of the directory in$XDG_DATA_HOMEmimesubdirectory of every directory in$XDG_DATA_DIRSThis function is intended to be used when writing tests that depend on information stored in the MIME database, in order to control the data.
Typically, in case your tests use
G_TEST_OPTION_ISOLATE_DIRS, but they depend on the system’s MIME database, you should call this function withdirsset tonullbefore callingg_test_init(), for instance: