summaryrefslogtreecommitdiffhomepage
path: root/mixlib/testsuite
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2006-08-05 23:47:57 +0000
committerJose Antonio Ortega Ruiz <jao@gnu.org>2006-08-05 23:47:57 +0000
commit63c94b1e74f3272dbf0b2bc1dae8913d564c72f5 (patch)
treec342b533c5e1bef9cd752f8f1f87e29b4675ee50 /mixlib/testsuite
parentf25c34aee4fbd3fef2d5bc29ec09ebad88c1b118 (diff)
downloadmdk-63c94b1e74f3272dbf0b2bc1dae8913d564c72f5.tar.gz
mdk-63c94b1e74f3272dbf0b2bc1dae8913d564c72f5.tar.bz2
All tests passing again (mix parser re-entrant)
git-archimport-id: mdk@sv.gnu.org/mdk--devel--1--patch-17
Diffstat (limited to 'mixlib/testsuite')
-rw-r--r--mixlib/testsuite/Makefile.am2
-rw-r--r--mixlib/testsuite/mix_parser_t.c31
2 files changed, 7 insertions, 26 deletions
diff --git a/mixlib/testsuite/Makefile.am b/mixlib/testsuite/Makefile.am
index e297988..349a320 100644
--- a/mixlib/testsuite/Makefile.am
+++ b/mixlib/testsuite/Makefile.am
@@ -17,7 +17,7 @@ LDADD = $(top_builddir)/mixlib/libmix.a
check_PROGRAMS = mixtypest mixinstest mixvminstest mixparsertest mixdevtest mixevaltest
TESTS = $(check_PROGRAMS)
-MIXAL_FILES= "\"primes\",\"isamixinstruction\",\"tests/bt\",\"tests/cbp\",\"tests/ldan\",\"tests/stress0\",\"hello\",\"echo\","
+MIXAL_FILES= "\"tests/bt\",\"tests/cbp\",\"tests/stress0\",\"tests/stress1\",\"tests/stress2\",\"tests/stress4\",\"tests/stress5\",\"tests/stress6\",\"tests/ldan\",\"tests/lockonw\",\"tests/negwrite\",\"hello\",\"echo\",\"primes\",\"isains\""
AM_CFLAGS = -DMIX_TEST_MIXAL_FILES=$(MIXAL_FILES) -DMIX_TEST_SAMPLES_DIR="\"$(top_srcdir)/samples\""
diff --git a/mixlib/testsuite/mix_parser_t.c b/mixlib/testsuite/mix_parser_t.c
index 4008309..80f2cd1 100644
--- a/mixlib/testsuite/mix_parser_t.c
+++ b/mixlib/testsuite/mix_parser_t.c
@@ -20,9 +20,9 @@
*/
+#include <mix_parser.h>
#include <stdlib.h>
-#include <mix_parser.h>
/* Define VERBOSE_TEST if you want to get prints of the test */
/* #define VERBOSE_TEST */
@@ -36,13 +36,12 @@ static const size_t FILE_NO_ = sizeof(FILES_)/sizeof(FILES_[0]);
static void
test_code_ (const gchar *name)
{
-
mix_code_file_t *code;
mix_parser_err_t err;
+
gchar *real_name = g_strdup_printf ("%s/%s", MIX_TEST_SAMPLES_DIR, name);
- g_print (real_name);
- g_print ("\n");
+ gchar *code_name = g_path_get_basename (name);
mix_parser_t *parser = mix_parser_new (real_name);
@@ -58,32 +57,14 @@ test_code_ (const gchar *name)
g_assert (err == MIX_PERR_OK);
- err = mix_parser_write_code (parser, real_name, FALSE);
- code = mix_code_file_new_read (real_name);
+ err = mix_parser_write_code (parser, code_name, FALSE);
+ code = mix_code_file_new_read (code_name);
g_assert (code);
-#ifdef VERBOSE_TEST
- g_message ("%s: Version: %d.%d", name, mix_code_file_major_version (code),
- mix_code_file_minor_version (code));
-
- mix_short_print (mix_code_file_get_start_addr (code), "Start address: ");
- g_print ("\n");
-
- mix_ins_desc_t ins;
- while (mix_code_file_get_ins (code, &ins))
- {
- mix_ins_t i;
- mix_word_to_ins_uncheck (ins.ins, i);
- mix_short_print (ins.address, "addr: ");
- g_print (" : ");
- mix_ins_print (&i);
- g_print ("\n");
- }
-#endif
-
mix_parser_delete (parser);
mix_code_file_delete (code);
g_free (real_name);
+ g_free (code_name);
}
int