summaryrefslogtreecommitdiff
path: root/gl/tests
AgeCommit message (Collapse)Author
2010-07-06du: Hash with a mechanism that's simpler and takes less memory.Paul Eggert
* gl/lib/dev-map.c, gl/lib/dev-map.h, gl/modules/dev-map: Remove. * gl/lib/ino-map.c, gl/lib/ino-map.h, gl/modules/ino-map: New files. * gl/modules/dev-map-tests, gl/tests/test-dev-map.c: Remove. * gl/modules/ino-map-tests, gl/tests/test-ino-map.c: New files. * gl/lib/di-set.h (struct di_set): Renamed from struct di_set_state, and now private. All uses changed. (_ATTRIBUTE_NONNULL_): Don't assume C99. (di_set_alloc): Renamed from di_set_init, with no size arg. Now allocates the object rather than initializing it. For now, this no longer takes an initial size; we can put this back later if it is needed. * gl/lib/di-set.c: Include hash.h, ino-map.h, and limits.h instead of stdio.h, assert.h, stdint.h, sys/types.h (di-set.h includes that now), sys/stat.h, and verify.h. (N_DEV_BITS_4, N_INO_BITS_4, N_DEV_BITS_8, N_INO_BITS_8): Remove. (struct dev_ino_4, struct dev_ino_8, struct dev_ino_full): Remove. (enum di_mode): Remove. (hashint): New typedef. (HASHINT_MAX, LARGE_INO_MIN): New macros. (struct di_ent): Now maps a dev_t to a inode set, instead of containing a union. (struct dev_map_ent): Remove. (struct di_set): New type. (is_encoded_ptr, decode_ptr, di_ent_create): Remove. (di_ent_hash, di_ent_compare, di_ent_free, di_set_alloc, di_set_free): (di_set_insert): Adjust to new representation. (di_ino_hash, map_device, map_inode_number): New functions. * gl/modules/di-set (Depends-on): Replace dev-map with ino-map. Remove 'verify'. * gl/tests/test-di-set.c: Adjust to the above changes to API. * src/du.c (INITIAL_DI_SET_SIZE): Remove. (hash_ins, main): Adjust to new di-set API.
2010-07-04di-set: manipulate sets of dev/inode pairs efficientlyJim Meyering
* gl/lib/di-set.c: Implementation. * gl/lib/di-set.h: Declarations. * gl/modules/di-set: Define module. * gl/modules/di-set-tests: Define test module. * gl/tests/test-di-set.c: Likewise.
2010-07-04dev-map: map device number to small non-negativeJim Meyering
* gl/lib/dev-map.c: New file. * gl/lib/dev-map.h: Declarations. * gl/modules/dev-map: Define primary modules. * gl/modules/dev-map-tests: Define test module. * gl/tests/test-dev-map.c: Test it.
2010-03-19maint: mbsalign: fix an edge case where we truncate too muchPádraig Brady
* gl/lib/mbsalign.c (mbsalign): Ensure the temporary destination buffer is big enough, as it may need to be bigger than the source buffer in the presence of single byte non printable chars. * gl/tests/test-mbsalign.c (main): Add a test to trigger the issue.
2010-03-19maint: update the mbsalign modulePádraig Brady
* gl/lib/mbsalign.c (mbsalign): Support the MBA_UNIBYTE_FALLBACK flag which reverts to unibyte mode if one can't allocate memory or if there are invalid multibyte characters present. Note memory is no longer dynamically allocated in unibyte mode so one can assume that mbsalign() will not return an error if this flag is present. Don't calculate twice, the number of spaces, when centering. Suppress a signed/unsigned comparison warning. (ambsalign): A new wrapper function to dynamically allocate the minimum memory required to hold the aligned string. * gl/lib/mbsalign.h: Add the MBA_UNIBYTE_FALLBACK flag and also document others that may be implemented in future. (ambsalign): A prototype for the new wrapper. * gl/tests/test-mbsalign.c (main): New test program. * gl/modules/mbsalign-tests: A new index to reference the tests. * .x-sc_program_name: Exclude test-mbsalign.c from this check.
2009-07-04move argv-iter module to gnulibJim Meyering
* gl/lib/argv-iter.c: Remove file. * gl/lib/argv-iter.h: Remove file. * gl/modules/argv-iter: Remove file. * gl/modules/argv-iter-tests: Remove file. * gl/tests/test-argv-iter.c: Remove file. * gnulib: Update submodule, to get argv-iter
2009-06-23maint: update all Copyright year lists to include 2009Jim Meyering
2009-03-27tests: test-argv-iter.c: avoid declaration-after-stmtJim Meyering
* gl/tests/test-argv-iter.c: Move declaration "up", so as not to ruffle feathers of crufty compilers. We accommodate such compilers here solely because this module may migrate to gnulib. Tiny patch by Matthew Woehlke.
2008-12-01argv-iter: add testsJim Meyering
* gl/modules/argv-iter-tests: New module. * gl/tests/test-argv-iter.c: New file.