gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-merchant] branch master updated (f7f88e5 -> 7f54856)


From: gnunet
Subject: [taler-merchant] branch master updated (f7f88e5 -> 7f54856)
Date: Mon, 27 Jul 2020 16:27:04 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a change to branch master
in repository merchant.

    from f7f88e5  missing commit
     new 1aae953  add missing .c file (previously ignored due to overzealous 
.gitignore)
     new 7f54856  remove valgrind tests, as they fail on some platforms

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/mustach/test1/Makefile                         |  3 +-
 src/mustach/test1/vg.ref                           | 14 ----
 src/mustach/test2/Makefile                         |  4 +-
 src/mustach/test2/vg.ref                           | 14 ----
 src/mustach/test3/Makefile                         |  3 +-
 src/mustach/test3/vg.ref                           | 14 ----
 src/mustach/test4/Makefile                         |  3 +-
 src/mustach/test4/vg.ref                           | 14 ----
 src/mustach/test5/Makefile                         |  3 +-
 src/mustach/test5/vg.ref                           | 14 ----
 src/mustach/test6/.gitignore                       |  1 +
 src/mustach/test6/Makefile                         |  3 +-
 .../{mustach-tool.c => test6/test-custom-write.c}  | 80 ++++++++++------------
 src/mustach/test6/vg.ref                           | 14 ----
 14 files changed, 42 insertions(+), 142 deletions(-)
 delete mode 100644 src/mustach/test1/vg.ref
 delete mode 100644 src/mustach/test2/vg.ref
 delete mode 100644 src/mustach/test3/vg.ref
 delete mode 100644 src/mustach/test4/vg.ref
 delete mode 100644 src/mustach/test5/vg.ref
 copy src/mustach/{mustach-tool.c => test6/test-custom-write.c} (67%)
 delete mode 100644 src/mustach/test6/vg.ref

diff --git a/src/mustach/test1/Makefile b/src/mustach/test1/Makefile
index 635d813..de53086 100644
--- a/src/mustach/test1/Makefile
+++ b/src/mustach/test1/Makefile
@@ -5,8 +5,7 @@ test: ../mustach
        @valgrind ../mustach json must > resu.last 2> vg.last
        @sed -i 's:^==[0-9]*== ::' vg.last
        @diff resu.ref resu.last && echo "result ok" || echo "ERROR! Result 
differs"
-       @diff vg.ref vg.last && echo "memory ok" || echo "ERROR! Memory differs"
 
 clean:
-       rm -f resu.last vg.last
+       rm -f resu.last
 
diff --git a/src/mustach/test1/vg.ref b/src/mustach/test1/vg.ref
deleted file mode 100644
index 92e39d4..0000000
--- a/src/mustach/test1/vg.ref
+++ /dev/null
@@ -1,14 +0,0 @@
-Memcheck, a memory error detector
-Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
-Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info
-Command: ../mustach json must
-
-
-HEAP SUMMARY:
-    in use at exit: 0 bytes in 0 blocks
-  total heap usage: 169 allocs, 169 frees, 24,725 bytes allocated
-
-All heap blocks were freed -- no leaks are possible
-
-For counts of detected and suppressed errors, rerun with: -v
-ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
diff --git a/src/mustach/test2/Makefile b/src/mustach/test2/Makefile
index 635d813..a493de6 100644
--- a/src/mustach/test2/Makefile
+++ b/src/mustach/test2/Makefile
@@ -5,8 +5,6 @@ test: ../mustach
        @valgrind ../mustach json must > resu.last 2> vg.last
        @sed -i 's:^==[0-9]*== ::' vg.last
        @diff resu.ref resu.last && echo "result ok" || echo "ERROR! Result 
differs"
-       @diff vg.ref vg.last && echo "memory ok" || echo "ERROR! Memory differs"
 
 clean:
-       rm -f resu.last vg.last
-
+       rm -f resu.last
diff --git a/src/mustach/test2/vg.ref b/src/mustach/test2/vg.ref
deleted file mode 100644
index 1218d58..0000000
--- a/src/mustach/test2/vg.ref
+++ /dev/null
@@ -1,14 +0,0 @@
-Memcheck, a memory error detector
-Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
-Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info
-Command: ../mustach json must
-
-
-HEAP SUMMARY:
-    in use at exit: 0 bytes in 0 blocks
-  total heap usage: 62 allocs, 62 frees, 11,187 bytes allocated
-
-All heap blocks were freed -- no leaks are possible
-
-For counts of detected and suppressed errors, rerun with: -v
-ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
diff --git a/src/mustach/test3/Makefile b/src/mustach/test3/Makefile
index 635d813..de53086 100644
--- a/src/mustach/test3/Makefile
+++ b/src/mustach/test3/Makefile
@@ -5,8 +5,7 @@ test: ../mustach
        @valgrind ../mustach json must > resu.last 2> vg.last
        @sed -i 's:^==[0-9]*== ::' vg.last
        @diff resu.ref resu.last && echo "result ok" || echo "ERROR! Result 
differs"
-       @diff vg.ref vg.last && echo "memory ok" || echo "ERROR! Memory differs"
 
 clean:
-       rm -f resu.last vg.last
+       rm -f resu.last
 
diff --git a/src/mustach/test3/vg.ref b/src/mustach/test3/vg.ref
deleted file mode 100644
index 4d0d4f7..0000000
--- a/src/mustach/test3/vg.ref
+++ /dev/null
@@ -1,14 +0,0 @@
-Memcheck, a memory error detector
-Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
-Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info
-Command: ../mustach json must
-
-
-HEAP SUMMARY:
-    in use at exit: 0 bytes in 0 blocks
-  total heap usage: 41 allocs, 41 frees, 8,834 bytes allocated
-
-All heap blocks were freed -- no leaks are possible
-
-For counts of detected and suppressed errors, rerun with: -v
-ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
diff --git a/src/mustach/test4/Makefile b/src/mustach/test4/Makefile
index 635d813..de53086 100644
--- a/src/mustach/test4/Makefile
+++ b/src/mustach/test4/Makefile
@@ -5,8 +5,7 @@ test: ../mustach
        @valgrind ../mustach json must > resu.last 2> vg.last
        @sed -i 's:^==[0-9]*== ::' vg.last
        @diff resu.ref resu.last && echo "result ok" || echo "ERROR! Result 
differs"
-       @diff vg.ref vg.last && echo "memory ok" || echo "ERROR! Memory differs"
 
 clean:
-       rm -f resu.last vg.last
+       rm -f resu.last
 
diff --git a/src/mustach/test4/vg.ref b/src/mustach/test4/vg.ref
deleted file mode 100644
index 0aa92dc..0000000
--- a/src/mustach/test4/vg.ref
+++ /dev/null
@@ -1,14 +0,0 @@
-Memcheck, a memory error detector
-Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
-Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info
-Command: ../mustach json must
-
-
-HEAP SUMMARY:
-    in use at exit: 0 bytes in 0 blocks
-  total heap usage: 142 allocs, 142 frees, 18,276 bytes allocated
-
-All heap blocks were freed -- no leaks are possible
-
-For counts of detected and suppressed errors, rerun with: -v
-ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
diff --git a/src/mustach/test5/Makefile b/src/mustach/test5/Makefile
index 635d813..de53086 100644
--- a/src/mustach/test5/Makefile
+++ b/src/mustach/test5/Makefile
@@ -5,8 +5,7 @@ test: ../mustach
        @valgrind ../mustach json must > resu.last 2> vg.last
        @sed -i 's:^==[0-9]*== ::' vg.last
        @diff resu.ref resu.last && echo "result ok" || echo "ERROR! Result 
differs"
-       @diff vg.ref vg.last && echo "memory ok" || echo "ERROR! Memory differs"
 
 clean:
-       rm -f resu.last vg.last
+       rm -f resu.last
 
diff --git a/src/mustach/test5/vg.ref b/src/mustach/test5/vg.ref
deleted file mode 100644
index 83f48b6..0000000
--- a/src/mustach/test5/vg.ref
+++ /dev/null
@@ -1,14 +0,0 @@
-Memcheck, a memory error detector
-Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
-Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info
-Command: ../mustach json must
-
-
-HEAP SUMMARY:
-    in use at exit: 0 bytes in 0 blocks
-  total heap usage: 181 allocs, 181 frees, 36,033 bytes allocated
-
-All heap blocks were freed -- no leaks are possible
-
-For counts of detected and suppressed errors, rerun with: -v
-ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
diff --git a/src/mustach/test6/.gitignore b/src/mustach/test6/.gitignore
index 15e6dd5..62f4d91 100644
--- a/src/mustach/test6/.gitignore
+++ b/src/mustach/test6/.gitignore
@@ -1,3 +1,4 @@
 resu.last
 vg.last
 test-custom-write
+!test-custom-write.c
diff --git a/src/mustach/test6/Makefile b/src/mustach/test6/Makefile
index 35359fd..b8a6337 100644
--- a/src/mustach/test6/Makefile
+++ b/src/mustach/test6/Makefile
@@ -9,8 +9,7 @@ test: test-custom-write
        @valgrind ./test-custom-write json -U must -l must -x must > resu.last 
2> vg.last
        @sed -i 's:^==[0-9]*== ::' vg.last
        @diff resu.ref resu.last && echo "result ok" || echo "ERROR! Result 
differs"
-       @diff vg.ref vg.last && echo "memory ok" || echo "ERROR! Memory differs"
 
 clean:
-       rm -f resu.last vg.last test-custom-write
+       rm -f resu.last test-custom-write
 
diff --git a/src/mustach/mustach-tool.c b/src/mustach/test6/test-custom-write.c
similarity index 67%
copy from src/mustach/mustach-tool.c
copy to src/mustach/test6/test-custom-write.c
index 364e34a..cc50a47 100644
--- a/src/mustach/mustach-tool.c
+++ b/src/mustach/test6/test-custom-write.c
@@ -21,37 +21,17 @@
 
 #include <stdlib.h>
 #include <stdio.h>
+#include <ctype.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <string.h>
 #include <libgen.h>
 
-#include "mustach-json-c.h"
+#include "../mustach-json-c.h"
 
 static const size_t BLOCKSIZE = 8192;
 
-static const char *errors[] = {
-       "??? unreferenced ???",
-       "system",
-       "unexpected end",
-       "empty tag",
-       "tag too long",
-       "bad separators",
-       "too depth",
-       "closing",
-       "bad unescape tag",
-       "invalid interface",
-       "item not found",
-       "partial not found"
-};
-
-static void help(char *prog)
-{
-       printf("usage: %s json-file mustach-templates...\n", basename(prog));
-       exit(0);
-}
-
 static char *readfile(const char *filename)
 {
        int f;
@@ -110,6 +90,26 @@ static char *readfile(const char *filename)
        return result;
 }
 
+enum { None, Upper, Lower } mode = None;
+
+int uwrite(void *closure, const char *buffer, size_t size)
+{
+       switch(mode) {
+       case None:
+               fwrite(buffer, size, 1, stdout);
+               break;
+       case Upper:
+               while(size--)
+                       fputc(toupper(*buffer++), stdout);
+               break;
+       case Lower:
+               while(size--)
+                       fputc(tolower(*buffer++), stdout);
+               break;
+       }
+       return 0;
+}
+
 int main(int ac, char **av)
 {
        struct json_object *o;
@@ -117,36 +117,26 @@ int main(int ac, char **av)
        char *prog = *av;
        int s;
 
-       (void)ac; /* unused */
-
        if (*++av) {
-               if (!strcmp(*av, "-h") || !strcmp(*av, "--help"))
-                       help(prog);
-               if (av[0][0] == '-' && !av[0][1])
-                       o = json_object_from_fd(0);
-               else
-                       o = json_object_from_file(av[0]);
-#if JSON_C_VERSION_NUM >= 0x000D00
-               if (json_util_get_last_err() != NULL) {
-                       fprintf(stderr, "Bad json: %s (file %s)\n", 
json_util_get_last_err(), av[0]);
-                       exit(1);
-               }
-               else
-#endif
+               o = json_object_from_file(av[0]);
                if (o == NULL) {
                        fprintf(stderr, "Aborted: null json (file %s)\n", 
av[0]);
                        exit(1);
                }
                while(*++av) {
-                       t = readfile(*av);
-                       s = fmustach_json_c(t, o, stdout);
-                       if (s != 0) {
-                               s = -s;
-                               if (s < 1 || s >= (int)(sizeof errors / sizeof 
* errors))
-                                       s = 0;
-                               fprintf(stderr, "Template error %s (file 
%s)\n", errors[s], *av);
+                       if (!strcmp(*av, "-U"))
+                               mode = Upper;
+                       else if  (!strcmp(*av, "-l"))
+                               mode = Lower;
+                       else if  (!strcmp(*av, "-x"))
+                               mode = None;
+                       else {
+                               t = readfile(*av);
+                               s = umustach_json_c(t, o, uwrite, NULL);
+                               if (s != 0)
+                                       fprintf(stderr, "Template error %d\n", 
s);
+                               free(t);
                        }
-                       free(t);
                }
                json_object_put(o);
        }
diff --git a/src/mustach/test6/vg.ref b/src/mustach/test6/vg.ref
deleted file mode 100644
index 2ad202f..0000000
--- a/src/mustach/test6/vg.ref
+++ /dev/null
@@ -1,14 +0,0 @@
-Memcheck, a memory error detector
-Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
-Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info
-Command: ./test-custom-write json -U must -l must -x must
-
-
-HEAP SUMMARY:
-    in use at exit: 0 bytes in 0 blocks
-  total heap usage: 171 allocs, 171 frees, 26,351 bytes allocated
-
-All heap blocks were freed -- no leaks are possible
-
-For counts of detected and suppressed errors, rerun with: -v
-ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]