/*

  Copyright (C) 2004  Betti Österholz

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2, June 1991, of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

#include "Parameter.h"


void testParameter()
{

Parameter para;

for (int i=0;i<50;i++)
{
	para.setInitParameter(i,i);
	cout<<para.getInitParameter(i)<<";";
}
cout<<endl;
for (int i=0;i<50;i++)
{
	para.setTerminalConditionParameter(i,((double)(i)/11));
}
for (int i=0;i<100;i++)
{
	para.setOperationsParameter(i,((double)(i)/23));
}
for (int i=0;i<25;i++)
{
	para.setNamesParameter(i,"sw_blocks1.btx ");
}
for (int i=26;i<50;i++)
{
	para.setNamesParameter(i,"sw_blo.btx ");
}
for (int i=0;i<50;i=i+2)
{
	para.setDocumentParameter(i,true);
}
para.save("param.pra");

cout<<"saved"<<endl<<flush;

Parameter para1;
para1.load("param.pra");
cout<<"loaded"<<endl<<flush;

bool b=true;

for (int i=0;i<50;i++)
{
	cout<<para1.getInitParameter(i)<<";";
	b=b&&(para1.getInitParameter(i)==para.getInitParameter(i));
}
cout<<endl;
for (int i=0;i<50;i++)
{
	cout<<para1.getTerminalConditionParameter(i)<<";";
	b=b&&(para1.getTerminalConditionParameter(i)==para.getTerminalConditionParameter(i));
}
cout<<endl;
for (int i=0;i<100;i++)
{
	b=b&&(para1.getOperationsParameter(i)==para.getOperationsParameter(i));
}
for (int i=0;i<50;i++)
{
	cout<<para1.getNamesParameter(i)<<";";
}
for (int i=0;i<50;i++)
{
	b=b&&(para1.getDocumentParameter(i)==para.getDocumentParameter(i));
}
if (b) {cout<<endl<<"OK"<<endl;}
else{cout<<endl<<"Fail"<<endl;}

};
