Source
cout << "\ntCalLibraryParse result = " << ((ok_string && ok_string2 && ok_file) ? "PASS" : "FAIL") << endl;
//# Copyright (C) 2015
//# Associated Universities, Inc. Washington DC, USA.
//#
//# 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 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.,
//# 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: aips2-request@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
//#
using namespace casacore;
using namespace casa;
using namespace std;
int parseString(String callibString, Bool testString=true) {
/* Return value of 1 = parsing succeeded */
try {
cout << "\ntCalLibraryParse STRING " << endl;
Record callibRec = callibSetParams(callibString);
if (testString) {
bool ok1, ok2, ok3, ok4;
//cout << "DEBUG: callibRec = " << callibRec << endl;
// Check 1 - number of fields in returned Record
ok1 = (callibRec.nfields() == 1);
cout << "callib Record nfields=1 check: ";
cout << (ok1 ? "PASS" : "FAIL")<< endl;
// Check 2 - bcal has 2 fields
Record bcalRec = callibRec.asRecord("ngc5921.bcal");
ok2 = (bcalRec.nfields() == 2);
cout << "bcal Record nfields=2 check: ";
cout << (ok2 ? "PASS" : "FAIL") << endl;
// Check 3 - bcal tinterp check
Record bcalRec0 = bcalRec.asRecord("0");
ok3 = (bcalRec0.asString("tinterp") == "nearest");
cout << "bcal tinterp='nearest' check: ";
cout << (ok3 ? "PASS" : "FAIL") << endl;
// Check 4 - bcal calwt=false