Commit Graph

2307 Commits

Author SHA1 Message Date
Dan Winship
53beca955e Add GCancellables to GSocket ops
Currently, to implement cancellability correctly, all synchronous
calls to GSocket must be preceded by a g_socket_condition_wait() call,
(even though GSocket does this internally as well) and all
asynchronous calls must do occasional manual
g_cancellable_is_cancelled() checks. Since it's trivial to do these
checks inside GSocket instead, and we don't particularly want to
encourage people to use the APIs non-cancellably, move the
cancellation support into GSocket and simplify the existing callers.

http://bugzilla.gnome.org/show_bug.cgi?id=586797
2009-06-30 11:42:17 -04:00
Benjamin Otte
afd63c3281 fix warnings from gcc compilation with my mad CFLAGS 2009-06-29 18:25:02 +02:00
Matthias Clasen
50a7f53055 Don't use deprecated GLib api
Fixes bug 585673.
2009-06-15 01:12:50 -04:00
Ryan Lortie
4dbc2074bc Add GNIO test cases to .gitignore 2009-06-14 13:58:35 -04:00
Dan Winship
ce6fbd6231 Fix multiple bugs in g_srv_target_list_sort()
In particular, targets with weight 0 should be very UNlikely to be
selected, not very likely, as they were before. However, even ignoring
that bug in the logic, there was an additional bug (swapping list
items would cause the 0-weight items to get re-ordered incorrectly
anyway), and the code contained several fencepost errors.

This patch also adds gio/tests/srvtarget.c, which confirms that for a
sample list of targets, we now generate all possible correct random
sortings and no incorrect sortings, and the correct sortings occur in
roughly the expected proportions (though if the current code is
still wrong, those proportions may be wrong as well).

http://bugzilla.gnome.org/show_bug.cgi?id=583398
2009-06-01 14:31:48 -04:00
Alexander Larsson
6a9df8256a Use G_GSSIZE_FORMAT where needed (#577884) 2009-05-20 14:17:27 +02:00
Alexander Larsson
053f9e72b1 Add support for graceful disconnect to GTcpConnection 2009-05-20 11:19:47 +02:00
Alexander Larsson
fdfdec36d0 Add send-data, a g_socket_client test case 2009-05-19 13:44:11 +02:00
Alexander Larsson
69130db81a Read socket state in g_socket_get_local/remote_address
Previously we saved the location in various places which is unnecessary
and sometimes even wrong. For instance, we saved the address we bound to
which may not have the final port set.
2009-05-19 10:40:27 +02:00
Alexander Larsson
13cb011762 Add max_threads argument to g_threaded_socket_service_new 2009-05-18 08:47:49 +02:00
Alexander Larsson
34e74378c9 Add test apps for highlevel socket classes
echo-server - simple echo server
httpd - simple http server
2009-05-15 21:34:14 +02:00
Alexander Larsson
8f67f47e05 Add test apps for GSocket API 2009-05-15 10:08:18 +02:00
Alexander Larsson
ed08218565 Add tests for local GIOStream GFile ops 2009-05-13 14:42:57 +02:00
Dan Winship
92ac8d165e Misc warning fixes
glib/pcre/pcre_ucp_search_funcs.c, glib/pcre/pcre_valid_utf8.c: add
back missing config.h includes, and this time add them to the copies
in glib/update-pcre/ too so they don't get lost again on the next PCRE
update.

glib/garray.c, glib/gbase64.c: fix signed/unsigned pointer casts

gio/xdgmime/xdgmimeglob.c: remove unused variable

gio/tests/live-g-file.c: fix printf args on x86_64

tests/Makefile.am, tests/regex-test.c: remove redundant -DENABLE_REGEX
2009-05-01 10:37:45 -04:00
Dan Winship
9a3d18d2a6 GResolver wrappers: GNetworkAddress, GNetworkService, GSocketConnectable
Higher-level wrappers around GResolver. GSocketConnectable provides an
interface for synchronously or asynchronously iterating multiple
socket addresses, with GNetworkAddress and GNetworkService providing
interfaces based on hostname and SRV record resolution.
Part of #548466.
2009-04-22 08:36:38 -04:00
Dan Winship
c94d3f9288 Add GResolver, a glib-ish interface to DNS
GResolver provides asynchronous (and synchronous-but-cancellable) APIs
for resolving hostnames, reverse-resolving IP addresses back to
hostnames, and resolving SRV records. Part of #548466.
2009-04-22 08:36:32 -04:00
Alexander Larsson
b89e432e8d Bug 540461 – g_memory_output_stream_get_data_size() doesn't behave as
2009-02-26  Alexander Larsson  <alexl@redhat.com>

	Bug 540461 – g_memory_output_stream_get_data_size() doesn't behave as document
        * gmemoryoutputstream.c:
	Track actual valid size, even if we later seek back.

        * tests/memory-output-stream.c:
	Add testcase



svn path=/trunk/; revision=7916
2009-02-26 15:41:29 +00:00
Ryan Lortie
1ee6cc4882 update gitignore
svn path=/trunk/; revision=7887
2009-02-19 17:26:29 +00:00
Ryan Lortie
129e86cf2c Bug 568575 – _async functions for GDataInputStream
2009-01-28  Ryan Lortie  <desrt@desrt.ca>

        Bug 568575 – _async functions for GDataInputStream

        * gdatainputstream.h:
        * gdatainputstream.c: add _async versions of read_line and read_until.
        * gio.symbols:
        * ../docs/reference/gio/gio-sections.txt: add new functions
        * tests/sleepy-stream.c: new test case for async read line
        * tests/Makefile.am: add new test


svn path=/trunk/; revision=7835
2009-01-28 16:39:39 +00:00
Ryan Lortie
a9c978a354 Bug 568394 – dropping the last reference to a stream filter closes the
2009-01-20  Ryan Lortie  <desrt@desrt.ca>

        Bug 568394 – dropping the last reference to a stream filter closes the
        base stream

        * gfilterinputstream.h:
        * gfilterinputstream.c: add "close-base-stream" property and only
        close the base stream if it is true.  issue async close callbacks from
        correct source object.
        * gfilteroutputstream.h:
        * gfilteroutputstream.c: add a "close-base-stream" property and only
        close the base stream if it is true.  issue async close callbacks from
        correct source object.
        * gbufferedoutputstream: check g_filter_output_stream_get_close_base()
        before closing the base stream.  fix invalid source tag comparison in
        close_async (was comparing to flush_async).
        * ../docs/reference/gio/gio-sections.txt:
        * gio.symbols: add
        g_filter_{in,out}put_stream_{g,s}et_close_base_stream
        * tests/filter-streams.c: new test cases
        * tests/Makefile.am: add new test
        * tests/.gitignore: add new test


svn path=/trunk/; revision=7825
2009-01-21 14:09:56 +00:00
Ryan Lortie
481559a031 improve add new simple-async-result test new file to test
2009-01-05  Ryan Lortie  <desrt@desrt.ca>

        * tests/.gitignore: improve
        * tests/Makefile.am: add new simple-async-result test
        * tests/simple-async-result.c: new file to test GSimpleAsyncResult


svn path=/trunk/; revision=7767
2009-01-05 06:58:22 +00:00
Matthias Clasen
649c25f216 2.19.3
svn path=/trunk/; revision=7746
2008-12-15 20:01:49 +00:00
Matthias Clasen
b2f0d44acb Support compilers that don't understand ISO C varargs macros. Patch by
* tests/live-g-file.c: Support compilers that don't understand
        ISO C varargs macros. Patch by Eric Lamarque



svn path=/trunk/; revision=7734
2008-12-08 04:38:54 +00:00
Matthias Clasen
e959473234 Revert behaviour change in g_data_input_stream_read_line
svn path=/trunk/; revision=7720
2008-12-01 19:02:58 +00:00
Matthias Clasen
8b39fa1e6a Comment out two failing tests
svn path=/trunk/; revision=7714
2008-12-01 06:47:04 +00:00
Matthias Clasen
e449a91b98 Bug 547481 – g_data_input_stream_read_line behaves not as stated in the
2008-11-28  Matthias Clasen  <mclasen@redhat.com>

        Bug 547481 – g_data_input_stream_read_line behaves not as stated in
        the docs

        * gdatainputstream.c (g_data_input_stream_read_line): Behave as
        documented and include the line end in the returned string.
        Pointed out by Paul Pogonyshev.

        * tests/data-input-stream.c: Fix the read_line test to test the
        documented behaviour.



svn path=/trunk/; revision=7694
2008-11-28 07:42:48 +00:00
Matthias Clasen
0b715510de Bug 562393 – g_buffered_input_stream_read_byte broken if data available
2008-11-28  Matthias Clasen  <mclasen@redhat.com>

        Bug 562393 – g_buffered_input_stream_read_byte broken if data
        available

        * gio/gbufferedinputstream.c (g_buffered_input_stream_read_byte): Fix
        handling of buffered content.  Patch by Philip Withnall

        * gio/tests/buffered-input-stream.c: Add a testcase for this bug.
        * gio/tests/Makefile.am: And build it



svn path=/trunk/; revision=7686
2008-11-28 05:57:07 +00:00
Alexander Larsson
4f0b18d203 Bug 555740 - gicon serialization Based on patch from David Zeuthen
2008-10-21  Alexander Larsson  <alexl@redhat.com>

	Bug 555740 - gicon serialization
	Based on patch from David Zeuthen
	
        * gicon.[ch]:
        * gio.symbols:
	Add g_icon_to_string() and g_icon_new_for_string().
	
        * gemblem.c:
        * gemblemedicon.c:
        * gfileicon.c:
        * gthemedicon.c:
	Implement icon serialization for built-in icon types
	
        * tests/Makefile.am:
        * tests/g-icon.c:
	Added GIcon serialization test



svn path=/trunk/; revision=7618
2008-10-21 11:51:48 +00:00
Matthias Clasen
82c68c6a14 2.19.0
svn path=/trunk/; revision=7611
2008-10-16 23:59:50 +00:00
Matthias Clasen
6310f898b8 Fix gcc warnings
svn path=/trunk/; revision=7585
2008-10-10 04:54:51 +00:00
Tor Lillqvist
402d950ec7 Build desktop-app-info only on Unix.
2008-09-30  Tor Lillqvist  <tml@novell.com>

	* tests/Makefile.am: Build desktop-app-info only on Unix.


svn path=/trunk/; revision=7562
2008-09-30 11:08:38 +00:00
Dan Winship
29ddd48ff2 Use g_assert_error() and g_assert_no_error()
* tests/data-input-stream.c:
	* tests/data-output-stream.c:
	* tests/live-g-file.c:
	* tests/memory-input-stream.c:
	* tests/memory-output-stream.c: Use g_assert_error() and
	g_assert_no_error()

svn path=/trunk/; revision=7556
2008-09-27 01:43:43 +00:00
Matthias Clasen
764e187fd9 Bug 545350 – GAppInfo deletion Bug 545351 – Reset associations for
2008-09-26  Matthias Clasen  <mclasen@redhat.com>

        Bug 545350 – GAppInfo deletion
        Bug 545351 – Reset associations for content type

        * gio.symbols:
        * gappinfo.[hc]: New functions g_app_info_can_delete,
        g_app_info_delete and g_app_info_reset_type_associations.

        * gdesktopappinfo.c:
        * gwin32appinfo.c: Implementations of these.

        * tests/Makefile.am:
        * tests/desktop-app-info.c: Tests for GAppInfo functionality.


svn path=/trunk/; revision=7554
2008-09-26 19:57:36 +00:00
Dan Winship
7f4864e58d Bug 505361 - gunixinputstream.c assumes poll() available
Bug 509446 - portable blocking gio cancellation

	* gcancellable.c (g_cancellable_make_pollfd): New method to make a
	GPollFD for a cancellable (which is slightly more complicated on
	Windows than Unix).

	* gunixinputstream.c (g_unix_input_stream_read):
	* gunixoutputstream.c (g_unix_output_stream_write): Use
	g_cancellable_make_pollfd() and g_poll() rather than using poll()
	directly.

	* tests/unix-streams.c: test of GUnixInputStream,
	GUnixOutputStream, and GCancellable.

svn path=/trunk/; revision=7553
2008-09-26 16:19:35 +00:00
Ryan Lortie
920f3bffb3 Bug 549771 – improved .gitignore for glib
2007-09-02  Ryan Lortie  <desrt@desrt.ca>

        Bug 549771 – improved .gitignore for glib

        * docs/reference/.gitignore:
        * docs/reference/gio/.gitignore:
        * docs/reference/gobject/tmpl/.gitignore:
        * gio/.gitignore:
        * gio/tests/.gitignore:
        * glib/.gitignore:
        * glib/libcharset/.gitignore:
        * glib/tests/.gitignore:
        * gmodule/.gitignore:
        * gobject/.gitignore:
        * gobject/tests/.gitignore:
        * po/.gitignore:
        * tests/.gitignore: new files
        * .gitignore: remove 'build' (since it's part of glib now), add more
        useful things.


svn path=/trunk/; revision=7432
2008-09-02 18:40:39 +00:00
Cody Russell
3d93bf6968 Moved all relevant typedefs into these files.
2008-07-01  Cody Russell  <bratsche@gnome.org>

        * gio/gioenums.h:
        * gio/giotypes.h:
	Moved all relevant typedefs into these	files.

        * gio/*.[ch]:
	Updated wrt added files.

        Split types into separate file	for easier maintainership. (#538564)


svn path=/trunk/; revision=7127
2008-07-01 06:32:35 +00:00
Matthias Clasen
e3313b2651 Add some tests for GMemoryOutputStream.
2008-06-29  Matthias Clasen  <mclasen@redhat.com>

        * tests/Makefile.am:
        * tests/memory-output-stream.c: Add some tests for
        GMemoryOutputStream.

2008-06-29  Matthias Clasen  <mclasen@redhat.com>

        Bug 540423 – unrecoverable error after g_seekable_truncate(seekable,
        0, ...)

        * gmemoryoutputstream.c (array_resize): Handle truncation to
        zero correctly. Reported by Akira Tagoh



svn path=/trunk/; revision=7106
2008-06-30 03:47:27 +00:00
Yevgen Muntyan
e5347891fe Use less fancy unicode filenames, so the test doesn't fail on Mac OS X
2008-06-12  Yevgen Muntyan  <muntyan@tamu.edu>

	* tests/live-g-file.c (sample_struct):
        Use less fancy unicode filenames, so the test doesn't fail
        on Mac OS X (#531476).


svn path=/trunk/; revision=7035
2008-06-13 03:56:26 +00:00
A. Walton
52a03b97c6 Fix broken test case.
2008-06-11  A. Walton  <awalton@gnome.org>

	* tests/g-file.c (test_g_file_new_null):
	Fix broken test case.


svn path=/trunk/; revision=7016
2008-06-11 20:02:31 +00:00
Michael Natterer
03a5797a62 don't define G_DISABLE_SINGLE_INCLUDES, it's in the global CPPFLAGS now.
2008-05-28  Michael Natterer  <mitch@imendio.com>

	* Makefile.am: don't define G_DISABLE_SINGLE_INCLUDES, it's in
	the global CPPFLAGS now.

	* tests/data-input-stream.c
	* tests/data-output-stream.c
	* tests/g-file-info.c
	* tests/g-file.c
	* tests/live-g-file.c
	* tests/memory-input-stream.c: don't include <glib/gtestutils.h>


svn path=/trunk/; revision=6954
2008-05-28 16:17:45 +00:00
Matthias Clasen
e14f918de9 2.17.0
svn path=/trunk/; revision=6948
2008-05-27 21:22:45 +00:00
Matthias Clasen
689a9e4b1a Revert the patch for bug 527214 and related changes. GTimer
is supposed to work without threads.


svn path=/trunk/; revision=6943
2008-05-27 16:00:51 +00:00
Matthias Clasen
cdc2910103 Make tests work
svn path=/trunk/; revision=6935
2008-05-26 05:57:09 +00:00
Tomas Bzatek
15e21178c6 Include live-g-file in standard set of tests, making a temporary directory
2008-03-13  Tomas Bzatek  <tbzatek@redhat.com>

        * tests/live-g-file.c:
        Include live-g-file in standard set of tests, making a temporary
        directory in source structure.

        Clean target directory before the tests (write mode only)


svn path=/trunk/; revision=6699
2008-03-13 16:32:31 +00:00
Alexander Larsson
5241d96b21 Fix sparse warnings (#519489)
2008-03-06  Alexander Larsson  <alexl@redhat.com>

        * gdesktopappinfo.c:
        * gfilemonitor.c:
        * gthemedicon.c:
        * gunionvolumemonitor.c:
        * gunixmounts.c:
        * tests/g-file.c:
        * tests/live-g-file.c:
        * xdgmime/xdgmimecache.c:
	Fix sparse warnings (#519489)


svn path=/trunk/; revision=6632
2008-03-06 09:53:35 +00:00
Alexander Larsson
6dc9b7ee00 Add new g_file_has_prefix that does the same as g_file_contains_file.
2008-02-21  Alexander Larsson  <alexl@redhat.com>

        * gfile.[ch]:
        * gio.symbols:
	Add new g_file_has_prefix that does the same as g_file_contains_file.
	Deprecate g_file_contains_file and add a macro that converts
	it to g_file_has_prefix.
	The reason for this change is that the contains_file() name seems to
	imply that this does more work than what it does, but its really only
	a name match (from #517086)
	
        * gdummyfile.c:
        * glocalfile.c:
        * tests/g-file.c:
	Update to match the above change.


svn path=/trunk/; revision=6546
2008-02-21 09:09:59 +00:00
Alexander Larsson
767e18bf82 C89 fixes (#515892)
2008-02-12  Alexander Larsson  <alexl@redhat.com>

        * tests/live-g-file.c:
	C89 fixes (#515892)



svn path=/trunk/; revision=6506
2008-02-12 10:06:01 +00:00
Matthias Clasen
8ad07dcf1c Fix a mismerge
svn path=/trunk/; revision=6489
2008-02-10 04:54:25 +00:00
Matthias Clasen
da0e7e81c1 /bin/ksh can't handle a for-loop with no arguments, so add a "." for when
2008-02-09  Matthias Clasen <mclasen@redhat.com>

        * Makefile.decl: /bin/ksh can't handle a for-loop with no
        arguments, so add a "." for when $(SUBDIRS) is empty.

        * glib/tests/option-context.c:
        * glib/tests/testing.c:
        * gthread/gthread-posix.c:
        * tets/testingbase64.c:
        * glib/gtester.c:
        * glib/gsequence.c: Portability fixes.  (#515154)



svn path=/trunk/; revision=6487
2008-02-10 04:41:25 +00:00
Tor Lillqvist
7077781cc3 live-g-file won't build on Windows, too Unix-specific.
2008-02-07  Tor Lillqvist  <tml@novell.com>

	* tests/Makefile.am (TEST_PROGS): live-g-file won't build on
	Windows, too Unix-specific.


svn path=/trunk/; revision=6478
2008-02-07 09:56:25 +00:00
Tomas Bzatek
d87c1c0af4 New GIO testing module working over real data
2008-02-06  Tomas Bzatek  <tbzatek@redhat.com> 

        * tests/Makefile.am:
        * tests/live-g-file.c: 
        * tests/live-g-file.txt:
        New GIO testing module working over real data


svn path=/trunk/; revision=6465
2008-02-06 13:52:07 +00:00
Alexander Larsson
fc93e63edd C89 fixes from Jens Granseuer (#512849)
2008-01-30  Alexander Larsson  <alexl@redhat.com>

        * tests/data-input-stream.c:
        * tests/data-output-stream.c:
	C89 fixes from Jens Granseuer (#512849)



svn path=/trunk/; revision=6423
2008-01-30 09:28:10 +00:00
Matthias Clasen
8cb30318e5 Disable some tests
svn path=/trunk/; revision=6400
2008-01-28 19:46:18 +00:00
Alexander Larsson
2544ae3cd6 Canonicalize paths that start with more than two slashes.
2008-01-22  Alexander Larsson  <alexl@redhat.com>

        * glocalfile.c:
        (canonicalize_filename):
	Canonicalize paths that start with more than
	two slashes.
	
        * tests/g-file.c:
        (compare_two_files):
        (test_g_file_new_for_path):
	Test the above



svn path=/trunk/; revision=6353
2008-01-22 09:38:37 +00:00
Alexander Larsson
db5224fa85 Fix c++ comment
svn path=/trunk/; revision=6352
2008-01-22 09:19:58 +00:00
Alexander Larsson
b784923e9c Allow UTF-8 in file:// parse names.
2008-01-22  Alexander Larsson  <alexl@redhat.com>

        * glocalfile.c:
	Allow UTF-8 in file:// parse names.
	
        * tests/Makefile.am:
        * tests/data-input-stream.c:
        * tests/data-output-stream.c:
        * tests/g-file-info.c:
        * tests/g-file.c:
	Added a bunch of tests from Tomas Bzatek


svn path=/trunk/; revision=6351
2008-01-22 09:13:28 +00:00
Matthias Clasen
3cbcbee7a6 Add some tests
svn path=/trunk/; revision=6257
2008-01-07 06:14:40 +00:00