glib/tests/gobject
Philip Withnall 5cddde1fb2 Consistently save errno immediately after the operation setting it
Prevent the situation where errno is set by function A, then function B
is called (which is typically _(), but could be anything else) and it
overwrites errno, then errno is checked by the caller.

errno is a horrific API, and we need to be careful to save its value as
soon as a function call (which might set it) returns. i.e. Follow the
pattern:
  int errsv, ret;
  ret = some_call_which_might_set_errno ();
  errsv = errno;

  if (ret < 0)
    puts (strerror (errsv));

This patch implements that pattern throughout GLib. There might be a few
places in the test code which still use errno directly. They should be
ported as necessary. It doesn’t modify all the call sites like this:
  if (some_call_which_might_set_errno () && errno == ESOMETHING)
since the refactoring involved is probably more harmful than beneficial
there. It does, however, refactor other call sites regardless of whether
they were originally buggy.

https://bugzilla.gnome.org/show_bug.cgi?id=785577
2017-08-03 10:21:13 +01:00
..
.gitignore .gitignore: add "signals" 2013-09-28 10:39:01 -04:00
accumulator.c tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:35 +02:00
defaultiface.c tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:35 +02:00
deftype.c tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:35 +02:00
dynamictype.c tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:35 +02:00
gvalue-test.c tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:35 +02:00
ifacecheck.c tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:35 +02:00
ifaceinherit.c tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:35 +02:00
ifaceinit.c tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:35 +02:00
Makefile.am build: Use AM_TESTS_ENVIRONMENT rather than TESTS_ENVIRONMENT 2017-05-23 13:29:40 +01:00
meson.build tests: Do not use gnome.genmarshal() 2017-07-17 13:59:20 +01:00
override.c tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:35 +02:00
paramspec-test.c tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:35 +02:00
performance-threaded.c tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:35 +02:00
performance.c tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:35 +02:00
references.c tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:35 +02:00
run-performance.sh Remove additional thread support in performance test 2010-01-13 10:24:09 +01:00
signals.c tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:35 +02:00
singleton.c tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:35 +02:00
testcommon.h tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:35 +02:00
testgobject.c tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:35 +02:00
testmarshal.list Add g_value_take_variant 2010-06-19 19:07:36 +02:00
testmodule.c tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:35 +02:00
testmodule.h tests/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:35 +02:00
timeloop-closure.c Consistently save errno immediately after the operation setting it 2017-08-03 10:21:13 +01:00