summaryrefslogtreecommitdiff
path: root/lib/util/tests/file.c
AgeCommit message (Collapse)AuthorFilesLines
2020-11-13s4-torture: test file_line_parse as wellGünther Deschner1-0/+31
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Fri Nov 13 17:47:33 UTC 2020 on sn-devel-184
2019-06-04lib/util/tests: clang fix Value stored to 'lines' is never read warningNoel Power1-1/+1
Fixes lib/util/tests/file.c:153:2: warning: Value stored to 'lines' is never read <--[clang] Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org>
2018-12-19lib/util: Count a trailing line that doesn't end in a newlineMartin Schwenke1-0/+152
If the final line of a file does not contain a newline then it isn't included in the line count. Change i to point to the next slot in the array instead of the current one. This means that that the current line won't be thrown away if no newline is seen. Without changing i to unsigned int, the -O3 --picky -developer build fails with: [ 745/4136] Compiling lib/util/util_file.c ==> /builds/samba-team/devel/samba/samba-o3.stderr <== ../../lib/util/util_file.c: In function ‘file_lines_parse’: ../../lib/util/util_file.c:251:8: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow] while (i > 0 && ret[i-1][0] == 0) { ^ cc1: all warnings being treated as errors BUG: https://bugzilla.samba.org/show_bug.cgi?id=13717 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Dec 19 08:08:28 CET 2018 on sn-devel-144
2015-04-21lib: Fix a few CIDs for Resource LeakVolker Lendecke1-5/+10
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2014-04-02lib/util/tests: add missing #include "torture/local/proto.h"Stefan Metzmacher1-0/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2010-12-11s4-smbtorture: Make test names lowercase and dot-separated.Jelmer Vernooij1-3/+2
This is consistent with the test names used by selftest, should make the names less confusing and easier to integrate with other tools. Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sat Dec 11 04:16:13 CET 2010 on sn-devel-104
2008-10-13Test maxsize parameter to file_load() as used in Samba 3.Jelmer Vernooij1-0/+6
2008-10-12Fix number of arguments for file_load() functions.Jelmer Vernooij1-1/+1
2008-10-11Move lib/util from source4 to top-level libutil.Jelmer Vernooij1-0/+97
Conflicts: source4/Makefile