glib/gio/tests
Philip Withnall ccbb2d8e8a gdbusnameowning: Subscribe to NameLost before calling RequestName
There was a slight race in name ownership: a gap between calling
`RequestName` (or receiving its reply) and subscribing to `NameLost`. In
that gap, another process could request and receive the name, and this
one wouldn’t know about it.

Fix that by subscribing to `NameAcquired` and `NameLost` before calling
`RequestName`, and then unsubscribing again if the subscriptions turn
out not to be necessary (if the process can’t own the requested name).

Spotted and diagnosed by Miika Karanki.

One of the tests needs an additional iteration of the main loop in order
to free all the signal closures before it can complete its checks.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #1517
2020-02-16 10:00:31 +00:00
..
cert-tests gtlscertificate: Allow any type of private key in PEM files 2018-12-18 11:43:08 +01:00
de/LC_MESSAGES meson add missing gio/tests subdirectory/file 2017-07-13 19:03:39 -04:00
desktop-files Remove unnecessary +x permissions 2018-09-23 17:01:04 +01:00
gdbus-object-manager-example doc: Add back gdbus-object-manager-example 2020-01-29 15:40:17 +01:00
modules build: Drop autotools support 2019-01-15 15:11:43 +00:00
schema-tests Don't skip invalid enum values in schemas 2017-10-11 10:22:23 +01:00
services gio/tests: add a fake implementation of the document portal 2019-12-17 20:56:49 +08:00
static-link CI: Test static build on installed glib 2018-10-23 09:45:12 -04:00
thumbnails tests: Add tests for the thumbnail verification code in GIO 2013-10-24 13:55:33 -04:00
x-content Add tests for x-content type sniffing 2014-01-01 17:59:20 -05:00
.gitignore gdbus, tests: rename gdbus-unix-addresses test to gdbus-address-get-session 2019-03-12 21:53:43 +03:00
111_digit_test.gresource.xml glib-compile-resources: Fixes #1675 2019-02-20 10:38:29 +00:00
actions.c tests: Convert g_assert() to g_assert_*() in gio/tests/actions.c 2019-03-08 19:46:20 +00:00
appinfo-test2.desktop.in tests: Avoid chdir() call at the start of appinfo tests 2018-12-17 17:16:03 +00:00
appinfo-test-actions.desktop Add missing file 2013-07-11 13:49:20 -04:00
appinfo-test-gnome.desktop.in tests: Avoid chdir() call at the start of appinfo tests 2018-12-17 17:16:03 +00:00
appinfo-test-notgnome.desktop.in tests: Avoid chdir() call at the start of appinfo tests 2018-12-17 17:16:03 +00:00
appinfo-test-static.desktop tests: Use static appinfo .desktop file when not launching 2018-12-17 17:16:04 +00:00
appinfo-test.c tests: Avoid chdir() call at the start of appinfo tests 2018-12-17 17:16:03 +00:00
appinfo-test.desktop.in tests: Don’t spawn test processes via the terminal in the appinfo test 2019-06-28 13:05:07 +01:00
appinfo.c tests: Don’t spawn test processes via the terminal in the appinfo test 2019-06-28 13:05:07 +01:00
appmonitor.c tests: Isolate directories in appmonitor test 2018-12-17 17:16:04 +00:00
apps.c apps test: add new "monitor" subcommand 2014-09-09 14:11:38 -04:00
async-close-output-stream.c gtestutils: add g_assert_cmpmem() 2015-08-31 13:59:48 -04:00
async-splice-output-stream.c tests: Add testcases for g_output_stream_splice_async() 2013-09-29 17:48:40 -04:00
autoptr.c autoptr test: Use OS-dependent path separator 2019-02-13 08:49:42 +00:00
basic-application.c Avoid a compiler warning 2014-01-01 22:01:15 -05:00
buffered-input-stream.c
buffered-output-stream.c Update tests for new truncate behavior 2013-12-15 21:07:12 -05:00
cancellable.c tests: Don't "timeout tests" by default 2019-11-25 12:55:18 +01:00
codegen.py gdbus-codegen: Add --glib-max-allowed argument 2020-01-27 10:42:26 +00:00
contenttype.c tests: Add a test for g_content_type_guess() with no arguments 2019-06-03 12:16:50 +01:00
contexts.c GContextSpecificGroup: add testcase 2016-04-26 15:20:16 +02:00
converter-stream.c gtestutils: add g_assert_cmpmem() 2015-08-31 13:59:48 -04:00
credentials.c gcredentials: add NetBSD support 2014-06-28 14:06:36 -04:00
data-input-stream.c tests: data-input-stream: fix -Wduplicated-branches 2018-02-16 17:38:26 +00:00
data-output-stream.c Use G_GNUC_FALLTHROUGH where appropriate 2018-09-04 20:24:25 +02:00
dbus-appinfo.c gio: do not cache document portal D-Bus proxy 2019-12-17 21:03:03 +08:00
dbus-launch.c gdbus, tests: rename gdbus-unix-addresses test to gdbus-address-get-session 2019-03-12 21:53:43 +03:00
de.po
defaultvalue.c tests: Do not init the default value 2019-10-26 14:06:31 +01:00
desktop-app-info.c docs: Use ‘look up’ as a verb, rather than the noun ‘lookup’ 2019-04-26 12:12:31 +01:00
echo-server.c
enums.xml.template
fake-document-portal.c tests: Fix callback arguments in fake-document-portal 2020-01-07 11:20:45 +00:00
file.c test_copy_preserve_mode: Adjust for the previous revert 2019-11-21 10:49:31 +00:00
fileattributematcher.c Fix various const-correctness issues 2018-04-26 15:19:17 +01:00
filter-cat.c gio/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
filter-streams.c gio/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
g-file-info-filesystem-readonly.c tests: Don't run tests that require fuse on rootless containers 2019-12-04 14:06:23 +01:00
g-file-info.c tests: Add tests for GFileInfo modification time 2019-09-05 17:13:08 +01:00
g-file.c tests: replace most g_print() with g_printerr() 2015-05-11 20:24:56 +01:00
g-icon.c Fix g_icon_to_string() regression (doc inconsistency). 2018-09-13 13:16:40 +02:00
gapplication-example-actions.c
gapplication-example-cmdline2.c
gapplication-example-cmdline3.c
gapplication-example-cmdline4.c Bug-790839 GApplication command line --help enhancements 2018-01-03 11:08:37 +00:00
gapplication-example-cmdline.c
gapplication-example-dbushooks.c
gapplication-example-open.c
gapplication.c general: Remove a few unhelpful references to ‘master’ 2019-04-25 09:25:49 +01:00
gdbus-address-get-session.c gdbus, tests, win32: test session dbus autolaunch 2019-03-12 21:54:47 +03:00
gdbus-addresses.c gdbusaddress: Validate the noncefile attribute of nonce-tcp addresses 2019-10-08 13:53:01 +01:00
gdbus-auth.c gio/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
gdbus-bz627724.c gio/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
gdbus-close-pending.c gio/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
gdbus-connection-flush-helper.c gio/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
gdbus-connection-flush.c tests: Enable GDBus debug for a number of unreliable tests 2019-12-11 11:04:10 +01:00
gdbus-connection-loss.c gdbus-connection-loss: Fix test failure 2019-07-03 20:28:36 -07:00
gdbus-connection-slow.c all: Remove trailing newlines from g_message()/g_warning()/g_error()s 2018-04-27 16:46:19 +01:00
gdbus-connection.c tests: Enable GDBus debug for a number of unreliable tests 2019-12-11 11:04:10 +01:00
gdbus-daemon.c
gdbus-error.c gio/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
gdbus-example-export.c Drop trailing semi-colon from G_DEFINE_ macro 2017-04-10 10:38:31 +01:00
gdbus-example-objectmanager-client.c build: work around meson issue with too long filenames on Windows. Fixes #1556 2018-10-04 10:45:45 +02:00
gdbus-example-objectmanager-server.c build: work around meson issue with too long filenames on Windows. Fixes #1556 2018-10-04 10:45:45 +02:00
gdbus-example-own-name.c
gdbus-example-peer.c gdbus-example-peer: Provide an example GDBusAuthObserver 2019-06-11 11:06:36 +01:00
gdbus-example-proxy-subclass.c Drop trailing semi-colon from G_DEFINE_ macro 2017-04-10 10:38:31 +01:00
gdbus-example-server.c
gdbus-example-subtree.c Use 'dumb quotes' rather than `really dumb quotes' 2013-05-21 11:23:22 -03:00
gdbus-example-unix-fd-client.c glib: Don’t use time(NULL) to get current time 2018-07-09 13:28:02 +02:00
gdbus-example-watch-name.c
gdbus-example-watch-proxy.c
gdbus-exit-on-close.c gio/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
gdbus-export.c tests: Fix an error message set by foo_set_property() 2019-12-18 16:39:56 +00:00
gdbus-introspection.c gio/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
gdbus-message.c gdbusmessage: Fix check on upper limit of message size 2019-01-28 14:37:22 +00:00
gdbus-names.c gdbusnameowning: Subscribe to NameLost before calling RequestName 2020-02-16 10:00:31 +00:00
gdbus-non-socket.c gio/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
gdbus-overflow.c gio/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
gdbus-peer-object-manager.c tests: Various minor leak fixes in the GIO tests 2018-06-29 12:13:32 +01:00
gdbus-peer.c gdbus-peer: Specifically listen on 127.0.0.1 2019-11-04 13:31:14 +00:00
gdbus-proxy-threads.c gio/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
gdbus-proxy-unique-name.c gdbusproxy: make g-name-owner property useful with unique names 2018-11-10 03:53:32 +00:00
gdbus-proxy-well-known-name.c gio/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
gdbus-proxy.c tests: Fix some larger memory leaks in gdbus-proxy 2019-03-07 13:57:38 +00:00
gdbus-serialization.c gdbusmessage: Limit recursion of variants in D-Bus messages 2019-11-18 17:53:55 +00:00
gdbus-server-auth.c tests: Enable GDBus debug for a number of unreliable tests 2019-12-11 11:04:10 +01:00
gdbus-sessionbus.c gio/tests: add a fake implementation of the document portal 2019-12-17 20:56:49 +08:00
gdbus-sessionbus.h gio/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
gdbus-test-codegen.c gdbus-codegen: Rename --glib-min-version to --glib-min-required 2020-01-27 10:11:46 +00:00
gdbus-test-fixture.c gio/tests: add a fake implementation of the document portal 2019-12-17 20:56:49 +08:00
gdbus-tests.c Enable GIO tests on Windows 2018-09-12 15:42:11 +00:00
gdbus-tests.h gio/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
gdbus-testserver.c tests: Fix some larger memory leaks in gdbus-proxy 2019-03-07 13:57:38 +00:00
gdbus-threading.c gatomic: Add various casts to use of g_atomic_*()s to fix warnings 2019-09-21 10:48:23 +02:00
gen-big-test-resource.py gresources: Add a test with resources > 64kb 2018-12-05 18:27:16 +08:00
gengiotypefuncs.py gengiotypefuncs.py: Read and parse files in binary mode 2018-05-22 14:34:17 +05:30
gio-du.c win32: Replace usage of __wgetmainargs() 2015-07-23 04:22:59 -04:00
giomodule.c Fix test failures for static builds 2019-07-15 11:01:04 +00:00
glistmodel.c gliststore: Add item lookup functions 2019-09-25 08:37:22 +02:00
gmenumodel.c tests: Fix data race in gmenumodel test 2019-03-05 15:14:58 +01:00
gnotification-server.c gio/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
gnotification-server.h gio/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
gnotification.c tests: fix gnotification tests broken due to the recent icon name fallback changes 2018-08-19 20:04:41 +02:00
gschema-compile.c glib: Update various code comments to mention Meson 2019-01-15 15:11:43 +00:00
gsettings.c gsettings: Add missing changed() call to delayed settings backend 2019-08-21 20:08:04 +03:00
gsocketclient-slow.c gsocketclient: Fix critical on cancellation 2019-02-27 09:20:28 -05:00
gsubprocess-testprog.c Revert "tests: Fix GOptionContext leak in GSubprocess tests" 2018-12-19 14:54:27 +00:00
gsubprocess.c tests: Fix small race in GSubprocess tests 2019-05-31 23:35:27 +01:00
gtesttlsbackend.c Revert "gtlscertificate: Add support for PKCS #11 backed certificates" 2020-01-30 04:19:22 -06:00
gtesttlsbackend.h gio/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
gtlsconsoleinteraction.c gio/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
gtlsconsoleinteraction.h gio/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
httpd.c Avoid setting unused variables (-Wself-assign) 2017-09-11 22:14:18 +01:00
inet-address.c Fix gio/tests/inet-address on OS X 2016-07-11 17:42:41 -04:00
io-stream.c tests: add GSimpleIOStream async close tests 2015-02-17 16:27:46 -05:00
live-g-file.c tests: Cope with having CAP_DAC_OVERRIDE, even if not euid 0 2020-02-13 17:33:45 +00:00
live-g-file.txt
memory-input-stream.c Improve GMemoryInputStream test coverage 2013-06-02 01:44:49 -04:00
memory-monitor-dbus.py.in tests: Fix timeouts not working in GMemoryMonitor tests 2020-02-04 17:28:07 +01:00
memory-monitor-portal.py.in tests: Fix timeouts not working in GMemoryMonitor tests 2020-02-04 17:28:07 +01:00
memory-monitor.c gio: Add stub test program for GMemoryMonitor 2019-12-11 11:44:42 +00:00
memory-output-stream.c Add some tests for g_output_stream_writev() and its async variant 2019-01-24 16:25:56 +02:00
meson.build gdesktopappinfo: Use sh rather than gio-launch-desktop 2020-02-14 18:09:18 +00:00
mimeapps.c tests: Isolate directories in mimeapps test 2018-12-17 17:16:04 +00:00
mock-resolver.c Always resolve localhost to loopback address 2019-10-10 14:32:18 +01:00
mock-resolver.h gnetworkaddress: Implement parallel ipv4 and ipv6 dns lookups 2018-12-11 16:09:29 -05:00
mount-operation.c Add support for TCRYPT volumes to GMountOperation 2018-06-21 15:32:04 +02:00
network-address.c Always resolve localhost to loopback address 2019-10-10 14:32:18 +01:00
network-monitor-race.c network-monitor-race test: Have the subprocess inherit stdout and stderr 2018-09-13 11:44:16 +01:00
network-monitor.c tests/network-monitor: Always use the dummy proxy resolver 2018-04-10 10:35:45 +01:00
org.gtk.schemasourcecheck.gschema.xml
org.gtk.test.dbusappinfo.desktop Make a test desktop file a little less invalid 2013-07-14 11:36:45 -04:00
org.gtk.test.dbusappinfo.flatpak.desktop gio/tests: add a test for document portal use when launching flatpaks 2019-12-17 20:59:22 +08:00
org.gtk.test.gschema.override.orig Add a test for per-desktop overrides 2018-06-22 22:02:31 +03:00
org.gtk.test.gschema.xml.orig Add a test for per-desktop overrides 2018-06-22 22:02:31 +03:00
permission.c
pollable.c added more g_pollable_input_stream_is_readable checks 2018-12-14 17:07:22 +01:00
proxy-test.c gnetworkaddress: Implement parallel ipv4 and ipv6 dns lookups 2018-12-11 16:09:29 -05:00
proxy.c gio/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
readwrite.c Enable GIO tests on Windows 2018-09-12 15:42:11 +00:00
resolver.c docs: Use ‘look up’ as a verb, rather than the noun ‘lookup’ 2019-04-26 12:12:31 +01:00
resourceplugin.c gio/tests/resourceplugin.c: Ensure entry points are exported 2019-06-24 10:58:51 +08:00
resources.c Fix test failures for static builds 2019-07-15 11:01:04 +00:00
send-data.c tests: Stop using deprecated g_get_current_time() 2019-07-29 12:27:29 +01:00
simple-async-result.c gio/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
simple-proxy.c tests: Various minor leak fixes in the GIO tests 2018-06-29 12:13:32 +01:00
sleepy-stream.c Use G_GNUC_FALLTHROUGH where appropriate 2018-09-04 20:24:25 +02:00
slow-connect-preload.c tests: Add gsocketclient test for slow connections 2018-12-11 16:12:48 -05:00
socket-address.c gsocketconnectable: Add a to_string() virtual method 2015-10-13 15:42:14 +01:00
socket-client.c general: Remove a few unhelpful references to ‘master’ 2019-04-25 09:25:49 +01:00
socket-common.c
socket-listener.c gio/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
socket-server.c general: Remove a few unhelpful references to ‘master’ 2019-04-25 09:25:49 +01:00
socket-service.c tests: Fix unlikely race in socket-service test 2019-02-21 18:15:49 +00:00
socket.c tests: Fix error path not setting an error 2020-01-07 15:07:37 +00:00
srvtarget.c
static-link.py tests: Correct static-link.py skipped status 2019-12-04 14:06:23 +01:00
stream-rw_all.c gio/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
taptestrunner.py tests: Add tests for the gdbus-codegen executable 2019-12-02 14:27:11 +00:00
task.c task: Add return/propagate API for GValue 2019-11-15 10:37:42 +00:00
test1.overlay Add a test for resource overlays 2019-01-10 13:50:26 -05:00
test1.txt
test2.gresource.xml gresources: Add a test with resources > 64kb 2018-12-05 18:27:16 +08:00
test2.txt
test3.gresource.xml
test3.txt
test4.gresource.xml
test5.gresource.xml glib-compile-resources: Add external data option 2018-12-19 16:43:21 +00:00
test-codegen.xml gdbus-codegen: emit GUnixFDLists if an arg has type 'h' 2019-09-02 20:47:20 +01:00
test-io-stream.c gio/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
test-io-stream.h gio/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
test-pipe-unix.c docs: Drop unnecessary <!-- -->s from gtk-doc comments 2017-11-29 17:50:27 +00:00
test-pipe-unix.h gio/tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
test.gresource.xml glib-compile-resources: correct resource compiler dependency for generated files 2016-06-04 08:24:22 -04:00
testenum.h
testfilemonitor.c testfilemonitor: Fix a trivial leak in the test 2019-10-18 17:02:57 +01:00
thumbnail-verification.c Fix the thumbnail-verification Test 2015-04-22 18:56:50 +08:00
tls-certificate.c Revert "gtlscertificate: Add support for PKCS #11 backed certificates" 2020-01-30 04:19:22 -06:00
tls-database.c gtlsbackend: add support for setting the default TLS database 2018-09-03 13:55:57 +10:00
tls-interaction.c tests: Use g_object_assert_last_unref() in various tests 2019-07-25 15:23:21 +01:00
trash.c trash test: Don't rely on being able to determine mount points 2019-01-17 16:31:10 +00:00
unix-fd.c
unix-mounts.c gunixmounts: Stop considering cifs/nfs as system file systems 2018-06-20 12:16:34 +01:00
unix-streams.c Add test for blocking and non-blocking and async read/write(v) on UNIX streams 2019-01-24 16:26:05 +02:00
vfs.c vfs: Fix return value of get_supported_uri_schemes() 2016-06-28 15:57:49 +02:00
volumemonitor.c
win32-appinfo.c tests: Fix header inclusion in win32-appinfo.c 2020-01-20 15:22:03 +00:00
win32-streams.c Fix tests to compile again - add missing headers to W32, call correct process-id-getting function 2014-08-02 12:41:14 +00:00