dlugolecki.net.pl
Dziennik
Polecane
Software
projects
/
gedcom-parse.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't let bogus.test depend on a file that can change.
[gedcom-parse.git]
/
t
/
src
/
update.c
diff --git
a/t/src/update.c
b/t/src/update.c
index cc983768e6fef906efe39661fac83cd8d42b1642..1282b49d4e9760aeb61ecf00a320486b708fdca2 100644
(file)
--- a/
t/src/update.c
+++ b/
t/src/update.c
@@
-23,6
+23,7
@@
#include "gedcom.h"
#include "output.h"
#include "gedcom.h"
#include "output.h"
+#include "portability.h"
#include <locale.h>
#include <stdio.h>
#include <locale.h>
#include <stdio.h>
@@
-44,12
+45,14
@@
void show_help ()
printf("Options:\n");
printf(" -h Show this help text\n");
printf(" -q No output to standard output\n");
printf("Options:\n");
printf(" -h Show this help text\n");
printf(" -q No output to standard output\n");
+ printf(" -o <outfile> File to generate output to (def. testgedcom.out)\n");
}
int test_xref_functions()
{
struct xref_value* xr;
int result;
}
int test_xref_functions()
{
struct xref_value* xr;
int result;
+ long int tmp;
xr = gedcom_get_by_xref("@NOTHING_THERE@");
if (xr != NULL)
xr = gedcom_get_by_xref("@NOTHING_THERE@");
if (xr != NULL)
@@
-80,7
+83,8
@@
int test_xref_functions()
return 16;
}
return 16;
}
- if ((int)xr->object != 1) {
+ tmp = void_ptr_to_int(xr->object);
+ if (tmp != 1) {
output(1, "Not the correct cross-reference object\n");
return 17;
}
output(1, "Not the correct cross-reference object\n");
return 17;
}
@@
-135,6
+139,7
@@
int test_xref_functions()
int main(int argc, char* argv[])
{
int result;
int main(int argc, char* argv[])
{
int result;
+ char* outfilename = NULL;
if (argc > 1) {
int i;
if (argc > 1) {
int i;
@@
-146,6
+151,17
@@
int main(int argc, char* argv[])
else if (!strncmp(argv[i], "-q", 3)) {
output_set_quiet(1);
}
else if (!strncmp(argv[i], "-q", 3)) {
output_set_quiet(1);
}
+ else if (!strncmp(argv[i], "-o", 3)) {
+ i++;
+ if (i < argc) {
+ outfilename = argv[i];
+ }
+ else {
+ printf ("Missing output file name\n");
+ show_help();
+ exit(1);
+ }
+ }
else {
printf ("Unrecognized option: %s\n", argv[i]);
show_help();
else {
printf ("Unrecognized option: %s\n", argv[i]);
show_help();
@@
-158,10
+174,11
@@
int main(int argc, char* argv[])
setlocale(LC_ALL, "");
gedcom_set_message_handler(gedcom_message_handler);
setlocale(LC_ALL, "");
gedcom_set_message_handler(gedcom_message_handler);
- output_open();
+ output_open(
outfilename
);
result = gedcom_new_model();
result = gedcom_new_model();
- result |= test_xref_functions();
+ if (result == 0)
+ result |= test_xref_functions();
if (result == 0) {
output(1, "Test succeeded\n");
}
if (result == 0) {
output(1, "Test succeeded\n");
}