]> sigrok.org Git - libsigrokdecode.git/blobdiff - tests/runtc.c
uart: Add trekstor_ebr30_a test case.
[libsigrokdecode.git] / tests / runtc.c
index 33cc8f260c77948289f7abe6239455ee4539e658..b891b3b026f66837088270e5e4698eb01b465c09 100644 (file)
@@ -36,7 +36,6 @@
 #endif
 #include "../config.h"
 
-
 int debug = FALSE;
 int statistics = FALSE;
 
@@ -307,39 +306,6 @@ static void sr_cb(const struct sr_dev_inst *sdi,
 
 }
 
-int get_stats(int stats[2])
-{
-       FILE *f;
-       size_t len;
-       int tmp;
-       char *buf;
-
-       stats[0] = stats[1] = -1;
-       if (!(f = fopen("/proc/self/status", "r")))
-               return FALSE;
-       len = 128;
-       buf = malloc(len);
-       while (getline(&buf, &len, f) != -1) {
-               if (strcasestr(buf, "vmpeak:")) {
-                       stats[0] = strtoul(buf + 10, NULL, 10);
-               } else if (strcasestr(buf, "vmsize:")) {
-                       tmp = strtoul(buf + 10, NULL, 10);
-                       if (tmp > stats[0])
-                               stats[0] = tmp;
-               } else if (strcasestr(buf, "vmhwm:")) {
-                       stats[1] = strtoul(buf + 6, NULL, 10);
-               } else if (strcasestr(buf, "vmrss:")) {
-                       tmp = strtoul(buf + 10, NULL, 10);
-                       if (tmp > stats[0])
-                               stats[0] = tmp;
-               }
-       }
-       free(buf);
-       fclose(f);
-
-       return TRUE;
-}
-
 static int run_testcase(char *infile, GSList *pdlist, struct output *op)
 {
        struct srd_session *sess;
@@ -439,7 +405,7 @@ static int run_testcase(char *infile, GSList *pdlist, struct output *op)
                        /* Only annotations and binary can have a class. */
                        return FALSE;
                idx = 0;
-               while(l) {
+               while (l) {
                        decoder_class = l->data;
                        if (!strcmp(decoder_class[0], op->class)) {
                                op->class_idx = idx;
@@ -489,7 +455,7 @@ int main(int argc, char **argv)
        pdlist = NULL;
        opt_infile = NULL;
        pd = NULL;
-       while((c = getopt(argc, argv, "dP:p:o:i:O:f:S")) != -1) {
+       while ((c = getopt(argc, argv, "dP:p:o:i:O:f:S")) != -1) {
                switch(c) {
                case 'd':
                        debug = TRUE;
@@ -592,5 +558,3 @@ int main(int argc, char **argv)
 
        return ret;
 }
-
-