summaryrefslogtreecommitdiff
path: root/tests/testglib.c
AgeCommit message (Collapse)AuthorFilesLines
2011-06-13Drop a few more G_CONST_RETURNRyan Lortie1-1/+1
2011-06-06Test runtime dir getterMatthias Clasen1-4/+17
2010-12-28Adapt testglib.c to GRelation deprecationMatthias Clasen1-1/+5
Patch by Chun-wei Fan, bug https://bugzilla.gnome.org/show_bug.cgi?id=637858
2010-10-07Don't call close() on -1Tor Lillqvist1-1/+2
Of course, a proper implementation of close() will just ignore an invalid parameter silently, and set errno. But apparently the "debug" version of the Microsoft C library generates some noise in this case. So avoid that. Thanks to John Emmas for reporting.
2010-08-26Improve parsing of date-only iso8601 stringsJens Georg1-0/+4
2010-06-09Fix warningsJuan A. Suarez Romero1-1/+1
Do explicit casts to avoid warnings.
2010-02-04Don't use deprecated g_win32 APITor Lillqvist1-24/+0
2009-09-01g_time_val_from_iso8601: handle timezoneless datesDan Winship1-0/+21
per ISO 8601:2004 4.2.5.2 Based on a patch from Andy Shevchenko http://bugzilla.gnome.org/show_bug.cgi?id=589491
2009-04-08Fix parsing of timezonesPeter Kjellerstedt1-1/+17
Make g_time_val_from_iso8601 handle timezones with minutes correctly; also accept comma as a fraction separator. (#578369)
2008-08-14Bug 547337 – G_DISABLE_DEPRECATED breaks tests buildMatthias Clasen1-0/+4
2008-08-13 Matthias Clasen <mclasen@redhat.com> Bug 547337 – G_DISABLE_DEPRECATED breaks tests build * tests/testglib.c: Protect deprecated API by ifdefs. Patch by Kalle Vahlman svn path=/trunk/; revision=7353
2008-08-04Avoid warning on Win64 by using gintptr cast instead if long cast.Tor Lillqvist1-2/+2
2008-08-04 Tor Lillqvist <tml@novell.com> * tests/testglib.c: Avoid warning on Win64 by using gintptr cast instead if long cast. svn path=/trunk/; revision=7304
2008-06-24Bug 539770 - migrate gstrfunc unit tests to gtestPaolo Borelli1-80/+0
2008-06-24 Paolo Borelli <pborelli@katamail.com> Bug 539770 - migrate gstrfunc unit tests to gtest * tests/strfunc-test.c: * tests/testglib.c: * tests/strtoll-test.c: * tests/strtod-test.c: * tests/string-test.c: * tests/Makefile.am: Removed old tests. * glib/tests/fileutils.c: * glib/tests/strfuncs.c: * glib/tests/Makefile.am: Added all the old tests migrated to the new unit test framework and add new unit tests for some of the functions. svn path=/trunk/; revision=7097
2008-06-19set tv_usec to 0 rather than 1 when a fraction of a second is notMatthias Clasen1-13/+55
* glib/gtimer.c (g_time_val_from_iso8601): set tv_usec to 0 rather than 1 when a fraction of a second is not specified (g_time_val_from_iso8601): calculate a fraction of a second correctly even in case it does not happen to consist of exactly six digits; do not allow random data after the ISO 8601 string, only whitespace (make g_time_val_to_iso8601): support fractions of a second Patch by Peter Kjellerstedt * tests/testglib.c: Update to match svn path=/trunk/; revision=7057
2008-04-18fixed gstdio.h include.17:40:58 Tim Janik1-1/+1
2008-04-18 17:40:58 Tim Janik <timj@imendio.com> * tests/testglib.c: fixed gstdio.h include. * tests/Makefile.am: properly list testglib.c SOURCES. svn path=/trunk/; revision=6862
2008-03-10Small test fixupMatthias Clasen1-0/+2
svn path=/trunk/; revision=6652
2008-02-23Don't test user directories for being non-null. (#517084, Yevgen Muntyan)Matthias Clasen1-4/+0
2008-02-23 Matthias Clasen <mclasen@redhat.com> * tests/testglib.c: Don't test user directories for being non-null. (#517084, Yevgen Muntyan) svn path=/trunk/; revision=6562
2007-12-21adapt to recent api changes variable declaration at the beginning of aHans Breuer1-2/+5
2007-12-09 Hans Breuer <hans@breuer.org> * tests/gio-ls.c : adapt to recent api changes * tests/testglib.c : variable declaration at the beginning of a block (Lieven van der Heide, #503602) * win32-fixup.pl : process *.rc.in as well; substitute LT_CURRENT_MINUS_AGE * glib/makefile.msc.in : alphabetic sorting of OBJECTS svn path=/trunk/; revision=6184
2007-12-19Fix the date validation check. (#503029)Emmanuele Bassi1-0/+2
2007-12-19 Emmanuele Bassi <ebassi@gnome.org> * glib/gtimer.c (g_time_val_from_iso8601): Fix the date validation check. (#503029) * tests/testglib.c (various_string_tests): Add an invalid date for testing the above fix. svn path=/trunk/; revision=6160
2007-12-12split up tests and reworked code to use the new test framework.16:06:11 Tim Janik1-889/+893
2007-12-12 16:06:11 Tim Janik <timj@imendio.com> * tests/testglib.c: split up tests and reworked code to use the new test framework. * tests/Makefile.am: added testglib to TEST_PROGS. svn path=/trunk/; revision=6103
2007-06-04Add support for a number of special directories, as defined by theMatthias Clasen1-0/+8
2007-06-04 Matthias Clasen <mclasen@redhat.com> Add support for a number of special directories, as defined by the xdg-user-dirs specification. (#432651, Bastien Nocera, Emmanuele Bassi, Michael Natterer) * glib/glib.symbols: * glib/gutils.[hc]: Add the GUserDirectory enum and g_get_user_special_dir(), with implementations based on the xdg-user-dirs spec and on native interfaces for Win32 and Carbon. * configure.in: Add Carbon checks. * tests/tetsglib.c: Test g_get_user_special_dir(). svn path=/trunk/; revision=5528
2006-06-20Fix an off-by-2 error in the leap year calculation. (#344905, Dan Winship)Matthias Clasen1-4/+4
2006-06-20 Matthias Clasen <mclasen@redhat.com> * glib/gtimer.c (mktime_utc): Fix an off-by-2 error in the leap year calculation. (#344905, Dan Winship) * tests/testglib.c (main): Change the test data for the g_time_val_from_iso8601 tests to expose an off-by-2 error in the leap year calculation.
2006-03-23Check for timegm.Emmanuele Bassi1-1/+34
2006-03-23 Emmanuele Bassi <ebassi@cvs.gnome.org> * configure.in: Check for timegm. * glib/gtimer.h: * glib/gtimer.c: * glib/glib.symbols: * docs/reference/glib/glib-sections.txt: Added g_time_val_to_iso8601 and g_time_val_from_iso8601, to convert a GTimeVal to and from an ISO 8601 encoded date. * tests/testglib.c: Added test cases for g_time_val_to_iso8601() and g_time_val_from_iso8601() functions.
2006-03-14Don't read past the end of the string. (#334471, Morten Welinder)Matthias Clasen1-1/+28
2006-03-14 Matthias Clasen <mclasen@redhat.com> * glib/gutils.c (g_parse_debug_string): Don't read past the end of the string. (#334471, Morten Welinder)
2005-06-22glib/gfileutils.c glib/gfileutils.h glib/glib.symbols Rename g_makepath()Tor Lillqvist1-19/+19
2005-06-22 Tor Lillqvist <tml@novell.com> * glib/gfileutils.c * glib/gfileutils.h * glib/glib.symbols * tests/testglib.c: Rename g_makepath() to g_mkdir_with_parents().
2005-06-22New function. Creates a directory including intermediate parentTor Lillqvist1-1/+117
2005-06-22 Tor Lillqvist <tml@novell.com> * glib/gfileutils.c (g_makepath): New function. Creates a directory including intermediate parent directories as needed. (#60509) * glib/gfileutils.h: Declare it. * glib/glib.symbols: Add it. * tests/testglib.c: Test it.
2005-06-22New function. Returns the machine's name, or one of its names. DocumentTor Lillqvist1-0/+1
2005-06-22 Tor Lillqvist <tml@novell.com> * glib/gutils.c (g_get_host_name): New function. Returns the machine's name, or one of its names. Document that it is best-effort only, and not guaranteed to be unique or anything. (g_get_any_init): Get the host name here. On Unix use gethostname(), on Windows use GetComputerName(). (#5200) * glib/gutils.h * glib/glib.symbols: Add here, too. * tests/testglib.c: Test it.
2005-03-20Minor printout change, now identical as in glib-2-6 branch.Tor Lillqvist1-2/+2
2005-03-20Print more detailled output from the timer tests. Don't print homeTor Lillqvist1-5/+11
2005-03-20 Tor Lillqvist <tml@novell.com> * tests/testglib.c (main): Print more detailled output from the timer tests. Don't print home directory twice. Test g_win32_error_message(). * tests/spawn-test.c (run_tests): On Win32, run netstat instead of ipconfig. On Windows XP collecting output from ipconfig doesn't seem to work for some reason.
2004-09-07Add a function to return a list of applicable locale names. (#95587,Matthias Clasen1-0/+2
2004-09-07 Matthias Clasen <mclasen@redhat.com> * glib/gutils.h: * glib/gutils.c (g_get_language_names): Add a function to return a list of applicable locale names. (#95587, Hidetoshi Tajima) (guess_category_value, compute_locale_variants): (explode_locale, unalias_lang, read_aliases): Helper functions for g_get_language_names() * tests/testglib.c (main): Show the results of g_get_language_names()
2004-08-26Test the new XDG basedir functions.Tor Lillqvist1-1/+16
2004-08-26 Tor Lillqvist <tml@iki.fi> * tests/testglib.c (main): Test the new XDG basedir functions.
2004-04-22Trivial warning fix.Matthias Clasen1-1/+1
2004-04-22 Matthias Clasen <mclasen@redhat.com> * tests/testglib.c (main): Trivial warning fix.
2004-04-22Add testcases for g_message() involving non-printable and unsafeMatthias Clasen1-0/+2
2004-04-22 Matthias Clasen <mclasen@redhat.com> * tests/testglib.c (main): Add testcases for g_message() involving non-printable and unsafe characters. * glib/gmessages.c (escape_string): Don't assume that string->str remains unchanged over g_string_insert() calls. (#139030, Christophe Saout)
2004-02-20applied patch from #131937 with slight renames. providesTim Janik1-1/+18
Fri Feb 20 03:02:05 2004 Tim Janik <timj@gtk.org> * glib/ghash.[hc]: applied patch from #131937 with slight renames. provides g_hash_table_find().
2004-01-22Add g_timer_continue(). (#98536, Tim-Philipp Müller)Owen Taylor1-1/+51
Thu Jan 22 13:55:44 2004 Owen Taylor <otaylor@redhat.com> * glib/gtimer.c: Add g_timer_continue(). (#98536, Tim-Philipp Müller) * configure.in: Version 2.3.2, interface age 0. * NEWS: tweak, finish.
2003-11-20Added G_GSIZE_FORMAT and friends.Manish Singh1-5/+5
Thu Nov 20 15:09:40 2003 Manish Singh <yosh@gimp.org> * configure.in: Added G_GSIZE_FORMAT and friends. * tests/printf-test.c * tests/testglib.c * tests/type-test.c: Add tests for the above.
2003-10-23=== Released 2.3.0 ===Owen Taylor1-3/+4
Thu Oct 23 12:38:24 2003 Owen Taylor <otaylor@redhat.com> * === Released 2.3.0 === * tests/gobject/Makefile.am (dist-hook): Remove and extra backslash. * tests/gobject/Makefile.am (EXTRA_DIST): Add testmarshal.list. * glib/Makefile.am (libglib_2_0_la_SOURCES): Add missing gunicode-private.h. * tests/testglib.c (main): Fix a warning. * tests/gobject/ifaceinherit.c: Remove check that wasn't supposed to work (adding an interface already added to the derived class to the base class), fix a bug.
2003-09-29Use hardcoded name for DLL, as there is no reliable way to determine it atTor Lillqvist1-8/+3
2003-09-29 Tor Lillqvist <tml@iki.fi> * tests/testglib.c (main): Use hardcoded name for DLL, as there is no reliable way to determine it at compile or run time anyway.
2003-08-16Fix #117925 (Dov Grobgeld):Tor Lillqvist1-6/+32
2003-08-16 Tor Lillqvist <tml@iki.fi> Fix #117925 (Dov Grobgeld): * glib/gutils.c (g_find_program_in_path, g_basename, g_path_get_basename, g_path_is_absolute, g_path_skip_root, g_path_get_dirname, g_get_any_init): On Win32, look also for slashes ('/') as pathname separators. * glib/gfileutils.c (g_file_open_tmp): Ditto. If the template contains a pathname separator, include the actual one in the error message, instead of always the canonical one. (g_build_filename): Separate implementation on Win32 that looks for either slash or backslash. Document Unix/Windows differences. * tests/testglib.c * tests/strfunc-test.c: Test above functionality on Win32.
2002-12-12pull in trio if host printf doesn't have a known way of printing 64-bitManish Singh1-6/+0
Thu Dec 12 14:58:55 2002 Manish Singh <yosh@gimp.org> * configure.in: pull in trio if host printf doesn't have a known way of printing 64-bit ints. * glib/gmacros.h: remove extra whitespace at the end * glib/gscanner.c (g_scanner_unexp_token): use G_GUINT64_FORMAT instead of hardcoding "%llu" * tests/testglib.c: remove obsolete conditionals using G_HAVE_GINT64, we always have it now. * tests/type-test.c: same as above, and for G_G[U]INT64_FORMAT as well.
2002-10-15add -DG_DISABLED_DEPRECATEDManish Singh1-14/+14
Tue Oct 15 15:07:45 2002 Manish Singh <yosh@gimp.org> * gmodule/Makefile.am gobject/Makefile.am gthread/Makefile.am: add -DG_DISABLED_DEPRECATED * tests/gio-test.c tests/mainloop-test.c tests/string-test.c tests/testglib.c test/tree-test.c tests/unicode-collate.c tests/unicode-normalize.c: Deprecation cleanup
2002-03-28Remove warning about g_print, etc, encoding.Owen Taylor1-1/+3
Thu Mar 28 18:22:53 2002 Owen Taylor <otaylor@redhat.com> * README: Remove warning about g_print, etc, encoding. * NEWS: Updates. * glib/gmessages.c (g_log_default_handler): Use %lu (plus a cast) when printing out pid_t arguments. (#76770, Morten Welinder) * glib/gstrfuncs.c (g_strdup_vprintf): Check the result of vasprintf(), return NULL on failure. (#76802, Akira Tagoh) * tests/testglib.c (TEST): Supress a warning with some GCC versions.
2001-10-28Add missing g_pattern_match_simple and g_pattern_spec_equal.Tor Lillqvist1-1/+1
2001-10-28 Tor Lillqvist <tml@iki.fi> * glib/glib.def: Add missing g_pattern_match_simple and g_pattern_spec_equal. * glib/gwin32.c (g_win32_get_package_installation_subdirectory): Set separator correctly. * glib/libcharset/config.charset (os): Match also mingw*. * tests/testglib.c (main): (Win32): Print the lib/locale subdirectory, as that is what actually gets used.
2001-09-29cast the string size to gulong and use %lu for printing to avoid 64bitGeorge Lebl1-1/+1
Sat Sep 29 02:33:14 2001 George Lebl <jirka@5z.com> * tests/testglib.c (main): cast the string size to gulong and use %lu for printing to avoid 64bit issues * glib/gstrfuncs.[ch] (g_ascii_strncasecmp): Change the 'n' argument to gsize instead guint.
2001-09-20Accept also forward slashes. (But still don't accept them in the otherTor Lillqvist1-7/+10
2001-09-20 Tor Lillqvist <tml@iki.fi> * glib/gutils.c (g_path_is_absolute): (Win32:) Accept also forward slashes. (But still don't accept them in the other functions here. This is a thorny issue. Windows in fact does treat / like \ on input (at least as local directory separators, dunno about server/share separators). But GLib only has the one G_DIR_SEPARATOR value, that apps should scan for, and use when building pathnames. To properly fix this would require totally abstracting pathnames, and don't having any path name scanning and building in applications at all. Fat chance.) (GLIB_LOCALE_DIR): Redefine only on "pure" Win32, not Cygwin. Use subdirectory "share\locale", as on Unix. * glib/gwin32.c: Don't need to define those langiage and sublanguage constants here, current mingw (w32api) headers have them. * glib/glib.def: Add a few missing entry points. * tests/testglib.c (main): Use same name for DLL as libtool does. Use G_DIR_SEPARATOR in g_path_get_basename tests.
2001-09-18add simple test for g_path_get_basename().Tim Janik1-0/+9
Tue Sep 18 18:19:33 2001 Tim Janik <timj@gtk.org> * tests/testglib.c: add simple test for g_path_get_basename(). * glib/gfileutils.c (g_file_open_tmp): * glib/gstrfuncs.c (g_strerror): scratch erroneous usages of "illegal".
2001-07-19Add missing const. (g_strsplit): Add g_return_val_if_fail for case ofDarin Adler1-0/+1
* glib/gstrfuncs.c: (g_ascii_strdown), (g_ascii_strup): Add missing const. (g_strsplit): Add g_return_val_if_fail for case of empty delimiter, which can result in an infinite loop otherwise. * glib/gstrfuncs.h: Add missing const. * tests/.cvsignore: Ignore a generated file. * tests/array-test.c: * tests/dirname-test.c: * tests/hash-test.c: * tests/list-test.c: * tests/node-test.c: * tests/relation-test.c: * tests/shell-test.c: * tests/slist-test.c: * tests/spawn-test.c: * tests/strfunc-test.c: * tests/string-test.c: * tests/testglib.c: * tests/tree-test.c: * tests/type-test.c: Add an #undef G_DISABLE_ASSERT so all tests will assert even if asserts are disabled inside glib itself.
2001-07-11Add some generated files.Darin Adler1-0/+2
* .cvsignore: Add some generated files. * glib/gmain.c: (g_main_context_iterate): Comment out cruft after #endif to avoid gcc warning. * gmodule/gmodule.c: (g_module_set_error_unduped): Remove const from type to avoid gcc warning. * gobject/gsignal.c: (g_signal_emitv): ifdef variable used only if G_ENABLE_DEBUG to avoid gcc warning. * gobject/gtype.c: (type_iface_vtable_init_Wm), (type_iface_vtable_finalize_Wm): ifdef call needed only if !G_DISABLE_ASSERT to avoid gcc warning. * tests/testglib.c: (main): ifdef call needed only if !G_DISABLE_ASSERT to avoid gcc warning. Maybe later we should make the test to #undef G_DISABLE_ASSERT. * tests/unicode-collate.c: Add include of <string.h> to avoid gcc warning.
2001-06-30Patch from Darin Adler (#54166)Owen Taylor1-15/+15
Sat Jun 30 12:49:26 2001 Owen Taylor <otaylor@redhat.com> Patch from Darin Adler (#54166) * glib/gstrfuncs.[ch]: Add ascii-only, locale-insensitive g_ascii_to[lower/upper], g_ascii_str[down/up], g_ascii_is[upper/lower] and deprecate the locale-affected versions which break for UTF-8, etc. Make g_ascii_strup/strdown duplicating, not in-place for consistency with UTF-8 functions. * glib/gstring.[ch]: Add ascii-only, locale-insensitive g_string_ascii_[down/up], and deprecate the locale-affected versions which break for UTF-8, etc. * glib/gutils.c glib/gwin32.c test/testglib.c: Use the g_ascii_* functions where appropriate.
2001-04-20Add a check for the Darwin dynamic linker. Use AC_TRY_LINK when checkingDan Winship1-2/+2
* configure.in: Add a check for the Darwin dynamic linker. Use AC_TRY_LINK when checking for "nonposix getpwuid_r" so it notices "no getpwuid_r" correctly. * testglib.c (main): Make template[] bigger to prevent an overrun. Remove an unused variable. Initialize error to NULL. * tests/gio-test.c (main): Add a cast to prevent a warning when size_t is a long. * tests/type-test.c (main): Add an #ifdef to prevent a warning when G_HAVE_GINT64 is defined and G_GINT64_FORMAT isn't.
2001-03-09Cygwin support contributed by Stefan Ondrejicka <ondrej@idata.sk>.Tor Lillqvist1-3/+14
2001-02-21 Tor Lillqvist <tml@iki.fi> Cygwin support contributed by Stefan Ondrejicka <ondrej@idata.sk>. Hopefully I got it all in while simultaneously adding support for auto*/libtool for mingw. * Makefile.am: Changes for auto* support on Cygwin and Win32. Do still distribute the hand-written makefiles and *.win32.in files, though. Use GIO, GSPAWN and PLATFORMDEP macros set by configure. Use -no-undefined. Pass -export-symbols glib.def to libtool. * configure.in: Define G_PLATFORM_WIN32 on both pure Win32 (mingw) and Cygwin. Add AC_CYGWIN, AC_EXEEXT and AC_LIBTOOL_WIN32_DLL calls for Cygwin and mingw support. Check for %I64u guint64 format (in MS C library). Set G_MODULE_IMPL on mingw and Cygwin. Use ac_object and ac_exeext. Set GIO, GSPAWN, PLATFORMDEP and G_LIBS_EXTRA. Compile timeloop only on Unix. Define OS_WIN32 automake conditional on Win32. * glib.h: Include gwin32.h also on Cygwin. * gfileutils.c (get_contents_posix): Use O_BINARY (defined as 0 on Unix) for Cygwin's sake. * gtimer.c (GETTIME): Reduce #ifdefs, use a macro GETTIME(). * gconvert.c * gthread.c * gutf8.c * gutils.c: For code needed both on Cygwin and native Win32, test for G_PLATFORM_WIN32. * gmarkup.h: Use G_BEGIN_DECLS and G_END_DECLS. * gtypes.h: Refine GLIB_VAR definition. Also check for DLL_EXPORT in case compiling a static library on Win32 or Cygwin. * gwin32.c: No <direct.h> on Cygwin. No need for ftruncate() or dirent emulation on Cygwin. (get_package_directory_from_module) Convert return value from GetModuleFileName() to POSIX path on Cygwin. * tests/Makefile.am (progs_LDADD): Link with libglib, libgthread and libgmodule as appropriate. Use -no-undefined. * gbacktrace.c: Move #ifdefs around a bit on Win32. * gshell.c (unquote_string_inplace): Make static. * testglib.c: Make some vars static. Add Cygwin path tests.