1. 07 Mar, 2019 1 commit
    • Vasily Galkin's avatar
      gdbusaddress, win32: don't rely on short names · 4ed5abda
      Vasily Galkin authored
      Closes: #1566
      
      Short names were used in win32 implementation to allow launching
      on installations where full path to libgio-2.0-0.dll contain spaces.
      However, short names are optional on windows: so if they were disabled
      that method fails - see issue linked above.
      
      Since rundll32 doesn't support neither spaces, nor quotes in cmdline
      this patch changes rundll32 argument to just .\gio-dll-name.dll
      and uses the entire path directory containing gio dll as rundll32
      current directory.
      
      Added comments informing about potential subtleties discovered during
      writing test for gdbusaddress on win32.
      There are not known to have real-world user-visible effect,
      so by now I'm only adding comments without creating issues.
      4ed5abda
  2. 06 Mar, 2019 2 commits
  3. 05 Mar, 2019 2 commits
  4. 04 Mar, 2019 4 commits
  5. 27 Feb, 2019 3 commits
  6. 25 Feb, 2019 3 commits
  7. 22 Feb, 2019 3 commits
  8. 21 Feb, 2019 3 commits
    • Philip Withnall's avatar
      tests: Unmark socket-service test as flaky · 07414e17
      Philip Withnall authored
      This essentially reverts commit
      cffed587.
      
      The preceding two commits have fixed the test so it’s no longer flaky.
      The following command gives 5000 passes in a row for me:
      
      meson test -C /opt/gnome/build/glib/ socket-service --repeat 5000
      Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
      
      Fixes: #1679
      07414e17
    • Philip Withnall's avatar
      tests: Fix unlikely race in socket-service test · f25c3f27
      Philip Withnall authored
      It’s occasionally possible for the cancellation of the service to happen
      before connection_cb() gets scheduled in the other thread. The
      locking/unlocking order of mutex_712570 requires:
       • test_threaded_712570(): lock mutex
       • test_threaded_712570(): start wait loop
       • connection_cb(): lock mutex
       • test_threaded_socket_service_finalize(): unlock mutex
       • test_threaded_712570(): end wait loop
       • test_threaded_712570(): unlock mutex
      
      Fix that by quitting the main loop once connection_cb() has been called
      (i.e. once the server thread has received the incoming connection
      request), rather than just after the client thread (main thread) has
      sent a connection request.
      Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
      
      Helps: #1679
      f25c3f27
    • Philip Withnall's avatar
      tests: Fix flaky socket-service test caused by GTask scheduling · 2aea9c84
      Philip Withnall authored
      On about 1 in 3 test runs, the socket-service would fail with the
      ref_count assertion in connection_cb() failing (the ref_count would be 3
      rather than the expected 2).
      
      This was happening because the GTask from
      g_socket_listener_accept_socket_async() now always takes at least one
      main context iteration to return a result (whereas before
      6f3d57d2 it might have taken zero), but
      the ref_count can drop below 3 before the process of returning a result
      starts. During the process of returning a result, the ref_count
      temporarily increases again, which is what was breaking the test.
      
      Fix this by waiting for one more main context iteration. This is a bit
      of a hack, but the real fix would be to expose the outstanding_accept
      boolean from GSocketService as public API (which the test can
      interrogate), and that seems too much like exposing internal state.
      Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
      
      Helps: #1679
      2aea9c84
  9. 20 Feb, 2019 3 commits
    • Nirbheek Chauhan's avatar
      meson: Add gobjectenumtypes.h to gioenumtypes_dep · 2d6c4b28
      Nirbheek Chauhan authored
      Almost everything that needs gioenumtypes.h also needs
      gobjectenumtypes.h. Fixes:
      
      ccache cc @gio/win32/gio@win32@@giowin32@sta/gwin32filemonitor.c.obj.rsp
      In file included from ../gio/win32/gwin32filemonitor.h:25:0,
                       from ../gio/win32/gwin32filemonitor.c:26:
      ../glib/glib-object.h:37:10: fatal error: gobject/gobjectenumtypes.h: No such file or directory
       #include <gobject/gobjectenumtypes.h>
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      2d6c4b28
    • Nirbheek Chauhan's avatar
      gio: Also support modules built with MSVC · 8e3fc7df
      Nirbheek Chauhan authored
      GIO modules built with MSVC do not begin with 'lib', but they can
      begin with 'gio'. Without this, you can only load GIO modules built
      with MSVC that are `name.dll`, not `gioname.dll`.
      8e3fc7df
    • Felix Potthast's avatar
      glib-compile-resources: Fixes #1675 · 45655b82
      Felix Potthast authored
      45655b82
  10. 18 Feb, 2019 1 commit
    • Emmanuele Bassi's avatar
      Initialize a variable · f011be9c
      Emmanuele Bassi authored
      Compilers get confused when variables are initialized by a function by
      taking them as reference in an out argument; this, coupled with the fact
      that C does not initialize variables by default, most commonly results
      in a "maybe uninitialized" compiler warning.
      f011be9c
  11. 14 Feb, 2019 4 commits
  12. 13 Feb, 2019 11 commits
    • LRN's avatar
      socket test: Use loopback for connecting, not 0.0.0.0 · c00724d5
      LRN authored
      getsockname() returns the address that the socket was bound to.
      If it was bound to INADDR_ANY, getsockname() will stubbornly return INADDR_ANY
      (and someport - that one is valid).
      Subsequent connection attempts to INADDR_ANY:someport will fail with winsock.
      Actually, it doesn't make even sense to connect to INADDR_ANY at all
      (where is the socket connecting to? To a random interface of the host?),
      so this is just a straight-up change, without platform-specific ifdefing.
      
      Use loopback instead of INADDR_ANY. To ensure that binding and creation
      of INADDR_ANY is still tested, use two addresses: bind to INADDR_ANY,
      but connect to loopback, with the port number that we got from the bound
      address.
      c00724d5
    • Jordan Petridis's avatar
      gpollableoutputstream: Fix the description of the interface · 3e77699c
      Jordan Petridis authored
      Looks like this was a copy-paste typo from the Input interface.
      3e77699c
    • LRN's avatar
      GWin32VolumeMonitor: Sort the volumes correctly · 0c16230b
      LRN authored
      Use a static GQueue to form the GList of mounts by appending (which
      is fast, because GQueue tracks the tail pointer of its internal GList),
      then return that GList. This way we don't need to form the list
      by prepending, which would have made it necessary to reverse it before
      returning.
      
      If the list is not ordered correctly, local drives in GTK places sidebar
      are shown in reverse order.
      0c16230b
    • Philip Withnall's avatar
      tests: Mark gdbus-peer test as flaky · 983a40bf
      Philip Withnall authored
      It is occasionally deadlocking. See #1686.
      Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
      983a40bf
    • Iain Lane's avatar
      installed-tests: Install the slow-connect-preload.so library and use it · 1ecaae64
      Iain Lane authored
      The gsocketclient-slow test needs this, otherwise connect() succeeds
      immeidately and the test fails, because it is checking that cancellation
      works. We weren't installing it for installed tests.
      1ecaae64
    • Iain Lane's avatar
      installed tests: Allow tests to set environment variables · 07a1a803
      Iain Lane authored
      It's necessary sometimes for installed tests to be able to run with a
      custom environment. For example, the gsocketclient-slow test requires an
      LD_PRELOADed library to provide a slow connect() (this is to be added in
      a followup commit).
      
      Introduce a variable `@env@` into the installed test template, which we
      can override as necessary when generating `.test` files, to run tests
      prefixed with `/usr/bin/env <LIST OF VARIABLES>`.
      
      As the only test that requires this currently lives in `gio/tests/`, we
      are only hooking this up for that directory right now. If other tests in
      future require this treatment, then the support can be extended at that
      point.
      07a1a803
    • LRN's avatar
      GSubprocess test: Adjust the cwd test to pass on Windows · 1cc78bf0
      LRN authored
      There's no /tmp directory on Windows.
      Use g_get_tmp_dir(), and adjust the test to work with that.
      The test *still* checks the basename of the new CWD, it just
      doesn't need to be "tmp" anymore.
      1cc78bf0
    • LRN's avatar
      GSubprocess test: Add PATH to the envtable that is passed to child · 4bc1aa23
      LRN authored
      envp in spawn() functions is the *whole* environment table
      for the child process. Including PATH. Thus, unless PATH is explicitly
      put into that table, the process will be spawned without PATH.
      Since on Windows binaries are found via PATH instead of LD_LIBRARY_PATH
      or whatever, almost no program (unless installed in WINDIR, maybe)
      can run without a PATH. Certainly not test programs - meson
      adds bld subdirs to the PATH to make sure that test programs
      use uninstalled glib at runtime.
      So make sure that PATH is passed along.
      4bc1aa23
    • LRN's avatar
      GSubprocess test: Use LINEEND more · 01642d6d
      LRN authored
      Windows \r\n EOLs strike again. The test already knows about LINEEND,
      so make it use LINEEND more (instead of swithcing pipes
      to binary mode). This also applies to counting the bytes
      read.
      01642d6d
    • LRN's avatar
      socket test: Bind Windows UDP sockets before calling recv() · f150de21
      LRN authored
      Winsock can't recv() on unbound UDP sockets. Bind the socket
      to loopback before trying to receive data on it.
      f150de21
    • LRN's avatar
      socket test: Adjust for Windows-specific sendto() error · 1f5d7eea
      LRN authored
      With winsock sending messages to NULL results in G_IO_ERROR_NOT_CONNECTED
      instead of G_IO_ERROR_FAILED.
      MSDN says:
        WSAENOTCONN
        10057
        Socket is not connected.
        A request to send or receive data was disallowed because the socket is not connected
        and (when sending on a datagram socket using sendto) no address was supplied.
      So this is a direct mapping of the implementation error.
      Covering it up in the wrapper (by converting it to G_IO_ERROR_FAILED)
      doesn't seem feasible or needed (no one, except for the testsuite,
      really cares which unrecoverable error is returned by sendto()).
      1f5d7eea