aboutsummaryrefslogtreecommitdiffstats
path: root/asn1c
diff options
context:
space:
mode:
authorLev Walkin <vlm@lionet.info>2014-09-17 01:19:31 -0700
committerLev Walkin <vlm@lionet.info>2014-09-17 01:19:31 -0700
commit15d38f45dff01d09e8f524b9f4fb139153eed362 (patch)
tree4b81e56844a53a3d59e36719a59586093efe5336 /asn1c
parent58ecc7b4e33738295fc59baa4e1b4f2ca23cab5a (diff)
limit debug output log
Diffstat (limited to 'asn1c')
-rw-r--r--asn1c/tests/check-src/check-119.-fwide-types.-gen-PER.c10
-rw-r--r--asn1c/tests/check-src/check-119.-gen-PER.c10
-rw-r--r--asn1c/tests/check-src/check-126.-gen-PER.c6
-rw-r--r--asn1c/tests/check-src/check-70.-fwide-types.c4
-rw-r--r--asn1c/tests/check-src/check-70.c4
5 files changed, 24 insertions, 10 deletions
diff --git a/asn1c/tests/check-src/check-119.-fwide-types.-gen-PER.c b/asn1c/tests/check-src/check-119.-fwide-types.-gen-PER.c
index 8e5c2426..ebfb4f41 100644
--- a/asn1c/tests/check-src/check-119.-fwide-types.-gen-PER.c
+++ b/asn1c/tests/check-src/check-119.-fwide-types.-gen-PER.c
@@ -45,6 +45,7 @@ _buf_writer(const void *buffer, size_t size, void *app_key) {
memcpy(buf + buf_offset, buffer, size);
b = buf + buf_offset;
bend = b + size;
+#ifdef EMIT_ASN_DEBUG
fprintf(stderr, "=> [");
for(; b < bend; b++) {
if(*b >= 32 && *b < 127 && *b != '%')
@@ -53,6 +54,7 @@ _buf_writer(const void *buffer, size_t size, void *app_key) {
fprintf(stderr, "%%%02x", *b);
}
fprintf(stderr, "]:%zd\n", size);
+#endif
buf_offset += size;
return 0;
}
@@ -131,16 +133,18 @@ load_object_from(const char *fname, enum expectation expectation, unsigned char
st = 0;
do {
- fprintf(stderr, "Decoding bytes %d..%d (left %d)\n",
+ ASN_DEBUG("Decoding bytes %d..%d (left %d)",
fbuf_offset,
fbuf_chunk < fbuf_left
? fbuf_chunk : fbuf_left,
fbuf_left);
+#ifdef EMIT_ASN_DEBUG
if(st) {
fprintf(stderr, "=== currently ===\n");
asn_fprint(stderr, &asn_DEF_PDU, st);
fprintf(stderr, "=== end ===\n");
}
+#endif
switch(how) {
case AS_XER:
rval = xer_decode(0, &asn_DEF_PDU, (void **)&st,
@@ -157,9 +161,9 @@ load_object_from(const char *fname, enum expectation expectation, unsigned char
rval.consumed = 0; /* Not restartable */
ASN_STRUCT_FREE(asn_DEF_PDU, st);
st = 0;
- fprintf(stderr, "-> PER wants more\n");
+ ASN_DEBUG("-> PER wants more");
} else {
- fprintf(stderr, "-> PER ret %d/%ld\n",
+ ASN_DEBUG("-> PER ret %d/%ld",
rval.code, rval.consumed);
/* uper_decode() returns _bits_ */
rval.consumed += 7;
diff --git a/asn1c/tests/check-src/check-119.-gen-PER.c b/asn1c/tests/check-src/check-119.-gen-PER.c
index a1f2f805..bb52eac3 100644
--- a/asn1c/tests/check-src/check-119.-gen-PER.c
+++ b/asn1c/tests/check-src/check-119.-gen-PER.c
@@ -45,6 +45,7 @@ _buf_writer(const void *buffer, size_t size, void *app_key) {
memcpy(buf + buf_offset, buffer, size);
b = buf + buf_offset;
bend = b + size;
+#ifdef EMIT_ASN_DEBUG
fprintf(stderr, "=> [");
for(; b < bend; b++) {
if(*b >= 32 && *b < 127 && *b != '%')
@@ -53,6 +54,7 @@ _buf_writer(const void *buffer, size_t size, void *app_key) {
fprintf(stderr, "%%%02x", *b);
}
fprintf(stderr, "]:%zd\n", size);
+#endif
buf_offset += size;
return 0;
}
@@ -131,16 +133,18 @@ load_object_from(const char *fname, enum expectation expectation, unsigned char
st = 0;
do {
- fprintf(stderr, "Decoding bytes %d..%d (left %d)\n",
+ ASN_DEBUG("Decoding bytes %d..%d (left %d)",
fbuf_offset,
fbuf_chunk < fbuf_left
? fbuf_chunk : fbuf_left,
fbuf_left);
+#ifdef EMIT_ASN_DEBUG
if(st) {
fprintf(stderr, "=== currently ===\n");
asn_fprint(stderr, &asn_DEF_PDU, st);
fprintf(stderr, "=== end ===\n");
}
+#endif
switch(how) {
case AS_XER:
rval = xer_decode(0, &asn_DEF_PDU, (void **)&st,
@@ -157,9 +161,9 @@ load_object_from(const char *fname, enum expectation expectation, unsigned char
rval.consumed = 0; /* Not restartable */
ASN_STRUCT_FREE(asn_DEF_PDU, st);
st = 0;
- fprintf(stderr, "-> PER wants more\n");
+ ASN_DEBUG("-> PER wants more");
} else {
- fprintf(stderr, "-> PER ret %d/%zd\n",
+ ASN_DEBUG("-> PER ret %d/%zd",
rval.code, rval.consumed);
/* uper_decode() returns _bits_ */
rval.consumed += 7;
diff --git a/asn1c/tests/check-src/check-126.-gen-PER.c b/asn1c/tests/check-src/check-126.-gen-PER.c
index 595a1dbf..ca3b34bc 100644
--- a/asn1c/tests/check-src/check-126.-gen-PER.c
+++ b/asn1c/tests/check-src/check-126.-gen-PER.c
@@ -35,6 +35,7 @@ _buf_writer(const void *buffer, size_t size, void *app_key) {
memcpy(buf + buf_offset, buffer, size);
b = buf + buf_offset;
bend = b + size;
+#ifdef EMIT_ASN_DEBUG
fprintf(stderr, "=> [");
for(; b < bend; b++) {
if(*b >= 32 && *b < 127 && *b != '%')
@@ -43,6 +44,7 @@ _buf_writer(const void *buffer, size_t size, void *app_key) {
fprintf(stderr, "%%%02x", *b);
}
fprintf(stderr, "]:%zd\n", size);
+#endif
buf_offset += size;
return 0;
}
@@ -152,10 +154,10 @@ load_object_from(const char *fname, unsigned char *fbuf, size_t size, enum encty
rval.consumed = 0; /* Not restartable */
ASN_STRUCT_FREE(asn_DEF_PDU, st);
st = 0;
- fprintf(stderr, "-> PER wants more\n");
+ ASN_DEBUG("-> PER wants more");
}
} else {
- fprintf(stderr, "-> PER ret %d/%zd mf=%d\n",
+ ASN_DEBUG("-> PER ret %d/%zd mf=%d",
rval.code, rval.consumed, mustfail);
/* uper_decode() returns _bits_ */
rval.consumed += 7;
diff --git a/asn1c/tests/check-src/check-70.-fwide-types.c b/asn1c/tests/check-src/check-70.-fwide-types.c
index 3a42e99a..bd969786 100644
--- a/asn1c/tests/check-src/check-70.-fwide-types.c
+++ b/asn1c/tests/check-src/check-70.-fwide-types.c
@@ -125,16 +125,18 @@ load_object_from(enum expectation expectation, unsigned char *fbuf, size_t size,
st = 0;
do {
- fprintf(stderr, "Decoding bytes %d..%d (left %d)\n",
+ ASN_DEBUG("Decoding bytes %d..%d (left %d)",
fbuf_offset,
fbuf_chunk < fbuf_left
? fbuf_chunk : fbuf_left,
fbuf_left);
+#ifdef EMIT_ASN_DEBUG
if(st) {
fprintf(stderr, "=== currently ===\n");
asn_fprint(stderr, &asn_DEF_PDU, st);
fprintf(stderr, "=== end ===\n");
}
+#endif
rval = zer_decode(0, &asn_DEF_PDU, (void **)&st,
fbuf + fbuf_offset,
fbuf_chunk < fbuf_left
diff --git a/asn1c/tests/check-src/check-70.c b/asn1c/tests/check-src/check-70.c
index d09f095a..d844f08b 100644
--- a/asn1c/tests/check-src/check-70.c
+++ b/asn1c/tests/check-src/check-70.c
@@ -114,16 +114,18 @@ load_object_from(enum expectation expectation, unsigned char *fbuf, size_t size,
st = 0;
do {
- fprintf(stderr, "Decoding bytes %d..%d (left %d)\n",
+ ASN_DEBUG("Decoding bytes %d..%d (left %d)",
fbuf_offset,
fbuf_chunk < fbuf_left
? fbuf_chunk : fbuf_left,
fbuf_left);
+#ifdef EMIT_ASN_DEBUG
if(st) {
fprintf(stderr, "=== currently ===\n");
asn_fprint(stderr, &asn_DEF_PDU, st);
fprintf(stderr, "=== end ===\n");
}
+#endif
rval = zer_decode(0, &asn_DEF_PDU, (void **)&st,
fbuf + fbuf_offset,
fbuf_chunk < fbuf_left