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


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


desc
@@


1.1
log
@Initial revision
@
text
@// Emacs: -*- C++ -*-

static char rcsid[] = "$Id: test-concatenation.c,v 1.1 1992/08/20 22:25:58 rjj Exp monica $";

//
// $Log: test-concatenation.c,v $
// Revision 1.1  1992/08/20  22:25:58  rjj
// Initial revision
//
// 
// 

#include <FloatPoint.h>

int main(int argc, char**argv)
{
    FloatPoint	p(10,20,30,40), r, P;
    IntPoint    q(0), Q;
    int         a=11;
    float       b=2.1;
    void        prlp (char*, FloatPoint&);
    void        prlp (char*, IntPoint&);
    void        prlc (char*, int&);
    
    IA::exit_on_throw = 0;

    prlp("p: ", p);    prlp("q: ", q);    prlp("r: ", r);
    cout << "int a: " << a << "\n";
    cout << "float b: " << b << "\n";
    
    P = concat(P, P);
    prlp("P = concat(P, P); ", P);
    
    P = concat(P, 1);
    prlp("P = concat(P, 1); ", P);
    
    P = concat(P, 1.2);
    prlp("P = concat(P, 1.2); ", P);
    
    P = concat(P, 2);
    prlp("P = concat(P, 2); ", P);
    
    P = concat(p, q);
    prlp("P = concat(p, q); ", P);
    P = concat(q, p);
    prlp("P = concat(q, p); ", P);

    Q = concat(q, q);
    prlp("Q = concat(q, q); ", Q);

    P = concat(q, r);
    prlp("P = concat(q, r); ", P);
    P = concat(r, q);
    prlp("P = concat(r, q); ", P);

    P = concat(p, a);
    prlp("P = concat(p, a); ", P);
    P = concat(a, p);
    prlp("P = concat(a, p); ", P);

    P = concat(p, b);
    prlp("P = concat(p, b); ", P);
    P = concat(b, p);
    prlp("P = concat(b, p); ", P);

    // Should throw
    
    P = concat(p, p);
    prlp("P = concat(p, p); ", P);

    
    for (int i = -1; i <= 1; i++) {
	P = (i); 
	cout << P << "\n";
	for (float j = -1; j <= 1; j++) {
	    P = concat(i, FloatPoint(j)); 
	    cout <<  P << "\n";
	    for (int k = -1; k <= 1; k++) {
		P = concat(i, concat(FloatPoint(j), IntPoint(k)));
		cout << P << "\n";
		for (float l = -1; l <= 1; l++) {
		    P = concat(concat(i, FloatPoint(j)), concat(FloatPoint(k), l)); 
		    cout << P << "\n";
		}
	    }
	}
    }

}

void
prlp (char *label, FloatPoint& p)
{
    cout << "FloatPoint: " << label << p <<  "\n";
}


void
prlp (char *label, IntPoint& p)
{
    cout << "IntPoint: " << label << p <<  "\n";
}


@
