root@x065:[/data/prj/gnome/glib/glib-2.43.3/glib/tests]ls -l mkdir-test
total 1948
-rw-r--r-- 1 michael system 1987072 Feb  1 15:08 core

root@x065:[/data/prj/gnome/glib/glib-2.43.3/glib/tests]rm -rf mkdir-test
root@x065:[/data/prj/gnome/glib/glib-2.43.3/glib/tests]id
uid=0(root) gid=0(system) groups=0(system),2(bin),3(sys),7(security),8(cron),10(audit),11(lp)
root@x065:[/data/prj/gnome/glib/glib-2.43.3/glib/tests]su michael
root@x065:[/data/prj/gnome/glib/glib-2.43.3/glib/tests].libs/mappedfile
/mappedfile/basic: **
GLib:ERROR:mappedfile.c:25:test_basic: assertion failed (error == NULL): Failed to open file '.libs/empty': open() failed: No such file or directory (g-file-error-quark, 4)
IOT/Abort trap(coredump)
root@x065:[/data/prj/gnome/glib/glib-2.43.3/glib/tests]./mappedfile
/mappedfile/basic: **
GLib:ERROR:mappedfile.c:25:test_basic: assertion failed (error == NULL): Failed to open file '/data/prj/gnome/glib/glib-2.43.3/glib/tests/empty': open() failed: No such file or directory (g-file-error-quark, 4)
IOT/Abort trap(coredump)
root@x065:[/data/prj/gnome/glib/glib-2.43.3/glib/tests]find .. -name empty
root@x065:[/data/prj/gnome/glib/glib-2.43.3/glib/tests]

root@x065:[/data/prj/gnome/glib/glib-2.43.3/glib/tests]rm mappedfile.log
root@x065:[/data/prj/gnome/glib/glib-2.43.3/glib/tests]make mappedfile.log
ERROR: mappedfile - missing test plan
ERROR: mappedfile - exited with status 134 (terminated by signal 6?)

root@x065:[/data/prj/gnome/glib/glib-2.43.3/glib/tests]cat mappedfile.log
# random seed: R02S412abdefb6a1dc285771f15cfd80b713
# Start of mappedfile tests
../../tap-test[5]: 286934 IOT/Abort trap(coredump)
# GLib:ERROR:mappedfile.c:25:test_basic: assertion failed (error == NULL): Failed to open file '/data/prj/gnome/glib/glib-2.43.3/glib/tests/empty': open() failed: No such file or directory (g-file-error-quark, 4)
ERROR: mappedfile - missing test plan
ERROR: mappedfile - exited with status 134 (terminated by signal 6?)

root@x065:[/data/prj/gnome/glib/glib-2.43.3/glib/tests]grep empty Makefile
  BEGIN { nonempty = 0; } \
  { items[$$0] = 1; nonempty = 1; } \
  END { if (nonempty) { for (i in items) print i; }; } \
dist_test_data = keyfiletest.ini pages.ini keyfile.c empty \
          test -n "$$unique" || unique=$$empty_fix; \
# expand to empty, as could happen e.g. with make check TESTS=''.

## Going to assume that the file empty is made outside of mappedfile

root@x065:[/data/prj/gnome/glib/glib-2.43.3/glib/tests]touch empty
root@x065:[/data/prj/gnome/glib/glib-2.43.3/glib/tests]./mappedfile
/mappedfile/basic: OK
/mappedfile/empty: OK
/mappedfile/device: OK
/mappedfile/nonexisting: OK
/mappedfile/writable: **
GLib:ERROR:mappedfile.c:93:test_writable: assertion failed (error == NULL): Failed to create file '/.cache/glib-test-4096-random-bytes.U62DTX': No such file or directory (g-file-error-quark, 4)
IOT/Abort trap(coredump)

root@x065:[/data/prj/gnome/glib/glib-2.43.3/glib/tests]id
uid=199(michael) gid=1(staff) groups=1(staff)
root@x065:[/data/prj/gnome/glib/glib-2.43.3/glib/tests]
root@x065:[/data/prj/gnome/glib/glib-2.43.3/glib/tests]id
uid=0(root) gid=0(system) groups=0(system),2(bin),3(sys),7(security),8(cron),10(audit),11(lp)

Now as root - what is /.cache (G_TEST_DIST ?)

root@x065:[/data/prj/gnome/glib/glib-2.43.3/glib/tests]./mappedfile
/mappedfile/basic: OK
/mappedfile/empty: OK
/mappedfile/device: OK
/mappedfile/nonexisting: OK
/mappedfile/writable: **
GLib:ERROR:mappedfile.c:93:test_writable: assertion failed (error == NULL): Failed to create file '/.cache/glib-test-4096-random-bytes.NVBWSX': No such file or directory (g-file-error-quark, 4)
IOT/Abort trap(coredump)
root@x065:[/data/prj/gnome/glib/glib-2.43.3/glib/tests]find . -name .cache
root@x065:[/data/prj/gnome/glib/glib-2.43.3/glib/tests]find .. -name .cache

root@x065:[/data/prj/gnome/glib/glib-2.43.3/glib/tests]mkdir /.cache
root@x065:[/data/prj/gnome/glib/glib-2.43.3/glib/tests]./mappedfile        
/mappedfile/basic: OK
/mappedfile/empty: OK
/mappedfile/device: OK
/mappedfile/nonexisting: OK
/mappedfile/writable: OK
/mappedfile/writable_fd: OK
/mappedfile/gbytes: OK

root@x065:[/data/prj/gnome/glib/glib-2.43.3/glib/tests]grep G_TEST_DIST *.c
bookmarkfile.c:  filename = g_test_get_filename (G_TEST_DIST, "bookmarks", "valid-01.xbel", NULL);
bookmarkfile.c:  filename = g_test_get_filename (G_TEST_DIST, "bookmarks", "valid-01.xbel", NULL);
bookmarkfile.c:  filename = g_test_get_filename (G_TEST_DIST, "bookmarks", "valid-01.xbel", NULL);
bookmarkfile.c:  path = g_test_build_filename (G_TEST_DIST, "bookmarks", NULL);
bookmarkfile.c:      g_test_add_data_func_full (path, g_test_build_filename (G_TEST_DIST, "bookmarks", name, NULL),
fileutils.c:  oldpath = g_test_get_filename (G_TEST_DIST, "4096-random-bytes", NULL);
keyfile.c:  loaded = g_key_file_load_from_file (file, g_test_get_filename (G_TEST_DIST, "keyfiletest.ini", NULL), 0, &error);
keyfile.c:  g_assert (!g_key_file_load_from_file (file, g_test_get_filename (G_TEST_DIST, "keyfile.c", NULL), 0, &error));
keyfile.c:  g_key_file_load_from_file (file, g_test_get_filename (G_TEST_DIST, "pages.ini", NULL), G_KEY_FILE_NONE, &error);
keyfile.c:  g_setenv ("XDG_DATA_HOME", g_test_get_dir (G_TEST_DIST), TRUE);
mappedfile.c:  file = g_mapped_file_new (g_test_get_filename (G_TEST_DIST, "empty", NULL), FALSE, &error);
mappedfile.c:  file = g_mapped_file_new (g_test_get_filename (G_TEST_DIST, "empty", NULL), FALSE, &error);
mappedfile.c:  g_file_get_contents (g_test_get_filename (G_TEST_DIST, "4096-random-bytes", NULL), &contents, &len, &error);
mappedfile.c:  g_file_get_contents (g_test_get_filename (G_TEST_DIST, "4096-random-bytes", NULL), &contents, &len, &error);
mappedfile.c:  file = g_mapped_file_new (g_test_get_filename (G_TEST_DIST, "empty", NULL), FALSE, &error);
markup-parse.c:  path = g_test_build_filename (G_TEST_DIST, "markups", NULL);
markup-parse.c:      g_test_add_data_func_full (path, g_test_build_filename (G_TEST_DIST, "markups", name, NULL),
spawn-singlethread.c:      echo_script_path = g_test_build_filename (G_TEST_DIST, "echo-script" SCRIPT_EXT, NULL);
root@x065:[/data/prj/gnome/glib/glib-2.43.3/glib/tests]grep G_TEST_DIST *.h
grep: 0652-033 Cannot open *.h.
root@x065:[/data/prj/gnome/glib/glib-2.43.3/glib/tests]grep G_TEST_DIST ../*.h
../gtestutils.h:  G_TEST_DIST,

looking more closely - it is not a file name...
typedef enum
{
  G_TEST_DIST,
  G_TEST_BUILT
} GTestFileType;

so, looking for where the .cache comes from

root@x065:[/data/prj/gnome/glib/glib-2.43.3/glib]grep cache *.h
glib.h:#include <glib/deprecated/gcache.h>
gutils.h:void      g_reload_user_special_dirs_cache     (void);
gutils.h:const gchar *         g_get_user_cache_dir     (void);

Looks like it is a default directory name in $HOME

gutils.c:1250: * g_get_user_cache_dir:
gutils.c:1252: * Returns a base directory in which to store non-essential, cached
gutils.c:1270:g_get_user_cache_dir (void)
gutils.c:1272:  gchar *cache_dir;  
gutils.c:1276:  if (!g_user_cache_dir)
gutils.c:1279:      cache_dir = get_special_folder (CSIDL_INTERNET_CACHE); /* XXX correct? */
gutils.c:1281:      cache_dir = (gchar *) g_getenv ("XDG_CACHE_HOME");
gutils.c:1283:      if (cache_dir && cache_dir[0])
gutils.c:1284:          cache_dir = g_strdup (cache_dir);
gutils.c:1286:      if (!cache_dir || !cache_dir[0])
gutils.c:1291:            cache_dir = g_build_filename (home_dir, ".cache", NULL);
gutils.c:1293:            cache_dir = g_build_filename (g_get_tmp_dir (), g_get_user_name (), ".cache", NULL);
gutils.c:1295:      g_user_cache_dir = cache_dir;
gutils.c:1298:    cache_dir = g_user_cache_dir;
gutils.c:1302:  return cache_dir;


