Werner Koch
fb14bf0a95
gpgscm: Use kludge to avoid improper use of ffi_schemify_name.
...
* tests/gpgscm/ffi.c (ffi_schemify_name): Use xstrdup instead of
strdup for now.
Signed-off-by: Werner Koch <wk@gnupg.org>
2016-07-14 10:52:03 +02:00
Justus Winter
f26fe4f73e
gpgscm: Improve robustness and compatibility.
...
* tests/gpgscm/ffi.c (do_getenv): Avoid gccism.
(do_mkdtemp): Handle errors.
Signed-off-by: Justus Winter <justus@g10code.com>
2016-07-05 16:24:13 +02:00
Justus Winter
9c67958c47
gpgscm: Fix memory leaks.
...
* tests/gpgscm/ffi-private.h (ffi_schemify_name): Fix prototype.
(ffi_define_function_name): Free schemified name.
(ffi_define_function): Likewise.
(ffi_define_constant): Likewise.
(ffi_define_variable_pointer): Likewise.
* tests/gpgscm/ffi.c (do_wait_processes): Free arrays.
(ffi_schemify_name): Fix type.
* tests/gpgscm/main.c (main): Free 'sc'.
Signed-off-by: Justus Winter <justus@g10code.com>
2016-06-28 18:21:50 +02:00
Justus Winter
c5e0ca5a59
gpgscm: Add more file handling functions.
...
* tests/gpgscm/ffi.c (do_glob): New function.
(ffi_init): Define new function.
* tests/gpgscm/tests.scm (basename-suffix): New function.x
Signed-off-by: Justus Winter <justus@g10code.com>
2016-06-21 18:15:30 +02:00
Justus Winter
5fbbc4b334
gpgscm: Use native string searching functions.
...
* tests/gpgscm/ffi-private.h: Handle character arguments.
* tests/gpgscm/ffi.c (do_string_index): New function.
(do_string_rindex): Likewise.
(do_string_contains): Likewise.
(ffi_init): Define new functions.
* tests/gpgscm/ffi.scm (ffi-define): New macro.
* tests/gpgscm/lib.scm (string-index): Use native function,
demonstrate behavior.
(string-rindex): Likewise.
(string-contains?): Likewise.
Demonstrate behavior of various other functions.
(read-all): Rework so that it can handle large files.
Signed-off-by: Justus Winter <justus@g10code.com>
2016-06-21 16:18:32 +02:00
Justus Winter
d2ce3f9eee
tests/gpgscm: Add a TinySCHEME-based test driver.
...
* configure.ac: Add new component.
* tests/Makefile.am: Likewise.
* tests/gpgscm/Makefile.am: New file.
* tests/gpgscm/ffi-private.h: Likewise.
* tests/gpgscm/ffi.c: Likewise.
* tests/gpgscm/ffi.h: Likewise.
* tests/gpgscm/ffi.scm: Likewise.
* tests/gpgscm/lib.scm: Likewise.
* tests/gpgscm/main.c: Likewise.
* tests/gpgscm/private.h: Likewise.
* tests/gpgscm/repl.scm: Likewise.
* tests/gpgscm/scheme-config.h: Likewise.
* tests/gpgscm/t-child.c: Likewise.
* tests/gpgscm/t-child.scm: Likewise.
* tests/gpgscm/tests.scm: Likewise.
Signed-off-by: Justus Winter <justus@g10code.com>
2016-06-17 11:57:12 +02:00