summaryrefslogtreecommitdiff
path: root/glib/tests/mem-overflow.c
Commit message (Collapse)AuthorAgeFilesLines
* Add a SPDX LicenseRef for the license historically used for testsSimon McVittie2022-11-021-0/+2
| | | | | | | | | | | | | Some of GLib's unit tests are under an apparently GLib-specific permissive license, vaguely similar to the BSD/MIT family but with the GPL's lack-of-warranty wording. This is not on SPDX's list of well-known licenses, so we need to use a custom license name prefixed with LicenseRef if we want to represent this in SPDX/REUSE syntax. Most of the newer tests seem to be licensed under LGPL-2.1-or-later instead. Signed-off-by: Simon McVittie <smcv@collabora.com>
* gtestutils: Add G_TEST_SUBPROCESS_DEFAULT, G_TEST_TRAP_DEFAULTSimon McVittie2022-06-231-3/+6
| | | | | | | This makes calls to test subprocesses with default behaviour more self-documenting. Signed-off-by: Simon McVittie <smcv@collabora.com>
* Add tests for g_aligned_alloc()Emmanuele Bassi2022-02-111-2/+19
| | | | | We want to test the API contract, by checking the return value for zero-sized allocations, invalid alignments, and overflows.
* tests: Drop use of g_test_bug_base()Philip Withnall2021-05-131-3/+1
| | | | | | | | | | | | Include the base URI in the `g_test_bug()` calls instead. This resolves inconsistencies between the old bug base (bugzilla.gnome.org) and the new bug base (gitlab.gnome.org). It also has the advantage that the URI passed to `g_test_bug()` is now clickable in the code editor, rather than being split across two locations. See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/275#note_303175 Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* tests: Fix a pragma warning on FreeBSDPhilip Withnall2019-08-241-1/+1
| | | | | | | | | | | | This fixes the following warning, by making the compiler checks for the `pop` match those for the `push`: ``` [221/1124] Compiling C object 'glib/tests/d796b50@@mem-overflow@exe/mem-overflow.c.o'. ../glib/tests/mem-overflow.c:204:24: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas] #pragma GCC diagnostic pop ``` Signed-off-by: Philip Withnall <withnall@endlessm.com>
* Check GCC version before ignoring diagnostic messageEmmanuele Bassi2019-04-301-1/+1
| | | | | | The `alloc-size-larger-than` warning is available starting with GCC 7, and using it in a pragma will generate a warning on older versions of GCC.
* Ignore GCC memory overflow warnings when testing overflowsEmmanuele Bassi2018-03-281-0/+6
| | | | | | | We know we are overflowing the maximum allocation: it's what we're testing for. https://bugzilla.gnome.org/show_bug.cgi?id=794732
* tests: Fix for non-GCCChun-wei Fan2013-11-111-0/+6
| | | | | | | Remove uses of using empty arrays in initialization and structs, and build tests that rely on GCCisms on GCC only. https://bugzilla.gnome.org/show_bug.cgi?id=711047
* mem-overflow: test malloc and realloc corner casesMatthias Clasen2013-06-011-0/+25
|
* tests: port from g_test_trap_subprocess() to g_test_trap_fork()Dan Winship2013-05-131-50/+93
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=679683
* Revert "tests: port from g_test_trap_subprocess() to g_test_trap_fork()"Matthias Clasen2012-12-191-93/+50
| | | | This reverts commit ea06ec80634ff8f22882f3bc92effb10ac294e41.
* tests: port from g_test_trap_subprocess() to g_test_trap_fork()Dan Winship2012-12-191-50/+93
| | | | | | (or, in a few cases, to g_test_expect_message()) https://bugzilla.gnome.org/show_bug.cgi?id=679683
* various tests: do not provoke SIGTRAP with -m no-undefinedSimon McVittie2011-12-271-1/+12
| | | | | | | | | | | Some of the GLib tests deliberately provoke warnings (or even fatal errors) in a forked child. Normally, this is fine, but under valgrind it's somewhat undesirable. We do want to follow fork(), so we can check for leaks in child processes that exit gracefully; but we don't want to be told about "leaks" in processes that are crashing, because there'd be no point in cleaning those up anyway. https://bugzilla.gnome.org/show_bug.cgi?id=666116
* various GLib tests: plug memory leaksSimon McVittie2011-12-141-4/+19
| | | | | | | | | These don't really matter, since it's test code, but they do obscure real leaks in the library. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666115 Acked-by: Matthias Clasen <mclasen@redhat.com>
* Add bug references to some testsMatthias Clasen2010-08-131-0/+29
|
* undef the proper macros to avoid warning messageRyan Lortie2010-03-051-2/+2
|
* Bug 608196 - Overflow-safe g_new familyBehdad Esfahbod2010-03-031-0/+108
New public API: g_malloc_n g_malloc0_n g_realloc_n g_try_malloc_n g_try_malloc0_n g_try_realloc_n