summaryrefslogtreecommitdiff
path: root/src/test/test-util.c
Commit message (Collapse)AuthorAge
* macro: add a macro to test whether a value is in a specified listLennart Poettering2013-12-02
| | | | | | | | | | | | | | | Introduce IN_SET() macro to nicely check whether a value a is one of a few listed values. This makes writing this: if (a == 1 || a == 7 || a == 8 || a == 9) nicer, by allowing this: if (IN_SET(a, 1, 7, 8, 9)) This is particularly useful for state machine enums.
* bus: add API calls to escape string components of objects pathsLennart Poettering2013-11-21
|
* tests: fix some memory leaks in testsLennart Poettering2013-10-09
|
* Fix buffer overrun when enumerating filesZbigniew Jędrzejewski-Szmek2013-09-29
| | | | | | https://bugs.freedesktop.org/show_bug.cgi?id=69887 Based-on-a-patch-by: Hans Petter Jansson <hpj@copyleft.no>
* Use udev_encode_string in fstab_node_to_udev_nodeDave Reisner2013-09-17
| | | | | Resolves a longstanding bug which caused this function to wrongly handle (escape) valid utf8 characters.
* test: Make testing work on systems without or old systemdHolger Hans Peter Freyther2013-08-22
| | | | | | | | | | | | | | * Introduce a macro to conditionally execute tests. This avoids skipping the entire test if some parts require systemd * Skip the journal tests when no /etc/machine-id is present * Change test-catalog to load the catalog from the source directory of systemd. * /proc/PID/comm got introduced in v2.6.33 but travis is still using v2.6.32. * Enable make check and make distcheck on the travis build * Use -D"CATALOG_DIR=STR($(abs_top_srcdir)/catalog)" as a STRINGIY would result in the path '/home/ich/source/linux' to be expanded to '/home/ich/source/1' as linux is defined to 1.
* tests: fix indentationThomas Hindoe Paaboel Andersen2013-08-15
|
* util: add split_pair() for splitting foo=bar stringsLennart Poettering2013-07-18
|
* tests: add more tests for shared/util.cThomas Hindoe Paaboel Andersen2013-07-16
|
* Properly check for overflow in offsetsZbigniew Jędrzejewski-Szmek2013-06-10
|
* Use attribute(unused) in PROTECT_ERRNOZbigniew Jędrzejewski-Szmek2013-04-25
| | | | | | | clang emits warnings about unused attribute _saved_errno_, which drown out other—potentially useful—warnings. gcc documentation is not exactly verbose about the effects of __attribute__((unused)) on variables, but let's assume that it works if the unit test passes.
* util: rework safe_atod() to be locale-independentLennart Poettering2013-04-25
| | | | | This adds some syntactic sugar with a macro RUN_WITH_LOCALE() that reset the thread-specific locale temporarily.
* util: make generation of profcs PID paths nicerLennart Poettering2013-04-16
|
* journal: u64log2 can be expressed just as __builtin_clzll(n) ^ 63UCristian Rodríguez2013-04-05
|
* util: be more picky when validating hostnamesLennart Poettering2013-03-22
| | | | | | | No longer allow dots at the beginning or end of host names, Or double dots. https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1152187/comments/14
* test-util: add more testsThomas Hindoe Paaboel Andersen2013-03-07
| | | | | | Improve test coverage a bit with tests for close_many strappend (to cover all ways through strnappend)
* util: properly escape corner cases in bus_path_escape(), tooLennart Poettering2013-03-05
| | | | | | This follows the suggestions from: http://lists.freedesktop.org/archives/systemd-devel/2013-March/009363.html
* test-util.c: added hexchar, unhexchar, octchar, unoctchar, decchar, ↵Daniel Buch2013-02-26
| | | | undecchar tests
* tests: add a few more tests to test-util.cThomas Hindoe Paaboel Andersen2013-02-25
| | | | | | | | | Add asserts on the resutls in FOREACH_WORD_QUOTED Added tests for: FOREACH_WORD strstrip delete_chars in_charset
* tests: more tests for util.cThomas Hindoe Paaboel Andersen2013-02-20
| | | | | | | | tests for: test_parse_pid test_parse_uid test_safe_atolli test_safe_atod
* tests: add test of memdup_multiplyThomas Hindoe Paaboel Andersen2013-02-18
|
* tests: more testsThomas Hindoe Paaboel Andersen2013-02-11
| | | | | | | | | tests for: parse_boolean env_name_is_valid Also convert assert to assert_se to make sure they are run even with optimization. (see commit 9b5d6bd909855543cba75a4469bff6f82845cf0d)
* test: add a few tests and tidy upThomas Hindoe Paaboel Andersen2013-02-06
adds test of: strv_find strv_find_prefix strv_overlap strv_sort streq_ptr first_word Splits tests of util.c into own file to avoid clutter as we add more. Removed a few prints and uses _cleanup_free_ to make the tests more focused.