Files
harbour-core/harbour/tests/clasname.prg
Ron Pinkas 15baa9ad5b 2001-01-25 12:00 UTC-0800 Ron Pinkas <ron@profit-master.com>
* source/vm/hvm.c
     * Modified error messages in hb_vmSend() to report class name of native types (including NIL) along with missing method name.
     + Added default implementation of ClassName() method of native types.

     /* J.F. Can you please check why hb_objGetClsName() was not working correctly when called from hb_vmSend() ?
        It was returning empty string ("") on my BCC55 latest build. */

   * tests/clasname.prg
     + Added Arrays to types checked.
2001-01-25 20:10:03 +00:00

58 lines
1.3 KiB
Plaintext

//NOTEST
//
// $Id$
//
// The following code tests the application of the className message
// against the "fundemental" types of Clipper.
// These tests were written by Dave Pearson <davep@hagbard.demon.co.uk>
// and are placed into the public domain.
Function Main()
// First, try all the types. This checks that the VM can cope.
aeval( { NIL, {}, "", 0, ctod( "" ), .F., {|| NIL }, ErrorNew() },;
{|x| qout( x:className ) } )
// Now try against values "in the code". This checks that the
// compiler can cope.
?
qout( NIL:className )
qout( {}:className )
qout( "":className )
qout( 0:className )
qout( ctod( "" ):className )
qout( .f.:className )
qout( {|| nil }:className )
qout( ErrorNew():className )
// For fun, do it again while ensuring the parser doesn't care about
// whitespace.
?
qout( NIL : className )
qout( {} : className )
qout( "" : className )
qout( 0 : className )
qout( ctod( "" ) : className )
qout( .f. : className )
qout( {|| nil } : className )
qout( ErrorNew() : className )
// Now for some sillier ones. If the above work the following should
// work too.
?
qout( ( NIL:className ):className )
?
qout( ( ( NIL:className ):className ):className )
Return( NIL )