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


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

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


desc
@initial log
@


1.2
log
@made dos filename compatible
@
text
@/*  $RCS$
    $Log: gen-test.c,v $
// Revision 1.1  1994/08/18  03:10:15  monica
// Initial revision
//
 * Revision 1.3  92/09/29  15:32:53  jm
 * *** empty log message ***
 * 
 * Revision 1.2  92/09/16  17:03:36  jm
 * *** empty log message ***
 * 
*/


/* needs all the set interator stuff restored once implemented */

#include "Set.h"
#include "gen-test.h"

template <class IA_ValueType>
void test_union(IA_Set<IA_ValueType> a, IA_Set<IA_ValueType> b, 
		IA_Set<IA_ValueType> ab) {
    IA_ValueType	p;
    
/*    IA_SetIter<IA_ValueType>	iter = a;
    
    while (iter(p)) {
	if (!ab.contains(p)) {
	    cout << p;
	    cout << "##missing##\n";
	}
    }
    
    iter = b;
    
    while (iter(p)) {
	if (!ab.contains(p)) {
	    cout << p;
	    cout << "##missing##\n";
	}
    }
    
    iter = ab;
    
    while (iter(p)) {
	if (! (a.contains(p) || b.contains(p))) {
	    cout << p;
	    cout << "##extra##\n";
	}
    }
*/
    if (a>ab)
	cout << "## a > a|b ##\n";
    if (b>ab)
	cout << "## b > a|b ##\n";

    cout << "union test complete\n";
}

/* template <class IA_ValueType>
void test_inter(IA_Set<IA_ValueType> a, IA_Set<IA_ValueType> b, 
		IA_Set<IA_ValueType> ab) {

    IA_ValueType	p;
    
    IA_SetIter<IA_ValueType>	iter = a;
    
    while (iter(p)) {
	if (b.contains(p) != ab.contains(p)) {
	    cout << p << ":" << b.contains(p) << "->";
	    cout << p << ":" << ab.contains(p) << "->";
	    cout << "##a error##\n";
	}
    }
    
    iter = b;
    
    while (iter(p)) {
	if (a.contains(p) != ab.contains(p)) {
	    cout << p << ":" << a.contains(p) << "->";
	    cout << p << ":" << ab.contains(p) << "->";
	    cout << "##b error##\n";
	}
    }
    
    iter = ab;
    
    while (iter(p)) {
	if (! (a.contains(p) && b.contains(p))) {
	    cout << p;
	    cout << "##ab extra##\n";
	}
    }

    if (a<ab)
	cout << "## a < a&b ##\n";
    if (b<ab)
	cout << "## b < a&b ##\n";
    cout << "intersection test complete\n";
}*/

template <class IA_ValueType>
void test_sdiff(IA_Set<IA_ValueType> a, IA_Set<IA_ValueType> b, 
		IA_Set<IA_ValueType> ab) {
    IA_ValueType	p;
    
/*    IA_SetIter<IA_ValueType>	iter = a;
    
    while (iter(p)) {
	if (b.contains(p) && ab.contains(p)) {
	    cout << p;
	    cout << "##a extra error##\n";
	} else if (!b.contains(p) && !ab.contains(p)) {
	    cout << p;
	    cout << "##a missing error##\n";
	}
    }
    
    iter = b;
    
    while (iter(p)) {
	if (a.contains(p) && ab.contains(p)) {
	    cout << p;
	    cout << "##b extra error##\n";
	} else if (!a.contains(p) && !ab.contains(p)) {
	    cout << p;
	    cout << "##b missing error##\n";
	}
    }
    
    iter = ab;
    
    while (iter(p)) {
	if (a.contains(p) == b.contains(p)) {
	    cout << p;
	    cout << "##ab extra##\n";
	}
    }*/
    
    if ( ((a/b) | (b/a)) != ab ) {
	cout << "(a/b) | (b/a) != a^b\n";
    }
    
    cout << "symmetric difference test complete\n";
}

template <class IA_ValueType>
void test_minus(IA_Set<IA_ValueType> a, IA_Set<IA_ValueType> b, 
		IA_Set<IA_ValueType> ab) {
    IA_ValueType	p;
    
/*    IA_SetIter<IA_ValueType>	iter = a;
    
    while (iter(p)) {
	if (b.contains(p) && ab.contains(p)) {
	    cout << p << "##extra [a] error##\n";
	} else if ( ! b.contains(p) && ! ab.contains(p) ) {
	    cout << p << "##missing [a] error##\n";
	}
    }
    
    iter = b;
    
    while (iter(p)) {
	if (ab.contains(p)) {
	    cout << p;
	    cout << "##b error##\n";
	}
    }
    
    iter = ab;
    
    while (iter(p)) {
	if (!a.contains(p) || b.contains(p)) {
	    cout << p;
	    cout << "##ab extra##\n";
	}
    }*/

    if (a<ab)
	cout << "## a < a/b ##\n";

    cout << "difference test complete\n";
}

/*template <class IA_ValueType>
void list_value_set(ostream &o, IA_Set<IA_ValueType> vs) {
    IA_SetIter<IA_ValueType>	iter(vs);
    IA_ValueType	ip;
    while (iter(ip)) {
	o << ip << ' ';
    }
    o << "\n";
}*/
@


1.1
log
@Initial revision
@
text
@d2 4
a5 1
    $Log:	generic-tests.c,v $
d18 1
a18 1
#include "generic-tests.h"
@
