path: root/tests
AgeCommit message (Collapse)AuthorFiles
2019-10-29Minor changesSergey Poznyakoff1
* src/gdbmconst.h: Don't redefine SIZE_T_MAX * src/gdbmtool.c: Likewise. Include <termios.h>, instead of <sys/termios.h> * Don't check for termios.h * tests/closerr.c: Minor fixes.
2019-04-08Update copyright yearsSergey Poznyakoff51
2018-07-01Change return value of gdbm_close and gdbm_syncSergey Poznyakoff10
* src/ (gdbm_close, gdbm_sync): Return int (GDBM_FILE_CLOSE_ERROR, GDBM_FILE_SYNC_ERROR): New error codes. * src/gdbmclose.c (gdbm_close): Return 0 on success, -1 on failure. Set gdbm_errno and errno. * src/gdbmsync.c (gdbm_sync): Likewise. * src/gdbmerrno.c: Handle new error codes. * src/mmap.c (_gdbm_mapped_sync): Set gdbm_errno. * src/proto.h (gdbm_file_sync): Set gdbm_errno. * doc/gdbm.3: Document changes. * doc/gdbm.texi: Document changes. * NEWS: Document changes. * Set patchlevel. * tests/ Add new test. * tests/ Add new test. * tests/ New test case. * tests/closerr.c: New test program. * tests/gtdel.c: Check gdbm_close return. * tests/gtdump.c: Likewise. * tests/gtfetch.c: Likewise. * tests/gtload.c: Likewise. * tests/gtopt.c: Likewise. * tests/gtrecover.c: Likewise.
2018-05-30Drop debugging hooksSergey Poznyakoff1
The hooks were introduced as a temporary tool in de7834e9. They did their job and are not necessary any more.
2018-05-29Minor changesSergey Poznyakoff1
* src/gdbmtool.c: Reduce memory consuption in -random mode. Some minor bugfixes as well.
2018-05-28Improve num2wordSergey Poznyakoff1
* tests/num2word.c: New options: -revert and -random
2018-05-27Additional validation of avail_table.Sergey Poznyakoff1
Verify that avail_table is sorted by size and that each element's size falls within allowed range. * src/bucket.c (gdbm_get_bucket): Fix bucket validation. Validate bucket_avail. (_gdbm_split_bucket): Check return from _gdbm_free. * src/falloc.c (adjust_bucket_avail,_gdbm_free): Return error code. All uses updated. (pop_avail_block): Fix eventual memory leak. Use gdbm_avail_block_validate. * src/gdbmdefs.h (gdbm_avail_table_valid_p): Change signature. * src/gdbmopen.c (gdbm_avail_table_valid_p): Traverse the array verifying address and size of each element. (gdbm_avail_block_validate) (gdbm_bucket_avail_table_validate): New functions. (validate_header): Remove call to gdbm_avail_block_valid_p. Avail_block is validated later, after it's been loaded. Bail out if header->next_block does not equal the file size. (gdbm_fd_open): Validate avail_block. * src/gdbmstore.c (_gdbm_store): Check return from _gdbm_free. Avoid endless loop in case of inconsistent h_table. * src/gdbmtool.c (_gdbm_print_avail_list): Use gdbm_avail_block_validate. * src/proto.h: Update. * tests/gtload.c: Improve error diagnostics.
2018-05-24Various fixesSergey Poznyakoff6
* src/input-std.c: Bugfix * doc/gdbm.texi: Document changes. * README: Update. * New option --enable-gdbmtool-debug. * src/ Conditionally augment AM_YFLAGS and AM_LFLAGS with options that enable debugging. * src/gdbmtool.c: Conditionally enable --lex-trace and --gram-trace options. * src/gram.y: Likewise. * src/lex.l: Likewise. * tests/ Remove architecure-dependent tests. * tests/ Likewise.
2018-05-24BugfixSergey Poznyakoff1
* tests/ (EXTRA_DIST): Add missing file.
2018-05-24Add new testSergey Poznyakoff4
2018-05-23gdbmtool: accept commands from command line as well as from fileSergey Poznyakoff8
Commands can be supplied to gdbmtool in three ways: 1. From a file, using the --file (-f) option: gdbmtool -f comfile 2. From the command line, if first argument is the database name: gdbmtool test.db count \; fetch mykey \; avail Note the use of semicolon to delimit commands. 3. From the interactive shell, if neither of the above is used. * src/ Add new sources. * src/gdbmtool.c: Use new stream functions for input. * src/gdbmtool.h (setsource): Remove proto. (instream_t): New data type. (instream_name, instream_read) (instream_close, instream_interactive) (instream_eq): New functions. (instream_stdin_create) (instream_argv_create) (instream_file_create) (interactive, input_context_push): New protos. * src/gram.y: Accept ; in place of newline. * src/input-argv.c: New file. * src/input-file.c: New file. * src/input-rl.c: Rewrite to provide instream_t API. * src/input-std.c: Likewise. * src/lex.l: Rewrite. * tests/.gitignore: Update. * tests/ Add new tests. Incorporate DejaGNU tests. * tests/config/default.exp: New file. * tests/gdbmtool/base.exp: New file. * tests/ New file. * tests/ New file. * tests/ New file. * tests/ Include new tests.
2018-05-19Catch more errorsSergey Poznyakoff4
* src/gdbmdump.c (_gdbm_dump_ascii): Break on errors * src/gdbmopen.c (compute_directory_size): Remove unused argument. (validate_header): Catch dir_size and dir_bits mismatches. * src/mmap.c (_gdbm_mapped_lseek): Bail out on negative offsets. * tests/ New test. * tests/ New test. * tests/ Add new tests. * tests/ Add new tests.
2018-05-19Add new testsSergey Poznyakoff6
* src/gdbm_dump.c: Fix exit code. * Determine presence of gzip and base64 (GZIP_BIN,BASE64_BIN): New variables. * tests/ (GZIP_BIN,BASE64_BIN): New variables. * tests/ New file. * tests/ New file. * tests/ New file. * tests/ Add new tests. * tests/ Add new tests.
2018-01-01Happy GNU YearSergey Poznyakoff45
2017-01-02Happy GNU YearSergey Poznyakoff45
2016-07-25Add debug info.Sergey Poznyakoff2
* Fix description wording. * src/ [GDBM_COND_DEBUG_ENABLE]: Don't define GDBM_DEBUG_ENABLE. * tests/ Likewise. * src/debug.c (gdbm_debug_printer) (gdbm_debug_flags): New globals. (gdbm_debug_token, gdbm_debug_parse_state) (gdbm_debug_datum): New functions. * src/ [@GDBM_DEBUG_ENABLE@]: Define GDBM_DEBUG_ENABLE. (gdbm_debug_printer_t): New typedef. (gdbm_debug_printer, gdbm_debug_flags): New externs. (GDBM_DEBUG_ERR,GDBM_DEBUG_OPEN) (GDBM_DEBUG_READ,GDBM_DEBUG_STORE) (GDBM_DEBUG_LOOKUP,GDBM_DEBUG_ALL): New defines. (gdbm_debug_token,gdbm_debug_parse_state) (gdbm_debug_datum): New protos. * src/gdbmdefs.h (GDBM_DEBUG,GDBM_DEBUG_DATUM): New macros. * src/findkey.c: Add debugging info. * src/gdbmfetch.c: Likewise. * src/gdbmopen.c: Likewise. * src/gdbmseq.c: Likewise. * src/gdbmstore.c: Likewise. * src/gdbmtool.c (open_handler): Allow the use of ~/ (command) <repeat,variadic>: New members. (run_command): Handle variadic functions. (run_last_command): New command. In interactive mode, repeats the last command if it was marked with repeat=1 (currently, only "next"). New command: "debug". (all functions): Use terror instead of fprintf(stderr,...); * src/gdbmtool.h (handler_param) <vararg>: New member. (run_last_command): New proto. * src/gram.y: Call run_last_command) on empty input. * tests/gtload.c: New option: -debug=
2016-07-20Introduce debug hooks.Sergey Poznyakoff2
* New option --enable-debug Print feature summary at the end of the run. * src/debug.c: New file. * src/ [GDBM_COND_DEBUG_ENABLE]: Build debug.o Define GDBM_DEBUG_ENABLE. * src/gdbmdefs.h [GDBM_DEBUG_ENABLE] (_gdbm_debug_hook_install) (_gdbm_debug_hook_remove,_gdbm_debug_hook_check) (_gdbm_debug_hook_val): New protos. (GDBM_DEBUG_HOOK, GDBM_DEBUG_OVERRIDE) (GDBM_DEBUG_ALLOC): New defines. * src/ (GDBM_RCVR_FORCE): New flag. * src/recover.c (gdbm_recover): Check database before attempting recovery, unless GDBM_RCVR_FORCE flag is set. * doc/gdbm.texi: Document GDBM_RCVR_FORCE * src/gdbmreorg.c (gdbm_reorganize): Use GDBM_RCVR_FORCE. * src/gdbmtool.c (main): Always allocate file_name. * src/bucket.c: Put GDBM_DEBUG_OVERRIDE and GDBM_DEBUG_ALLOC in critical places. * src/falloc.c: Likewise. * src/findkey.c: Likewise. * src/gdbmopen.c: Likewise. * src/gdbmstore.c: Likewise. * src/update.c: Likewise. * tests/ [GDBM_COND_DEBUG_ENABLE]: Define GDBM_DEBUG_ENABLE. * tests/gtload.c: New options -hook, -recover, -verbose, -backup, -max-failures, -max-failed-keys, and -max-failed-buckets. Attempt recovery after errors.
2016-07-19Implement gdbm_recover functionSergey Poznyakoff3
* Don't check for rename. * src/ (libgdbm_la_SOURCES): Add recover.c * src/recover.c: New file. * src/bucket.c (_gdbm_get_bucket): Remove extra space before [ * src/err.c (prerror): Take additional argument (gdbm_perror): Print system errno if necessary. * src/ (GDBM_CLOERROR): New flag. (gdbm_fd_open, gdbm_copy_meta): New proto. (gdbm_last_syserr,gdbm_db_strerror,gdbm_recover): New proto. (gdbm_syserr): New extern. (gdbm_recovery): New struct. (GDBM_RCVR_DEFAULT,GDBM_RCVR_ERRFUN) (GDBM_RCVR_MAX_FAILED_KEYS) (GDBM_RCVR_MAX_FAILED_BUCKETS) (GDBM_RCVR_MAX_FAILURES) (GDBM_RCVR_BACKUP): New flags. (GDBM_BACKUP_FAILED): New error code. * src/gdbmclose.c (gdbm_close): Work correctly if dbf->desc == -1. * src/gdbmcount.c (gdbm_count): Remove spurious sorting. Use _gdbm_next_bucket_dir for iterating over the buckets. * src/gdbmdefs.h (struct gdbm_file_info)<last_syserror> <last_errstr>: New members. * src/gdbmerrno.c (gdbm_set_errno): Set last_syserror as well. (gdbm_clear_error): Reset last_syserror. (gdbm_last_syserr): New function. (gdbm_errlist): New entry for GDBM_BACKUP_FAILED. (gdbm_db_strerror): New function. (gdbm_syserr): New global. * src/gdbmload.c (get_parms): Buffer can be NULL. * src/gdbmopen.c (gdbm_fd_open): New function. (gdbm_open): Rewrite as a wrapper over gdbm_fd_open. * src/gdbmreorg.c (gdbm_reorganize): Rewrite as a wrapper over gdbm_recover. * src/proto.h (_gdbm_next_bucket_dir): New proto. * src/gdbmtool.c: New command: recover. * tests/.gitignore: Add gtrecover * tests/gtrecover.c: New test program. * tests/ Build gtrecover
2016-07-15New gdbm_setopt option to get the actual block size valueSergey Poznyakoff6
* src/ (GDBM_GETBLOCKSIZE): New option. * src/gdbmcount.c (gdbm_count): Fix memory leak on error. * src/gdbmsetopt.c (gdbm_setopt): Rewrite. Handle GDBM_GETBLOCKSIZE. * NEWS: Document GDBM_GETBLOCKSIZE * doc/gdbm.texi: Likewise. * tests/gtload.c: New options -bsexact and -verbose. * tests/ Add new testcases. * tests/ Likewise. * tests/ New testcase. * tests/ Likewise. * tests/ Likewise.
2016-07-08Fix error handling in gdbm_fetch, gdbm_firstkey, and gdbm_nextkey.Sergey Poznyakoff2
* src/gdbmfetch.c: Hanlde out of memory error. * src/findkey.c: Set gdbm_errno to GDBM_ITEM_NOT_FOUND if nothing was found. * src/gdbmdelete.c: Don't set gdbm_errno after _gdbm_findkey returns -1. It's been done already. * src/gdbmexp.c (gdbm_export_to_file): Return -1 if gdbm_fetch fails. * src/gdbmseq.c (get_next_key): Set gdbm_errno to GDBM_ITEM_NOT_FOUND if there's no next key. Don't call _gdbm_fatal on out of memory condition. (gdbm_nextkey): Set gdbm_errno to GDBM_ITEM_NOT_FOUND if there's no next key. * src/gdbmtool.c (fetch_handler) (firstkey_handler,nextkey_handler): Check gdbm_errno. * src/gdbmstore.c: Handle error return from _gdbm_findkey. * tests/gtdump.c: Likewise. * tests/gtfetch.c: Likewise. * doc/gdbm.texi: Document changes. * doc/gdbm.3: Likewise. * Version 1.12.90 * NEWS: Update. * .gitignore: Update.
2016-07-07Switch to Git repositorySergey Poznyakoff1
2014-05-23Compatibility bugfixesSergey Poznyakoff4
* THANKS: Add Thomas Klausner. * src/gdbmtool.h: Rename ARG_ constants to GDBM_ARG_ * src/gdbmtool.c: Likewise. * tests/ Use modern sort -k syntax. * tests/ Likewise. * tests/ Likewise. * tests/ Likewise.
2013-05-13Handle structured key and content data in gdbmtool.Sergey Poznyakoff2
* src/datconv.c: New file. * src/ (gdbmtool_SOURCES): Add datconv.c. * src/gdbmtool.h (slist, kvpair): New structures. (gdbmarg): Keep various types of data depending on the value of the type member. (slist_new, slist_free) (kvpair_string, kvpair_list): New protos. (gdbmarg_new): Remove. (gdbmarg_string, gdbmarg_datum) (gdbmarg_kvpair, gdbmarg_free) (gdbmarg_destroy): New protos. (xd_expand, xd_store, datadef_locate): New protos. (field, dsegm): New structs. (dsegm_new, dsegm_new_field, dsegm_free_list): New protos. * src/gdbmtool.c: Rewrite. * src/gram.y: Change grammar to allow for defining key and content structure and for supplying structured data as arguments to fetch, store and similar functions. * src/lex.l: Handle new token types. * tests/dtload.c (main): Fix parser. * tests/gtload.c: Likewise.
2013-05-09Use AM_CPPFLAGS instead of INCLUDES in MakefilesSergey Poznyakoff1
2012-03-21Bugfixes in test suiteSergey Poznyakoff2
* tests/ Use cmp -s || diff -u instead of plain diff, because the latter produces extra output on some systems (notably Solaris). * tests/ Likewise. * THANKS: Add Bill Jones
2011-11-11Implement cloexec in gdbm_reorganize. Add test cases.Sergey Poznyakoff11
* compat/dbmopen.c: Apply O_CLOEXEC for newly created dir file, if requested. * src/gdbmdefs.h (gdbm_file_info) <cloexec>: New member. * src/gdbmopen.c (gdbm_open): Initialize cloexec member. * src/gdbmreorg.c (gdbm_reorganize): Propagate cloexec bit to the new database. * tests/.cvsignore: Update. * tests/ New test case. * tests/ Likewise. * tests/ Likewise. * tests/ Likewise. * fdop.c: New auxiliary program. * g_open_ce: New test program. * g_reorg_ce: New test program. * d_creat_ce: New test program. * tests/ Add new test cases and test programs. * tests/ Include new test cases. * doc/gdbm.texinfo: Minor change.
2011-11-10Fix handling of NDBM databases in read-only mode.Sergey Poznyakoff5
* compat/dbmopen.c (ndbm_open_dir_file0): Open dir file in read-only mode if the database is being opened as GDBM_READER. * tests/ New file. * tests/ New file. * tests/ New file. * tests/ (TESTSUITE_AT): Add new files. * tests/ Include new testcases.
2011-08-12Bugfixes (pointed out by Matthew Burgess).Sergey Poznyakoff1
* src/gdbmopen.c: Fix a typo. * tests/ ($(srcdir)/package.m4): Fix improper dependency.
2011-08-11Add testcases for gdbm_setopt.Sergey Poznyakoff6
* tests/gtopt.c: New file * tests/.cvsignore: Update. * tests/ New testcase. * tests/ New testcase. * tests/ Build gtopt. Add and * tests/ Include and
2011-08-10Improve memory mapping support.Sergey Poznyakoff1
The new code is more flexible and performs better when lots of inserts are being made (e.g. when populating the database with new data). * src/ (GDBM_SETMAXMAPSIZE): New constant. * src/gdbmconst.h (SIZE_T_MAX): New define. * src/gdbmdefs.h (gdbm_file_info) <cache_size>: Change type to size_t. <mmap_inited,mapped_size_max>: New member. <mapped_remap>: Remove. * src/gdbmopen.c: Fix a typo. (gdbm_open): Initialize new members. (_gdbm_init_cache): Second argument is size_t. * src/gdbmsetopt.c (gdbm_setopt): Optval argument is void*. Handle GDBM_SETMAXMAPSIZE. Improve error checking. * src/mmap.c (_GDBM_IN_MAPPED_REGION_P): Fix comparison with the lower bound. (_GDBM_NEED_REMAP): Return true if mapped_region is NULL. (SUM_FILE_SIZE): Rewrite. (_gdbm_mapped_unmap): Don't call msync. (_gdbm_internal_remap): Take 2 arguments, the second one giving the new mapped size. Unmap the region prior to remapping it. Always pass NULL as the argument to mmap. (_gdbm_mapped_remap): Rewrite the logic. Change semantics of the third argument. All uses updated. (_gdbm_mapped_init): Reflect the above changes. (_gdbm_mapped_read,_gdbm_mapped_write): Use mmap_inited to decide whether to use mmap, because mapped_region can be reset to zero by another functions (namely, _gdbm_mapped_lseek). Reset mmap_inited to FALSE, if _gdbm_mapped_remap fails. (_gdbm_mapped_lseek): Rewrite offset computations. Invalidate the mapped region. * src/proto.h (_gdbm_init_cache): Change prototype. * src/update.c (write_header, _gdbm_end_update): Remove checks for dbf->mapped_region. * tests/gtload.c: Implement the -maxmap option (set maximal mapped memory size). * doc/gdbm.texinfo: Document GDBM_SETMAXMAPSIZE.
2011-08-08Provide test group descriptors in the testsuite.Sergey Poznyakoff9
* tests/ (XFAILFILE): Remove. * tests/ Don't create XFAILFILE. * tests/ Add test group banners * tests/ (AT_SETUP): Change description. * tests/ Likewise. * tests/ Likewise. * tests/ Likewise. * tests/ Likewise. * tests/ Likewise.
2011-08-05Define AT_PACKAGE_VERSION_MAJOR,Sergey Poznyakoff1
2011-08-05UpdateSergey Poznyakoff1
2011-08-05New file.Sergey Poznyakoff1
2011-08-05New files.Sergey Poznyakoff2
2011-08-05New files.Sergey Poznyakoff9
2011-08-05(AT_COMPAT_PREREQ): New macro.Sergey Poznyakoff1
Add compat test cases.
2011-08-05Include progname.h instead of declaring canonical_progname.Sergey Poznyakoff5
2011-08-05Update keywords.Sergey Poznyakoff6
2011-08-05Conditionally define COMPAT.Sergey Poznyakoff1
2011-08-05Add new files.Sergey Poznyakoff1
2011-08-03Use gtver instead of testgdbm.Sergey Poznyakoff1
2011-08-03Add gtverSergey Poznyakoff1
2011-08-03(check_PROGRAMS): Add gtver.Sergey Poznyakoff1
2011-08-03New file.Sergey Poznyakoff1
2011-08-02Add delete tests.Sergey Poznyakoff9
2011-08-02Update cvsignore files.Sergey Poznyakoff1
2011-08-02UpdateSergey Poznyakoff1
2011-08-02Add tests.Sergey Poznyakoff11

Return to:

Send suggestions and report system problems to the System administrator.