diff options
author | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2015-01-19 15:04:21 -0500 |
---|---|---|
committer | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2015-01-19 15:04:21 -0500 |
commit | 1edb5cb33d55a4f866c799d41680088b927f7846 (patch) | |
tree | 5f74270aa4eae77f6057c1d038ce8da88f5f38da /extension/testext.c | |
parent | 2d3f4ffebcb451da84ceb8a4be58bbb23946ee6e (diff) | |
parent | f77c13a546af58cb8cdb593f49bbfa844b10dd7e (diff) | |
download | egawk-1edb5cb33d55a4f866c799d41680088b927f7846.tar.gz egawk-1edb5cb33d55a4f866c799d41680088b927f7846.tar.bz2 egawk-1edb5cb33d55a4f866c799d41680088b927f7846.zip |
Merge branch 'master' into select
Diffstat (limited to 'extension/testext.c')
-rw-r--r-- | extension/testext.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/extension/testext.c b/extension/testext.c index 7c61bb0d..8a906c67 100644 --- a/extension/testext.c +++ b/extension/testext.c @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 2012, 2013, 2014 + * Copyright (C) 2012, 2013, 2014, 2015 * the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the @@ -303,11 +303,11 @@ var_test(int nargs, awk_value_t *result) goto out; } - /* look up PROCINFO - should fail */ + /* look up PROCINFO - should succeed fail */ if (sym_lookup("PROCINFO", AWK_ARRAY, & value)) - printf("var_test: sym_lookup of PROCINFO failed - got a value!\n"); + printf("var_test: sym_lookup of PROCINFO passed - got a value!\n"); else - printf("var_test: sym_lookup of PROCINFO passed - did not get a value\n"); + printf("var_test: sym_lookup of PROCINFO failed - did not get a value\n"); /* look up a reserved variable - should pass */ if (sym_lookup("ARGC", AWK_NUMBER, & value)) @@ -399,8 +399,11 @@ test_deferred(int nargs, awk_value_t *result) printf("test_deferred: nargs not right (%d should be 0)\n", nargs); goto out; } - arr.val_type = AWK_ARRAY; - arr.array_cookie = create_array(); + + if (! sym_lookup("PROCINFO", AWK_ARRAY, & arr)) { + printf("test_deferred: %d: sym_lookup failed\n", __LINE__); + goto out; + } for (i = 0; i < sizeof(seed)/sizeof(seed[0]); i++) { make_const_string(seed[i].name, strlen(seed[i].name), & index); @@ -411,11 +414,6 @@ test_deferred(int nargs, awk_value_t *result) } } - if (! sym_update("PROCINFO", & arr)) { - printf("test_deferred: %d: sym_update failed\n", __LINE__); - goto out; - } - /* test that it still contains the values we loaded */ for (i = 0; i < sizeof(seed)/sizeof(seed[0]); i++) { make_const_string(seed[i].name, strlen(seed[i].name), & index); |