head     1.9;
branch   ;
access   ;
symbols  ;
locks    ; strict;
comment  @// @;


1.9
date     92.06.16.14.25.15;  author thoth;  state Exp;
branches ;
next     1.8;

1.8
date     92.06.10.11.40.12;  author thoth;  state Exp;
branches ;
next     1.7;

1.7
date     92.05.22.07.14.12;  author fischer;  state Exp;
branches ;
next     1.6;

1.6
date     92.05.21.20.24.27;  author thoth;  state Exp;
branches ;
next     1.5;

1.5
date     92.05.21.12.04.16;  author thoth;  state Exp;
branches ;
next     1.4;

1.4
date     92.05.21.08.07.48;  author fischer;  state Exp;
branches ;
next     1.3;

1.3
date     92.05.20.06.31.54;  author fischer;  state Exp;
branches ;
next     1.2;

1.2
date     92.05.16.13.57.48;  author thoth;  state Exp;
branches ;
next     1.1;

1.1
date     92.05.16.13.47.13;  author thoth;  state Exp;
branches ;
next     ;


desc
@this is a test program for coordinate.  It exercises
the conversion error exception.
@


1.9
log
@removed case that was checked in test001
@
text
@static char rcsid[] = "$Id: test002.cc,v 1.8 92/06/10 11:40:12 thoth Exp Locker: thoth $";

//
// $Log:	test002.cc,v $
// Revision 1.8  92/06/10  11:40:12  thoth
// updated to reflect new conventions
// 
// Revision 1.7  92/05/22  07:14:12  fischer
// Got overloading to work by simple expedient of using math.ufl.edu
// version of g++:  gcc-2.0.  
// Changed Coord arithmetic operators to assume result_type()
// is taking care of uninitialized Coord types (tag==None) via throw.
// Added default: to switches so Rob can rest easy about new 
// NumericTypes.  Added *,/,+,%,-.  Lots more to go. Since we now
// have NumericType abstraction,  changed stuff like this->tag to
// this->type():  because these are inline functions, there should be little 
// overhead, but we need to check with some timing tests.
// Changed Coord.val name to Coord.value name since I can never remember
// these damn c-style abbreviations.   .
// 
// Revision 1.6  92/05/21  20:24:27  thoth
// switched to // comments for rcs log
// 
// Revision 1.5  92/05/21  12:04:16  thoth
// improved comment, remove emacs local variables.
// 
// Revision 1.4  92/05/21  08:07:48  fischer
// Started rework of CoordType to IA::NumericType
// so all classes can access.
// 
// Revision 1.3  92/05/20  06:31:54  fischer
// Used Coord.output(cout) routine of Rob's
// to get around broken << operator.
// 
// Revision 1.2  92/05/16  13:57:48  thoth
// added log goo
// 
// Revision 1.1  92/05/16  13:47:13  thoth
// Initial revision
//

#include	<iostream.h>
#include	"Coord.h"

int main(int argc, char**argv)
{
    Coord	c1(1), c2(3.4), c3, c4;


    cout << "c1(1): " << c1 << '\n';

    cout << "c2(3.4): " << c2 << '\n';

    // should fail here -- we can't convert c2
    // into an int (it contains a float)
    cout << "c4: expect TypeMismatch:";
    c4 = int(c2);
    cout << c4 << '\n';



//    cout << c1.to_float() << '\n';
//    cout << c1.to_int() << '\n';
//    cout << c2.to_float() << '\n';
//    cout << "conversion error: ";
//    cout << c2.to_int() << '\n';
}
@


1.8
log
@updated to reflect new conventions
@
text
@d1 1
a1 1
static char rcsid[] = "$Id: test002.cc,v 1.7 92/05/22 07:14:12 fischer Exp Locker: thoth $";
d5 3
a52 2

    cout << "c3: " << c3 << '\n';
@


1.7
log
@Got overloading to work by simple expedient of using math.ufl.edu
version of g++:  gcc-2.0.  
Changed Coord arithmetic operators to assume result_type()
is taking care of uninitialized Coord types (tag==None) via throw.
Added default: to switches so Rob can rest easy about new 
NumericTypes.  Added *,/,+,%,-.  Lots more to go. Since we now
have NumericType abstraction,  changed stuff like this->tag to
this->type():  because these are inline functions, there should be little 
overhead, but we need to check with some timing tests.
Changed Coord.val name to Coord.value name since I can never remember
these damn c-style abbreviations.   .
@
text
@d1 1
a1 1
static char rcsid[] = "$Id: test2.cc,v 1.6 92/05/21 20:24:27 thoth Exp Locker: fischer $";
d4 14
a17 1
// $Log:	test2.cc,v $
d40 1
a40 1
#include	<Coord.h>
d47 1
a47 3
    cout << "c1(1): ";
    c1.output(cout);
    cout << '\n';
d49 1
a49 3
    cout << "c2(3.4): ";
    c2.output(cout);
    cout << '\n';
d51 1
a51 3
    cout << "c3: ";
    c3.output(cout);
    cout << '\n';
d57 1
a57 2
    c4.output(cout);
    cout << '\n';
@


1.6
log
@switched to // comments for rcs log
@
text
@d1 1
a1 1
static char rcsid[] = "$Id: test2.cc,v 1.5 92/05/21 12:04:16 thoth Exp Locker: thoth $";
d5 3
a31 2
    float d;
    int i;
a32 2
    i = 22;
    d = float(i);
a33 2
    cout << "d: " << d << '\n';

a41 1
    c3 = float(c1);
d48 1
a49 1
    cout << "c4: ";
@


1.5
log
@improved comment, remove emacs local variables.
@
text
@d1 1
a1 1
static char rcsid[] = "$Id: test2.cc,v 1.4 92/05/21 08:07:48 fischer Exp Locker: thoth $";
d3 19
a21 17
/*
 * $Log:	test2.cc,v $
 * Revision 1.4  92/05/21  08:07:48  fischer
 * Started rework of CoordType to IA::NumericType
 * so all classes can access.
 * 
 * Revision 1.3  92/05/20  06:31:54  fischer
 * Used Coord.output(cout) routine of Rob's
 * to get around broken << operator.
 * 
 * Revision 1.2  92/05/16  13:57:48  thoth
 * added log goo
 * 
 * Revision 1.1  92/05/16  13:47:13  thoth
 * Initial revision
 *
 */
@


1.4
log
@Started rework of CoordType to IA::NumericType
so all classes can access.
@
text
@d1 1
a1 1
static char rcsid[] = "$Id: test2.cc,v 1.3 92/05/20 06:31:54 fischer Exp Locker: fischer $";
d5 4
d48 2
a49 2
    // should fail here -- c4 gets type mismatch...

a62 4

// Local variables:
// eval: (joe-style)
// End:
@


1.3
log
@Used Coord.output(cout) routine of Rob's
to get around broken << operator.
@
text
@d1 1
a1 1
static char rcsid[] = "$Id: test2.cc,v 1.2 92/05/16 13:57:48 thoth Exp Locker: fischer $";
d5 4
d23 7
@


1.2
log
@added log goo
@
text
@d1 1
a1 1
static char rcsid[] = "$Id: test2.cc,v 1.1 92/05/16 13:47:13 thoth Exp Locker: thoth $";
d5 3
d20 27
a46 7
    cout << c1 << '\n';
    cout << c2 << '\n';
    cout << c1.to_float() << '\n';
    cout << c1.to_int() << '\n';
    cout << c2.to_float() << '\n';
    cout << "conversion error: ";
    cout << c2.to_int() << '\n';
@


1.1
log
@Initial revision
@
text
@d1 1
a1 1
static char rcsid[] = "$Id$";
d4 3
a6 1
 * $Log$
@
