From c9d8ea633e9dfa90c85a3ec247514a9cd5fb0678 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 29 Jul 1999 09:36:14 +0000 Subject: [PATCH] *** empty log message *** --- harbour/ChangeLog | 5 +++++ harbour/source/vm/hvm.c | 8 +++++--- harbour/tests/working/rtl_test.prg | 16 ++++++++++------ 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b52076c22f..e044858e8b 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,8 @@ +19990729-11:20 CET Victor Szel + ! tests/working/rtl_test.prg - Now returns errorlevel 1 + if anything fails, and 0 if OK. Now for sure. + * source/vm/hvm.c - Get rid of a few low level ITEM access. + 19990729-10:40 CET Victor Szel ! source/vm/hvm.c - #include "itemapi.h" added to fix a warning. diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index 9a498693d0..7624ac1acf 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -209,9 +209,11 @@ BYTE bErrorLevel = 0; /* application exit errorlevel */ iHB_DEBUG += ( int ) DontDiscardForceLink; /* just to avoid warnings from the C compiler */ HB_DEBUG( "main\n" ); - aStatics.type = IT_NIL; - errorBlock.type = IT_NIL; - stack.Return.type = IT_NIL; + + hb_itemClear( &aStatics ); + hb_itemClear( &errorBlock ); + hb_itemClear( &stack.Return ); + StackInit(); hb_NewDynSym( &symEval ); /* initialize dynamic symbol for evaluating codeblocks */ hb_setInitialize(); /* initialize Sets */ diff --git a/harbour/tests/working/rtl_test.prg b/harbour/tests/working/rtl_test.prg index 69cbbfd38c..8bc6f781d0 100644 --- a/harbour/tests/working/rtl_test.prg +++ b/harbour/tests/working/rtl_test.prg @@ -125,13 +125,15 @@ FUNCTION Main() /* TODO: These could be more complete */ - TEST_LINE( SubStr("ab" + Chr(0) + "def", 2, 3) , "b" + Chr(0) + "d" ) - TEST_LINE( Left("ab" + Chr(0) + "def", 5) , "ab" + Chr(0) + "de") - TEST_LINE( Right("ab" + Chr(0) + "def", 5) , "b" + Chr(0) + "def") + TEST_LINE( SubStr("ab" + Chr(0) + "def", 2, 3) , "b" + Chr(0) + "d" ) + TEST_LINE( Left("ab" + Chr(0) + "def", 5) , "ab" + Chr(0) + "de" ) + TEST_LINE( Right("ab" + Chr(0) + "def", 5) , "b" + Chr(0) + "def" ) - /* Show result, return ERRORLEVEL and exit */ + /* Show results, return ERRORLEVEL and exit */ - RETURN TEST_STAT() + TEST_STAT() + + RETURN NIL STATIC FUNCTION TEST_CALL(cBlock, bBlock, xResultExpected) LOCAL xResult := Eval(bBlock) @@ -157,7 +159,9 @@ STATIC FUNCTION TEST_STAT() "Test calls passed: " + Str(snPass) + Chr(13) + Chr(10) +; "Test calls failed: " + Str(snFail) + Chr(13) + Chr(10)) - RETURN iif(snFail > 0, 1, 0) + ErrorLevel(iif(snFail != 0, 1, 0)) + + RETURN NIL STATIC FUNCTION XToStr(xValue) LOCAL cType := ValType(xValue)