summaryrefslogtreecommitdiffstats
path: root/src/shared/test-tables.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* test-tables: make sure we can test tables of either int or int64_t base typeLennart Poettering2021-02-161-37/+32
| | | | | To support both types, we unfortunately need to go down the macro rabbit hole a bit more. But it works.
* Return -EINVAL from _from_string() functionsZbigniew Jędrzejewski-Szmek2021-02-101-2/+2
| | | | | | | | | | | | We'd return -1 (-EPERM), even though we have a general rule to use real errno values. The particular case that caught my attention was: $ sudo udevadm control -l asdf Failed to parse log priority 'asdf': Operation not permitted ... but "git grep 'r =.*_from_string' src/" return 110 hits. Confusingly, some of the _from_string functions already return a proper errno value, so not all of those are broken, but probably quite a few.
* test-tables: make the assert more readableZbigniew Jędrzejewski-Szmek2021-02-101-3/+7
| | | | | | Doing it all in one line and with negation in front seemed like a good idea at some point, but I think it is vastly easier to understand when it is split out a bit.
* test-tables: fix warning about NULL used in printfZbigniew Jędrzejewski-Szmek2021-02-101-1/+1
| | | | | With the simplified asserts, newer gcc is able to (correctly) figure out that NULL was being passed.
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* Drop my copyright headersZbigniew Jędrzejewski-Szmek2018-06-141-3/+0
| | | | | | | perl -i -0pe 's/\s*Copyright © .... Zbigniew Jędrzejewski.*?\n/\n/gms' man/*xml git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/(#\n)?# +Copyright © [0-9, -]+ Zbigniew Jędrzejewski.*?\n//gms' git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/\s*\/\*\*\*\s+Copyright © [0-9, -]+ Zbigniew Jędrzejewski[^\n]*?\s*\*\*\*\/\s*/\n\n/gms' git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/\s+Copyright © [0-9, -]+ Zbigniew Jędrzejewski[^\n]*//gms'
* tree-wide: beautify remaining copyright statementsLennart Poettering2018-06-141-1/+1
| | | | | | Let's unify an beautify our remaining copyright statements, with a unicode ©. This means our copyright statements are now always formatted the same way. Yay.
* tree-wide: drop 'This file is part of systemd' blurbLennart Poettering2018-06-141-2/+0
| | | | | | | | | | | | | | | | This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit.
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-04-061-13/+0
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* log: minimize includes in log.hLennart Poettering2018-01-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | log.h really should only include the bare minimum of other headers, as it is really pulled into pretty much everything else and already in itself one of the most basic pieces of code we have. Let's hence drop inclusion of: 1. sd-id128.h because it's entirely unneeded in current log.h 2. errno.h, dito. 3. sys/signalfd.h which we can replace by a simple struct forward declaration 4. process-util.h which was needed for getpid_cached() which we now hide in a funciton log_emergency_level() instead, which nicely abstracts the details away. 5. sys/socket.h which was needed for struct iovec, but a simple struct forward declaration suffices for that too. Ultimately this actually makes our source tree larger (since users of the functionality above must now include it themselves, log.h won't do that for them), but I think it helps to untangle our web of includes a tiny bit. (Background: I'd like to isolate the generic bits of src/basic/ enough so that we can do a git submodule import into casync for it)
* Add SPDX license identifiers to source files under the LGPLZbigniew Jędrzejewski-Szmek2017-11-191-0/+1
| | | | | This follows what the kernel is doing, c.f. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5fd54ace4721fc5ce2bb5aef6318fcf17f421460.
* test-tables: ellide boring parts of sparse mappingsZbigniew Jędrzejewski-Szmek2016-01-291-4/+11
|
* test: use assert_se() when testing tables so that we get a useful error when ↵Lennart Poettering2014-10-281-4/+3
| | | | something fails
* test-tables: add new entriesZbigniew Jędrzejewski-Szmek2014-07-171-0/+3
| | | | | | One missing string found. A few things had to be moved around to make it possible to test them.
* test-tables: allow sparse tables and check mapping for -1Zbigniew Jędrzejewski-Szmek2013-07-161-4/+7
| | | | | | | Jan: test-tables fails on my system. The one it's failing on is: syscall: 222 → (null) → -1 ... and indeed, our own tables should not have holes, but syscall tables certainly might.
* test: add trivial test for syscall table and extend table tests to error pathsZbigniew Jędrzejewski-Szmek2013-07-141-3/+5
|
* tests: add tests for string lookup tablesZbigniew Jędrzejewski-Szmek2013-07-051-0/+46
The tests check if the tables have entries for all values in the enum, and that the entries are unique.