head	1.9;
access
	monica
	thoth;
symbols;
locks; strict;
comment	@// @;


1.9
date	94.08.25.21.10.32;	author monica;	state Exp;
branches;
next	1.8;

1.8
date	94.08.25.20.54.34;	author monica;	state Exp;
branches;
next	1.7;

1.7
date	94.08.25.18.40.56;	author monica;	state Exp;
branches;
next	1.6;

1.6
date	94.08.23.23.57.12;	author monica;	state Exp;
branches;
next	1.5;

1.5
date	94.08.18.20.34.44;	author monica;	state Exp;
branches;
next	1.4;

1.4
date	94.08.17.03.12.53;	author monica;	state Exp;
branches;
next	1.3;

1.3
date	94.08.16.20.06.01;	author monica;	state Exp;
branches;
next	1.2;

1.2
date	94.08.16.18.50.51;	author monica;	state Exp;
branches;
next	1.1;

1.1
date	94.08.16.18.16.38;	author monica;	state Exp;
branches;
next	;


desc
@tests derange function for point
@


1.9
log
@added test for array version on double point
@
text
@// $Id: test052.c,v 1.8 1994/08/25 20:54:34 monica Exp monica $
// $Log: test052.c,v $
// Revision 1.8  1994/08/25  20:54:34  monica
// added array version of derange to this test
//
// Revision 1.7  1994/08/25  18:40:56  monica
// prefixed 0s with (unsigned) to deal with ambiguity
//
// Revision 1.6  1994/08/23  23:57:12  monica
// changed some 0s to (int)0s
//
//Revision 1.5  1994/08/18  20:34:44  monica
//changed rcs info
//

#include "test.h"

    unsigned fill8[]= {3,2,1,0,3,2,1,0};
    unsigned fill5[]= {2,3,2,1,0};
    unsigned fill3[]= {2,3,2};

int main ()
{

    IA::abort_on_throw=0;
    cout << "Testing derange\n";

#define q0(a,b,c) \
	cout<<"\n\t"<<"derange("<<a<<",{3,2,1,0,3,2,1,0},"<<c<<")\n";\
	cout<<"\t result:" << derange(a,b,c) <<"\n"

#define q1(a,b) \
        cout<<"\n\t"<<"derange("<<a<<","<<b<<")\n";\
	cout<<"\t result:" << derange(a,b) <<"\n"

#define q2(a,b,c) \
	cout<<"\n\t"<<"derange("<<a<<","<<b<<","<<c<<")\n";\
	cout<<"\t result:" << derange(a,b,c) <<"\n"

#define q3(a,b,c,d) \
	cout<<"\n\t"<<"derange("<<a<<","<<b<<","<<c<<","<<d<<")\n";\
	cout<<"\t result:" << derange(a,b,c,d) <<"\n"

#define q4(a,b,c,d,e) \
	cout<<"\n\t"<<"derange("<<a<<","<<b<<","<<c<<","<<d<<","<<e<<")\n";\
	cout<<"\t result:" << derange(a,b,c,d,e) <<"\n"

#define q5(a,b,c,d,e,f) \
	cout<<"\n\t"<<"derange("<<a<<","<<b<<","<<c<<","<<d<<","<<e<<","<<f<<")\n";\
	cout<<"\t result:" << derange(a,b,c,d,e,f) <<"\n"

IA_Point<int> pt5(0,1,2,3,4);


    cout << "\nTesting array version of derange function\n";
// these test the array version of the derange function

    q0(pt5,fill8,8);
    q0(pt5,fill8,3);
    q0(pt5,fill8,1);
    q0(pt5,fill8,2);

    q0(pd5,fill8,8);
    q0(pd5,fill8,3);
    q0(pd5,fill8,1);
    q0(pd5,fill8,2);

    cout << "\nTesting non-array versions of derange function\n";
// these test the other versions of the derange function

    q1(pi1,0);
    q1(pi2,1);
    q1(pi3,2);
    q1(pi4,0);
    q1(pi5,2);
    
    q2(pi2,1,1);
    q2(pi4,3,0);
    q2(pi5,1,2);

    q1(pd1,0);
    q1(pd2,0);
    q1(pd3,2);
    q1(pd4,3);
    q1(pd5,3);

    q2(pd2,1,1);
    q2(pd3,2,1);
    q2(pd4,3,3);
    q2(pd5,4,3);

    q2(pi1,(unsigned)0,0);
    q2(pi3,(unsigned)0,2);
    q2(pd1,(unsigned)0,0);

// these will all throw
    
    q1(piu,1);
    q1(pi1,1);
    q1(pi2,2);
    q1(pi3,3);
    q1(pi4,4);
    q1(pi5,5);
    
    q1(pdu,1);
    q1(pd1,1);
    q1(pd2,2);
    q1(pd3,3);
    q1(pd4,4);
    q1(pd5,5);

    return 0;

}

@


1.8
log
@added array version of derange to this test
@
text
@d1 1
a1 1
// $Id: test052.c,v 1.7 1994/08/25 18:40:56 monica Exp monica $
d3 3
d52 1
a52 1
IA_Point<int> pt5(-2,-1,0,1,2);
d55 1
a55 1
    cout << "Testing array version of derange function\n";
d63 7
a69 2
    cout << "Testing non-array versions of derange function\n";
// these these the other versions of the derange function
@


1.7
log
@prefixed 0s with (unsigned) to deal with ambiguity
@
text
@d1 1
a1 1
// $Id: test052.c,v 1.6 1994/08/23 23:57:12 monica Exp monica $
d3 3
d15 4
d25 4
d48 14
@


1.6
log
@changed some 0s to (int)0s
@
text
@d1 1
a1 1
// $Id: test052.c,v 1.5 1994/08/18 20:34:44 monica Exp monica $
d3 3
d14 4
a17 2
IA::abort_on_throw=0;
cout << "Testing derange\n";
d19 2
a20 2
cout<<"\n\t"<<a<<".derange("<<b<<")\n";\
cout<<"\t result:" << a.derange(b) <<"\n"
d23 2
a24 2
cout<<"\n\t"<<a<<".derange("<<b<<","<<c<<")\n";\
cout<<"\t result:" << a.derange(b,c) <<"\n"
d27 2
a28 2
cout<<"\n\t"<<a<<".derange("<<b<<","<<c<<","<<d<<")\n";\
cout<<"\t result:" << a.derange(b,c,d) <<"\n"
d31 2
a32 2
cout<<"\n\t"<<a<<".derange("<<b<<","<<c<<","<<d<<","<<e<<")\n";\
cout<<"\t result:" << a.derange(b,c,d,e) <<"\n"
d35 2
a36 2
cout<<"\n\t"<<a<<".derange("<<b<<","<<c<<","<<d<<","<<e<<","<<f<<")\n";\
cout<<"\t result:" << a.derange(b,c,d,e,f) <<"\n"
d38 40
a77 37
q1(piu,1);
q1(pi1,1);
q1(pi2,2);
q1(pi3,2);
q1(pi4,1);
q1(pi5,5);

q1(pdu,1);
q1(pd1,1);
q1(pd2,2);
q1(pd3,3);
q1(pd4,4);
q1(pd5,5);

q1(pi1,(int)0);
q1(pi2,1);
q1(pi3,2);
q1(pi4,(int)0);
q1(pi5,2);

q2(pi1,(int)0,0);
q2(pi2,1,1);
q2(pi3,(int)0,2);
q2(pi4,3,0);
q2(pi5,1,2);

q1(pd1,(int)0);
q1(pd2,(int)0);
q1(pd3,2);
q1(pd4,3);
q1(pd5,3);

q2(pd1,(int)0,0);
q2(pd2,1,1);
q2(pd3,2,1);
q2(pd4,3,3);
q2(pd5,4,3);
d79 1
a79 1
return 0;
d82 1
@


1.5
log
@changed rcs info
@
text
@d1 5
a5 2
// $Id$
// $Log$
d47 1
a47 1
q1(pi1,0);
d50 1
a50 1
q1(pi4,0);
d59 2
a60 2
q1(pd1,0);
q1(pd2,0);
@


1.4
log
@added return 0 to main
@
text
@d1 3
@


1.3
log
@int main
@
text
@d65 2
@


1.2
log
@added "Testing" output line
@
text
@d3 1
a3 1
main ()
@


1.1
log
@Initial revision
@
text
@d6 1
a6 1

@
