summaryrefslogtreecommitdiff
path: root/src/shared/test-tables.h
AgeCommit message (Collapse)AuthorFilesLines
2023-07-05Fix to check if string is NULL or notaccepted/tizen/unified/riscv/20230718.003643accepted/tizen/unified/20230706.152155wchang kim1-1/+1
An error occured while trying to build for riscv64 using gcc-13: > [ 105s] In file included from ../src/nspawn/test-nspawn-tables.c:4: > [ 105s] ../src/shared/test-tables.h: In function '_test_table.constprop': > [ 105s] ../src/shared/test-tables.h:30:42: error: '%s' directive argument is null [-Werror=format-overflow=] > [ 105s] 30 | printf("%s: %d → %s → %d\n", name, i, val, rev); > [ 105s] | ^~ > [ 105s] ../src/shared/test-tables.h:30:42: error: '%s' directive argument is null [-Werror=format-overflow=] > [ 105s] cc1: some warnings being treated as errors The "val" can be NULL but the original code does not checking it, so the compiler is complaining about it. To fix this issue, ternary operator for val was used: > printf("%s: %d → %s → %d\n", name, i, val ? val : "(null)", rev); Change-Id: I8f1b2b45d152ec362977154f62e333807392da76 Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
2018-06-14Drop my copyright headersZbigniew Jędrzejewski-Szmek1-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'
2018-06-14tree-wide: beautify remaining copyright statementsLennart Poettering1-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.
2018-06-14tree-wide: drop 'This file is part of systemd' blurbLennart Poettering1-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.
2018-04-06tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek1-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.
2018-01-11log: minimize includes in log.hLennart Poettering1-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)
2017-11-19Add SPDX license identifiers to source files under the LGPLZbigniew Jędrzejewski-Szmek1-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.
2016-01-29test-tables: ellide boring parts of sparse mappingsZbigniew Jędrzejewski-Szmek1-4/+11
2014-10-28test: use assert_se() when testing tables so that we get a useful error when ↵Lennart Poettering1-4/+3
something fails
2014-07-16test-tables: add new entriesZbigniew Jędrzejewski-Szmek1-0/+3
One missing string found. A few things had to be moved around to make it possible to test them.
2013-07-16test-tables: allow sparse tables and check mapping for -1Zbigniew Jędrzejewski-Szmek1-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.
2013-07-13test: add trivial test for syscall table and extend table tests to error pathsZbigniew Jędrzejewski-Szmek1-3/+5
2013-07-05tests: add tests for string lookup tablesZbigniew Jędrzejewski-Szmek1-0/+46
The tests check if the tables have entries for all values in the enum, and that the entries are unique.