Commit graph

24 commits

Author SHA1 Message Date
Simon Peeters e3e45d4f82 strv: multiple cleanups
- turn strv_merge into strv_extend_strv.
   appending strv b to the end of strv a instead of creating a new strv
- strv_append: remove in favor of strv_extend and strv_push.
- strv_remove: write slightly more elegant
- strv_remove_prefix: remove unused function
- strv_overlap: use strv_contains
- strv_printf: STRV_FOREACH handles NULL correctly
2014-01-05 09:16:15 -05:00
Thomas Hindoe Paaboel Andersen 5fba7bbfa4 scan-build: silence some warnings
test-fileio/test-strv:
Use the streq_ptr to make build-scan not worry about passing in a null
to a nonnull function.

test-dhcp-option:
Prevent a theoretical null pointer dereference
2013-12-12 23:08:47 +01:00
Lennart Poettering 70f75a523b util: fix handling of trailing whitespace in split_quoted()
Inspired by a patch by Lukas Nykryn.
2013-11-28 18:42:18 +01:00
Daniel Buch aed2ebfed0 test-strv: add strv_split, strv_split_newline, strv_remove_prefix 2013-11-07 01:23:55 -05:00
Lennart Poettering 897e7561a0 strv: introduce new STRV_MAKE and STRV_MAKE_EMPTY macros to create string arrays nicely on the fly 2013-10-29 20:09:16 +01:00
Lennart Poettering 250a918dc4 strv: introduce new strv_from_stdarg_alloca() macro to generate a string array from stdarg function parameters
This allows us to turn lists of strings passed in easily into string
arrays without having to allocate memory.
2013-10-29 19:53:43 +01:00
Daniel Buch 02f19706a9 test-strv.c: added STRV_FOREACH and STRV_FOREACH_BACKWARDS 2013-10-27 11:51:22 -04:00
Lennart Poettering 1731e34a4e tmpfiles: support simple specifier expansion for specified paths 2013-09-17 11:02:54 -05:00
Lennart Poettering 19f6d71077 specifier: rework specifier calls to return proper error message
Previously the specifier calls could only indicate OOM by returning
NULL. With this change they will return negative errno-style error codes
like everything else.
2013-09-17 10:06:50 -05:00
Zbigniew Jędrzejewski-Szmek a6fde35332 systemd-run: properly escape arguments
Spaces, quotes, and such, were not properly escaped. We should
write them like we read them.

https://bugs.freedesktop.org/show_bug.cgi?id=67971
2013-09-09 13:49:29 -04:00
Zbigniew Jędrzejewski-Szmek 1e64bbc156 test-strv: do not declare table to be sorted const
Segmentation fault under clang.
2013-04-05 00:31:59 -04:00
Daniel Buch 4c325b2efe test-strv.c: test STRV_FOREACH_PAIR macro 2013-03-18 21:09:02 +01:00
Daniel Buch 9f31636648 test-strv.c: ported test_specifier_printf() to _cleanup_free_ + assert_se + cleanup 2013-02-18 23:57:56 +01:00
Daniel Buch 04045d8426 test-strv.c: added OOM check for current tests
New OOM check patch:

I do assert_se() before variable is used to do correct check.
2013-02-18 23:57:48 +01:00
Daniel Buch 2f213f7493 test-strv.c: added strv_split_nulstr() test 2013-02-18 23:57:43 +01:00
Daniel Buch 7b68d618a2 test-strv.c: Changed assert() to assert_se()
test-strv.c: Indent fix
2013-02-13 20:22:12 +01:00
Daniel Buch 40857008d8 test-strv.c: added strv_append test 2013-02-13 20:22:09 +01:00
Daniel Buch 343a896935 test-strv.c: added strv_merge_concat test 2013-02-13 20:22:05 +01:00
Daniel Buch a1022300b9 test-strv.c: added strv_merge test 2013-02-13 20:21:44 +01:00
Thomas Hindoe Paaboel Andersen 10ddd913f0 tests: move strv_parse_nulstr to test-strv, and actually test it
The test was originally added with this commit message:
"ask-password: supported plymouth cached passwords"
2013-02-07 00:38:16 +01:00
Thomas Hindoe Paaboel Andersen 539ad707db test: add a few tests and tidy up
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.
2013-02-06 21:15:23 +01:00
Daniel Buch 682cfdff69 test-strv.c: test strv_join added 2013-01-30 23:37:39 -05:00
Daniel Buch 3a7719d303 test-strv.c: Split tests into seperate functions
test-strv.c: Leaves main clean for additional tests
2013-01-30 23:37:39 -05:00
Lennart Poettering 379079ba6b test: test tools should still be in the src/ directory 2012-04-12 13:48:01 +02:00
Renamed from test/test-strv.c (Browse further)