Skip to content

Commit

Permalink
Simplify tests even more
Browse files Browse the repository at this point in the history
Drop the useless `export` lines from `env` files.
  • Loading branch information
akheron committed Mar 25, 2024
1 parent 53383b9 commit e5f3fd1
Show file tree
Hide file tree
Showing 13 changed files with 1 addition and 18 deletions.
5 changes: 1 addition & 4 deletions test/bin/json_process.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,10 @@ static char *loadfile(FILE *file) {

static void read_conf(FILE *conffile) {
char *buffer, *line, *val;
conf.have_hashseed = 0;

buffer = loadfile(conffile);
for (line = strtok(buffer, "\r\n"); line; line = strtok(NULL, "\r\n")) {
if (!strncmp(line, "export ", 7))
continue;
val = strchr(line, '=');
if (!val) {
printf("invalid configuration line\n");
Expand All @@ -109,8 +108,6 @@ static void read_conf(FILE *conffile) {
if (!strcmp(line, "HASHSEED")) {
conf.have_hashseed = 1;
conf.hashseed = atoi(val);
} else {
conf.have_hashseed = 0;
}
}

Expand Down
1 change: 0 additions & 1 deletion test/suites/encoding-flags/compact-array/env
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
JSON_COMPACT=1
export JSON_COMPACT
1 change: 0 additions & 1 deletion test/suites/encoding-flags/compact-object/env
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
JSON_COMPACT=1
HASHSEED=1
export JSON_COMPACT HASHSEED
1 change: 0 additions & 1 deletion test/suites/encoding-flags/ensure-ascii/env
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
JSON_ENSURE_ASCII=1
export JSON_ENSURE_ASCII
1 change: 0 additions & 1 deletion test/suites/encoding-flags/indent-array/env
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
JSON_INDENT=4
export JSON_INDENT
1 change: 0 additions & 1 deletion test/suites/encoding-flags/indent-compact-array/env
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
JSON_INDENT=4
JSON_COMPACT=1
export JSON_INDENT JSON_COMPACT
1 change: 0 additions & 1 deletion test/suites/encoding-flags/indent-compact-object/env
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
JSON_INDENT=4
JSON_COMPACT=1
HASHSEED=1
export JSON_INDENT JSON_COMPACT HASHSEED
1 change: 0 additions & 1 deletion test/suites/encoding-flags/indent-object/env
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
JSON_INDENT=4
HASHSEED=1
export JSON_INDENT HASHSEED
1 change: 0 additions & 1 deletion test/suites/encoding-flags/object/env
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
HASHSEED=1
export HASHSEED
1 change: 0 additions & 1 deletion test/suites/encoding-flags/preserve-order/env
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
JSON_PRESERVE_ORDER=1
export JSON_PRESERVE_ORDER
1 change: 0 additions & 1 deletion test/suites/encoding-flags/real-precision/env
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
JSON_REAL_PRECISION=4
export JSON_REAL_PRECISION
1 change: 0 additions & 1 deletion test/suites/encoding-flags/sort-keys/env
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
JSON_SORT_KEYS=1
export JSON_SORT_KEYS
3 changes: 0 additions & 3 deletions test/suites/valid/run
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
# Jansson is free software; you can redistribute it and/or modify
# it under the terms of the MIT license. See LICENSE for details.

JSON_SORT_KEYS=1
export JSON_SORT_KEYS

is_test() {
test -d $test_path
}
Expand Down

0 comments on commit e5f3fd1

Please sign in to comment.