summaryrefslogtreecommitdiff
path: root/libmailutils/tests/logstr.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2017-06-15 17:17:14 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2017-06-15 17:27:35 +0300
commit75b1c55e4db1c0b90e898b1375f1489e72719127 (patch)
tree0d1b2513b6887013fb468ad65cd7e8fd56ddfff3 /libmailutils/tests/logstr.c
parent74e285e77d204d15ef2dedd40483003c3d5746a7 (diff)
downloadmailutils-75b1c55e4db1c0b90e898b1375f1489e72719127.tar.gz
mailutils-75b1c55e4db1c0b90e898b1375f1489e72719127.tar.bz2
Fix id reference counting
* include/mailutils/locus.h: Add copyleft. (mu_ident_stat): New proto. * include/mailutils/types.hin (mu_locus_DEPRECATED): Update commit. Include link to the wiki article. * include/mailutils/yyloc.h: Add copyleft. * libmailutils/locus/ident.c (mu_ident_stat): New function. * libmailutils/locus/locus.c (mu_locus_point_init) (mu_locus_point_copy): Don't touch destination unless setting mu_file member succeeds. (mu_locus_range_copy): deinitialize dest before assignment. * libmailutils/stream/logstream.c (_log_write): Use mu_locus_range_copy to save locus. (mu_ioctl_logstream_get_locus_deprecated) (mu_ioctl_logstream_set_locus_deprecated): Include link to the wiki article. * libmailutils/tests/linetrack.c (main): Destroy tracker before exiting. * libmailutils/tests/logstr.c: Make it possible to run selected tests.
Diffstat (limited to 'libmailutils/tests/logstr.c')
-rw-r--r--libmailutils/tests/logstr.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/libmailutils/tests/logstr.c b/libmailutils/tests/logstr.c
index 638f9b8a7..269a6137f 100644
--- a/libmailutils/tests/logstr.c
+++ b/libmailutils/tests/logstr.c
@@ -629,6 +629,7 @@ struct testcase
{
char const *id;
void (*handler) (mu_stream_t);
+ int enabled;
};
struct testcase testcases[] = {
@@ -689,17 +690,37 @@ main (int argc, char **argv)
mu_stream_t log;
struct testcase *tp;
int i;
+ int ena = 0;
mu_set_program_name (argv[0]);
mu_stdstream_setup (MU_STDSTREAM_RESET_NONE);
+ if (argc > 1)
+ {
+ ena = 1;
+ for (i = 1; i < argc; i++)
+ {
+ char *p;
+ int n = strtol (argv[i], &p, 10);
+ if (! (*p == 0 && n >= 0) )
+ {
+ mu_error ("erroneous argument %s\n", argv[i]);
+ return 1;
+ }
+ testcases[n].enabled = ena;
+ }
+ }
+
log = create_log ();
for (i = 0, tp = testcases; tp->id; tp++, i++)
{
- mu_stream_printf (log, "%02d. %s\n", i, tp->id);
- tp->handler (log);
- log_reset (log);
+ if (tp->enabled == ena)
+ {
+ mu_stream_printf (log, "%02d. %s\n", i, tp->id);
+ tp->handler (log);
+ log_reset (log);
+ }
}
return 0;

Return to:

Send suggestions and report system problems to the System administrator.