/*
 * Copyright (c) 1999 Johnny C. Lam.
 * All rights reserved.
 *
 * Permission to use, copy, modify, distribute and sell this software
 * and its documentation for any purpose is hereby granted without fee,
 * provided that the above copyright notice appear in all copies and
 * that both that copyright notice and this permission notice appear
 * in supporting documentation.  The author makes no representations
 * about the suitability of this software for any purpose.  It is
 * provided "as is" without express or implied warranty.
 */

#include <iostream>
#include <fstream>
#include <marker.h>

int
main()
{
	Marker a(4);
	Marker b(5);

	cout << "a should be 4: " << a << endl;
	cout << "b should be 5: " << b << endl;

	a = 2;
  
	cout << "a should be 2: " << a << endl;
	cout << "should be 3 (diff): " << Marker::diff(a, b) << endl;

	cout << "b < a: " << (b < a) << " (should be 0)" << endl;
	cout << "b > a: " << (a < b) << " (should be 1)" << endl;
	cout << "b == a: " << (b == a) << " (should be 0)" << endl;

    Marker c;
	cout << "c should be NA: " << c << endl;
	
	cout << "c < a: " << (c < a) << " (should be 1)" << endl;
	cout << "c > a: " << (a < c) << " (should be 0)" << endl;
	cout << "c == a: " << (c == a) << " (should be 1)" << endl;
	cout << "should be 0 (diff): " << Marker::diff(a, c) << endl;

	b = -10;
	cout << "b should be NA: " << b << endl;
	cout << "c < b: " << (c < b) << " (should be 0)" << endl;
	cout << "c > b: " << (b < c) << " (should be 0)" << endl;
	cout << "c == b: " << (c == b) << " (should be 1)" << endl;
	cout << "should be 0 (diff): " << Marker::diff(a, b) << endl;

	// file should contain -10 3
	ifstream ifs("test/marker.test");
	ifs >> a >> b;

	cout << "a should be NA: " << a << endl;
	cout << "b should be 3:  " << b << endl;

	return 0;
}
