//Editor-Info: -*- C++ -*-
//
//Subject: TOVE project / pf
//
//File: test.cpp 
//
//Version: $Revision: 1.11 $
//
//State: $State: Exp $
//
//Date: $Date: 1998/10/12 20:00:55 $
//
//Organisation:
//      Helsinki University of Technology
//      Laboratory of Telecommunications Software and Multimedia
//
//Author:
//	Vesa-Matti Puro
//
//Description:
//
//
//Copyright:
//      Copyright 1999 Helsinki University of Technology
//      ALL RIGHTS RESERVED BETWEEN JANUARY 1996 AND JUNE 1999.
//
//Licence:
//
//
//History: 
//
//

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

pfTest :: pfTest(void)
    : _name("test"),
      _purpose("purpose"),
      _passCount(0),
      _failCount(0),
      _incoCount(0)
{
    return;
}

pfTest :: pfTest(const pfTest &other_)
    : _name(other_._name),
      _purpose(other_._purpose),
      _passCount(other_._passCount),
      _failCount(other_._failCount),
      _incoCount(other_._incoCount)
{
    return;
}

pfTest :: ~pfTest(void)
{
    return;
}

pfTest &pfTest :: operator=(const pfTest &other_)
{
    if (this != &other_)
    {
        _name = other_._name;
        _purpose = other_._purpose;
        _passCount = other_._passCount;
        _failCount = other_._failCount;
        _incoCount = other_._incoCount;
    }
    return *this;
}

string pfTest :: name(void) const
{
    return _name;
}

string pfTest :: purpose(void) const
{
    return _purpose;
}

void pfTest :: test(void)
{
    init();
    void *object = create();
    destroy(object);
    assign();
    copy();
    valid();
    invalid();
    inopportune();
    timing();
    finalize();
    report();
    return;
}

void pfTest :: init(void)
{
    cout << name() << " starting" << endl;
}

void pfTest :: finalize(void)
{
    cout << name() << " ending" << endl;
}

void *pfTest :: create(void)
{
    return 0;
}

void pfTest :: destroy(void *object_)
{
    delete object_;
    return;
}

bool pfTest :: assign(void)
{
    return false;
}

bool pfTest :: copy()
{
    return false;
}

bool pfTest :: valid()
{
    return false;
}

bool pfTest :: invalid()
{
    return false;
}

bool pfTest :: inopportune()
{
    return false;
}

bool pfTest :: timing()
{
    return false;
}

// ----------------------------------------------------------------------

void pfTest :: report(void)
{
    string verdict;
    if (_failCount > 0)
    {
        verdict = "failed";
    }
    else if ((_incoCount > 0) || (_passCount == 0))
    {
        verdict = "inconclusive";
    }
    else
    {
        verdict = "passed";
    }
    cout << name() << " " << verdict << endl;
    return;
}

void pfTest :: recordPass(void)
{
    ++_passCount;
}

void pfTest :: recordFail(void)
{
    ++_failCount;
}

void pfTest :: recordInco(void)
{
    ++_incoCount;
}

