// Purpose: Converts ida3 format xma data to netcdf4 // Usage: xma2netcdf #include #include #include #include #include #include #include #include "test_utilities.h" using namespace std; using namespace netCDF; using namespace netCDF::exceptions; int main() { try { { cout<<"Opening file \"firstFile.cdf\" with NcFile::replace"< dimArray(2); dimArray[0]=dim1; dimArray[1]=dim2; vector stringArray(2); stringArray[0] = "dim1"; stringArray[1] = "dim2"; NcVar varA1_3 = ncFile.addVar("varA1_3",ncByte,dimArray); NcVar varA1_4 = ncFile.addVar("varA1_4","byte",stringArray); NcVar varA1_5 = groupB.addVar("varA1_5",ncByte,dim4); NcVar varA1_6 = groupB.addVar("varA1_6",ncByte,dim2); dimArray[0]=dim1; dimArray[1]=dim7; NcVar varA1_7 = groupB.addVar("varA1_7",ncByte,dimArray); dimArray[0]=dim1; dimArray[1]=dim2; NcVar varA1_8 = groupC.addVar("varA1_8",ncByte,dimArray); cout <<" ----------- passed\n"; } cout<<"Preparing for tests..."< groupMap; multimap::iterator iter; groupMap = ncFile.getVars(); if(groupMap.size() != 1) throw NcException("NcException","Error in test 5.1",__FILE__,__LINE__); iter=groupMap.find("var_1"); if( iter == groupMap.end()) throw NcException("NcException","Error in test 5.2",__FILE__,__LINE__); iter=groupMap.find("varA_1"); if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.3",__FILE__,__LINE__); iter=groupMap.find("varA0_1");if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.4",__FILE__,__LINE__); iter=groupMap.find("varB_3"); if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.5",__FILE__,__LINE__); iter=groupMap.find("varC_5"); if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.6",__FILE__,__LINE__); groupMap = ncFile.getVars(NcGroup::Current); if(groupMap.size() != 1) throw NcException("NcException","Error in test 5.7",__FILE__,__LINE__); iter=groupMap.find("var_1"); if( iter == groupMap.end()) throw NcException("NcException","Error in test 5.8",__FILE__,__LINE__); iter=groupMap.find("varA_1"); if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.9",__FILE__,__LINE__); iter=groupMap.find("varA0_1");if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.10",__FILE__,__LINE__); iter=groupMap.find("varB_3"); if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.11",__FILE__,__LINE__); iter=groupMap.find("varC_5"); if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.12",__FILE__,__LINE__); groupMap = ncFile.getVars(NcGroup::Parents); if(groupMap.size() != 0) throw NcException("NcException","Error in test 5.13",__FILE__,__LINE__); groupMap = ncFile.getVars(NcGroup::Children); if(groupMap.size() != 14) throw NcException("NcException","Error in test 5.14",__FILE__,__LINE__); iter=groupMap.find("var_1"); if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.15",__FILE__,__LINE__); iter=groupMap.find("varA_1"); if( iter == groupMap.end()) throw NcException("NcException","Error in test 5.16",__FILE__,__LINE__); iter=groupMap.find("varA0_1");if( iter == groupMap.end()) throw NcException("NcException","Error in test 5.17",__FILE__,__LINE__); iter=groupMap.find("varB_3"); if( iter == groupMap.end()) throw NcException("NcException","Error in test 5.18",__FILE__,__LINE__); iter=groupMap.find("varC_5"); if( iter == groupMap.end()) throw NcException("NcException","Error in test 5.19",__FILE__,__LINE__); groupMap = ncFile.getVars(NcGroup::ParentsAndCurrent); if(groupMap.size() != 1) throw NcException("NcException","Error in test 5.20",__FILE__,__LINE__); iter=groupMap.find("var_1"); if( iter == groupMap.end()) throw NcException("NcException","Error in test 5.21",__FILE__,__LINE__); iter=groupMap.find("varA_1"); if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.22",__FILE__,__LINE__); iter=groupMap.find("varA0_1");if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.23",__FILE__,__LINE__); iter=groupMap.find("varB_3"); if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.24",__FILE__,__LINE__); iter=groupMap.find("varC_5"); if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.25",__FILE__,__LINE__); groupMap = ncFile.getVars(NcGroup::ChildrenAndCurrent); if(groupMap.size() != 15) throw NcException("NcException","Error in test 5.26",__FILE__,__LINE__); iter=groupMap.find("var_1"); if( iter == groupMap.end()) throw NcException("NcException","Error in test 5.27",__FILE__,__LINE__); iter=groupMap.find("varA_1"); if( iter == groupMap.end()) throw NcException("NcException","Error in test 5.28",__FILE__,__LINE__); iter=groupMap.find("varA0_1");if( iter == groupMap.end()) throw NcException("NcException","Error in test 5.29",__FILE__,__LINE__); iter=groupMap.find("varB_3"); if( iter == groupMap.end()) throw NcException("NcException","Error in test 5.30",__FILE__,__LINE__); iter=groupMap.find("varC_5"); if( iter == groupMap.end()) throw NcException("NcException","Error in test 5.31",__FILE__,__LINE__); groupMap = ncFile.getVars(NcGroup::All ); if(groupMap.size() != 15) throw NcException("NcException","Error in test 5.32",__FILE__,__LINE__); iter=groupMap.find("var_1"); if( iter == groupMap.end()) throw NcException("NcException","Error in test 5.33",__FILE__,__LINE__); iter=groupMap.find("varA_1"); if( iter == groupMap.end()) throw NcException("NcException","Error in test 5.34",__FILE__,__LINE__); iter=groupMap.find("varA0_1");if( iter == groupMap.end()) throw NcException("NcException","Error in test 5.35",__FILE__,__LINE__); iter=groupMap.find("varB_3"); if( iter == groupMap.end()) throw NcException("NcException","Error in test 5.36",__FILE__,__LINE__); iter=groupMap.find("varC_5"); if( iter == groupMap.end()) throw NcException("NcException","Error in test 5.37",__FILE__,__LINE__); // now groupC........ groupMap = groupC.getVars(); if(groupMap.size() != 5) throw NcException("NcException","Error in test 5.38",__FILE__,__LINE__); iter=groupMap.find("var_1"); if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.39",__FILE__,__LINE__); iter=groupMap.find("varA_1"); if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.40",__FILE__,__LINE__); iter=groupMap.find("varA0_1");if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.41",__FILE__,__LINE__); iter=groupMap.find("varB_3"); if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.42",__FILE__,__LINE__); iter=groupMap.find("varC_5"); if( iter == groupMap.end()) throw NcException("NcException","Error in test 5.43",__FILE__,__LINE__); groupMap = groupC.getVars(NcGroup::Current); if(groupMap.size() != 5) throw NcException("NcException","Error in test 5.44",__FILE__,__LINE__); iter=groupMap.find("var_1"); if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.45",__FILE__,__LINE__); iter=groupMap.find("varA_1"); if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.46",__FILE__,__LINE__); iter=groupMap.find("varA0_1");if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.47",__FILE__,__LINE__); iter=groupMap.find("varB_3"); if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.48",__FILE__,__LINE__); iter=groupMap.find("varC_5"); if( iter == groupMap.end()) throw NcException("NcException","Error in test 5.49",__FILE__,__LINE__); groupMap = groupC.getVars(NcGroup::Parents); if(groupMap.size() != 3) throw NcException("NcException","Error in test 5.50",__FILE__,__LINE__); iter=groupMap.find("var_1"); if( iter == groupMap.end()) throw NcException("NcException","Error in test 5.51",__FILE__,__LINE__); iter=groupMap.find("varA_1"); if( iter == groupMap.end()) throw NcException("NcException","Error in test 5.52",__FILE__,__LINE__); iter=groupMap.find("varA0_1");if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.53",__FILE__,__LINE__); iter=groupMap.find("varB_3"); if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.54",__FILE__,__LINE__); iter=groupMap.find("varC_5"); if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.55",__FILE__,__LINE__); groupMap = groupC.getVars(NcGroup::Children); if(groupMap.size() != 0) throw NcException("NcException","Error in test 5.56",__FILE__,__LINE__); groupMap = groupC.getVars(NcGroup::ParentsAndCurrent); if(groupMap.size() != 8) throw NcException("NcException","Error in test 5.57",__FILE__,__LINE__); iter=groupMap.find("var_1"); if( iter == groupMap.end()) throw NcException("NcException","Error in test 5.58",__FILE__,__LINE__); iter=groupMap.find("varA_1"); if( iter == groupMap.end()) throw NcException("NcException","Error in test 5.59",__FILE__,__LINE__); iter=groupMap.find("varA0_1");if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.60",__FILE__,__LINE__); iter=groupMap.find("varB_3"); if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.61",__FILE__,__LINE__); iter=groupMap.find("varC_5"); if( iter == groupMap.end()) throw NcException("NcException","Error in test 5.62",__FILE__,__LINE__); groupMap = groupC.getVars(NcGroup::ChildrenAndCurrent); if(groupMap.size() != 5) throw NcException("NcException","Error in test 5.63",__FILE__,__LINE__); iter=groupMap.find("var_1"); if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.64",__FILE__,__LINE__); iter=groupMap.find("varA_1"); if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.65",__FILE__,__LINE__); iter=groupMap.find("varA0_1");if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.66",__FILE__,__LINE__); iter=groupMap.find("varB_3"); if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.67",__FILE__,__LINE__); iter=groupMap.find("varC_5"); if( iter == groupMap.end()) throw NcException("NcException","Error in test 5.68",__FILE__,__LINE__); groupMap = groupC.getVars(NcGroup::All ); if(groupMap.size() != 8) throw NcException("NcException","Error in test 5.69",__FILE__,__LINE__); iter=groupMap.find("var_1"); if( iter == groupMap.end()) throw NcException("NcException","Error in test 5.70",__FILE__,__LINE__); iter=groupMap.find("varA_1"); if( iter == groupMap.end()) throw NcException("NcException","Error in test 5.71",__FILE__,__LINE__); iter=groupMap.find("varA0_1");if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.72",__FILE__,__LINE__); iter=groupMap.find("varB_3"); if( iter != groupMap.end()) throw NcException("NcException","Error in test 5.73",__FILE__,__LINE__); iter=groupMap.find("varC_5"); if( iter == groupMap.end()) throw NcException("NcException","Error in test 5.74",__FILE__,__LINE__); cout <<" ----------- passed\n"; cout < groupSet; set::iterator iter; groupSet = ncFile.getVars("var_1"); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.1",__FILE__,__LINE__); iter=groupSet.find(var_1); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.2",__FILE__,__LINE__); groupSet = ncFile.getVars("varA_1"); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.3",__FILE__,__LINE__); groupSet = ncFile.getVars("varA0_2"); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.4",__FILE__,__LINE__); groupSet = ncFile.getVars("varB_3"); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.5",__FILE__,__LINE__); groupSet = ncFile.getVars("varC_5"); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.6",__FILE__,__LINE__); groupSet = ncFile.getVars("var_1",NcGroup::Current); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.7",__FILE__,__LINE__); iter=groupSet.find(var_1); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.8",__FILE__,__LINE__); groupSet = ncFile.getVars("varA_1",NcGroup::Current); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.9",__FILE__,__LINE__); groupSet = ncFile.getVars("varA0_2",NcGroup::Current); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.10",__FILE__,__LINE__); groupSet = ncFile.getVars("varB_3",NcGroup::Current); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.11",__FILE__,__LINE__); groupSet = ncFile.getVars("varC_5",NcGroup::Current); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.12",__FILE__,__LINE__); groupSet = ncFile.getVars("var_1",NcGroup::Parents); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.13",__FILE__,__LINE__); groupSet = ncFile.getVars("varA_1",NcGroup::Parents); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.14",__FILE__,__LINE__); groupSet = ncFile.getVars("varA0_2",NcGroup::Parents); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.15",__FILE__,__LINE__); groupSet = ncFile.getVars("varB_3",NcGroup::Parents); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.16",__FILE__,__LINE__); groupSet = ncFile.getVars("varC_5",NcGroup::Parents); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.17",__FILE__,__LINE__); groupSet = ncFile.getVars("var_1",NcGroup::Children); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.18",__FILE__,__LINE__); groupSet = ncFile.getVars("varA_1",NcGroup::Children); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.19",__FILE__,__LINE__); iter=groupSet.find(varA_1); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.20",__FILE__,__LINE__); groupSet = ncFile.getVars("varA0_2",NcGroup::Children); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.21",__FILE__,__LINE__); iter=groupSet.find(varA0_2); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.22",__FILE__,__LINE__); groupSet = ncFile.getVars("varB_3",NcGroup::Children); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.23",__FILE__,__LINE__); iter=groupSet.find(varB_3); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.24",__FILE__,__LINE__); groupSet = ncFile.getVars("varC_5",NcGroup::Children); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.25",__FILE__,__LINE__); iter=groupSet.find(varC_5); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.26",__FILE__,__LINE__); groupSet = ncFile.getVars("var_1",NcGroup::ParentsAndCurrent); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.27",__FILE__,__LINE__); iter=groupSet.find(var_1); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.28",__FILE__,__LINE__); groupSet = ncFile.getVars("varA_1",NcGroup::ParentsAndCurrent); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.29",__FILE__,__LINE__); groupSet = ncFile.getVars("varA0_2",NcGroup::ParentsAndCurrent); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.30",__FILE__,__LINE__); groupSet = ncFile.getVars("varB_3",NcGroup::ParentsAndCurrent); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.31",__FILE__,__LINE__); groupSet = ncFile.getVars("varC_5",NcGroup::ParentsAndCurrent); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.32",__FILE__,__LINE__); groupSet = ncFile.getVars("var_1",NcGroup::ChildrenAndCurrent); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.33",__FILE__,__LINE__); iter=groupSet.find(var_1); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.34",__FILE__,__LINE__); groupSet = ncFile.getVars("varA_1",NcGroup::ChildrenAndCurrent); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.35",__FILE__,__LINE__); iter=groupSet.find(varA_1); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.36",__FILE__,__LINE__); groupSet = ncFile.getVars("varA0_2",NcGroup::ChildrenAndCurrent); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.37",__FILE__,__LINE__); iter=groupSet.find(varA0_2); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.38",__FILE__,__LINE__); groupSet = ncFile.getVars("varB_3",NcGroup::ChildrenAndCurrent); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.39",__FILE__,__LINE__); iter=groupSet.find(varB_3); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.40",__FILE__,__LINE__); groupSet = ncFile.getVars("varC_5",NcGroup::ChildrenAndCurrent); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.41",__FILE__,__LINE__); iter=groupSet.find(varC_5); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.42",__FILE__,__LINE__); groupSet = ncFile.getVars("var_1",NcGroup::All); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.43",__FILE__,__LINE__); iter=groupSet.find(var_1); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.44",__FILE__,__LINE__); groupSet = ncFile.getVars("varA_1",NcGroup::All); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.45",__FILE__,__LINE__); iter=groupSet.find(varA_1); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.46",__FILE__,__LINE__); groupSet = ncFile.getVars("varA0_2",NcGroup::All); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.47",__FILE__,__LINE__); iter=groupSet.find(varA0_2); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.48",__FILE__,__LINE__); groupSet = ncFile.getVars("varB_3",NcGroup::All); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.49",__FILE__,__LINE__); iter=groupSet.find(varB_3); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.50",__FILE__,__LINE__); groupSet = ncFile.getVars("varC_5",NcGroup::All); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.51",__FILE__,__LINE__); iter=groupSet.find(varC_5); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.52",__FILE__,__LINE__); ////////////////// groupSet = groupA.getVars("var_1"); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.53",__FILE__,__LINE__); groupSet = groupA.getVars("varA_1"); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.54",__FILE__,__LINE__); iter=groupSet.find(varA_1); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.55",__FILE__,__LINE__); groupSet = groupA.getVars("varA0_2"); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.56",__FILE__,__LINE__); groupSet = groupA.getVars("varB_3"); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.57",__FILE__,__LINE__); groupSet = groupA.getVars("varC_5"); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.58",__FILE__,__LINE__); groupSet = groupA.getVars("var_1",NcGroup::Current); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.59",__FILE__,__LINE__); groupSet = groupA.getVars("varA_1",NcGroup::Current); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.60",__FILE__,__LINE__); iter=groupSet.find(varA_1); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.61",__FILE__,__LINE__); groupSet = groupA.getVars("varA0_2",NcGroup::Current); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.62",__FILE__,__LINE__); groupSet = groupA.getVars("varB_3",NcGroup::Current); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.63",__FILE__,__LINE__); groupSet = groupA.getVars("varC_5",NcGroup::Current); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.64",__FILE__,__LINE__); groupSet = groupA.getVars("var_1",NcGroup::Parents); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.65",__FILE__,__LINE__); iter=groupSet.find(var_1); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.66",__FILE__,__LINE__); groupSet = groupA.getVars("varA_1",NcGroup::Parents); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.67",__FILE__,__LINE__); groupSet = groupA.getVars("varA0_2",NcGroup::Parents); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.68",__FILE__,__LINE__); groupSet = groupA.getVars("varB_3",NcGroup::Parents); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.69",__FILE__,__LINE__); groupSet = groupA.getVars("varC_5",NcGroup::Parents); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.70",__FILE__,__LINE__); groupSet = groupA.getVars("var_1",NcGroup::Children); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.71",__FILE__,__LINE__); groupSet = groupA.getVars("varA_1",NcGroup::Children); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.72",__FILE__,__LINE__); groupSet = groupA.getVars("varA0_2",NcGroup::Children); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.73",__FILE__,__LINE__); groupSet = groupA.getVars("varB_3",NcGroup::Children); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.74",__FILE__,__LINE__); iter=groupSet.find(varB_3); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.75",__FILE__,__LINE__); groupSet = groupA.getVars("varC_5",NcGroup::Children); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.76",__FILE__,__LINE__); iter=groupSet.find(varC_5); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.77",__FILE__,__LINE__); groupSet = groupA.getVars("var_1",NcGroup::ParentsAndCurrent); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.78",__FILE__,__LINE__); iter=groupSet.find(var_1); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.79",__FILE__,__LINE__); groupSet = groupA.getVars("varA_1",NcGroup::ParentsAndCurrent); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.80",__FILE__,__LINE__); iter=groupSet.find(varA_1); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.82",__FILE__,__LINE__); groupSet = groupA.getVars("varA0_2",NcGroup::ParentsAndCurrent); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.83",__FILE__,__LINE__); groupSet = groupA.getVars("varB_3",NcGroup::ParentsAndCurrent); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.84",__FILE__,__LINE__); groupSet = groupA.getVars("varC_5",NcGroup::ParentsAndCurrent); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.85",__FILE__,__LINE__); groupSet = groupA.getVars("var_1",NcGroup::ChildrenAndCurrent); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.86",__FILE__,__LINE__); groupSet = groupA.getVars("varA_1",NcGroup::ChildrenAndCurrent); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.87",__FILE__,__LINE__); iter=groupSet.find(varA_1); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.88",__FILE__,__LINE__); groupSet = groupA.getVars("varA0_2",NcGroup::ChildrenAndCurrent); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.89",__FILE__,__LINE__); groupSet = groupA.getVars("varB_3",NcGroup::ChildrenAndCurrent); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.90",__FILE__,__LINE__); iter=groupSet.find(varB_3); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.91",__FILE__,__LINE__); groupSet = groupA.getVars("varC_5",NcGroup::ChildrenAndCurrent); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.92",__FILE__,__LINE__); iter=groupSet.find(varC_5); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.93",__FILE__,__LINE__); groupSet = groupA.getVars("var_1",NcGroup::All); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.94",__FILE__,__LINE__); iter=groupSet.find(var_1); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.95",__FILE__,__LINE__); groupSet = groupA.getVars("varA_1",NcGroup::All); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.96",__FILE__,__LINE__); iter=groupSet.find(varA_1); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.97",__FILE__,__LINE__); groupSet = groupA.getVars("varA0_2",NcGroup::All); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.98",__FILE__,__LINE__); groupSet = groupA.getVars("varB_3",NcGroup::All); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.99",__FILE__,__LINE__); iter=groupSet.find(varB_3); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.100",__FILE__,__LINE__); groupSet = groupA.getVars("varC_5",NcGroup::All); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.101",__FILE__,__LINE__); iter=groupSet.find(varC_5); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.102",__FILE__,__LINE__); ///////////// groupSet = groupA0.getVars("var_1"); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.103",__FILE__,__LINE__); groupSet = groupA0.getVars("varA_1"); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.104",__FILE__,__LINE__); groupSet = groupA0.getVars("varA0_2"); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.105",__FILE__,__LINE__); iter=groupSet.find(varA0_2); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.106",__FILE__,__LINE__); groupSet = groupA0.getVars("varB_3"); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.107",__FILE__,__LINE__); groupSet = groupA0.getVars("varC_5"); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.108",__FILE__,__LINE__); groupSet = groupA0.getVars("var_1",NcGroup::Current); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.109",__FILE__,__LINE__); groupSet = groupA0.getVars("varA_1",NcGroup::Current); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.110",__FILE__,__LINE__); groupSet = groupA0.getVars("varA0_2",NcGroup::Current); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.111",__FILE__,__LINE__); iter=groupSet.find(varA0_2); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.112",__FILE__,__LINE__); groupSet = groupA0.getVars("varB_3",NcGroup::Current); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.113",__FILE__,__LINE__); groupSet = groupA0.getVars("varC_5",NcGroup::Current); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.114",__FILE__,__LINE__); groupSet = groupA0.getVars("var_1",NcGroup::Parents); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.115",__FILE__,__LINE__); iter=groupSet.find(var_1); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.116",__FILE__,__LINE__); groupSet = groupA0.getVars("varA_1",NcGroup::Parents); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.117",__FILE__,__LINE__); groupSet = groupA0.getVars("varA0_2",NcGroup::Parents); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.118",__FILE__,__LINE__); groupSet = groupA0.getVars("varB_3",NcGroup::Parents); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.119",__FILE__,__LINE__); groupSet = groupA0.getVars("varC_5",NcGroup::Parents); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.120",__FILE__,__LINE__); groupSet = groupA0.getVars("var_1",NcGroup::Children); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.121",__FILE__,__LINE__); groupSet = groupA0.getVars("varA_1",NcGroup::Children); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.122",__FILE__,__LINE__); groupSet = groupA0.getVars("varA0_2",NcGroup::Children); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.123",__FILE__,__LINE__); groupSet = groupA0.getVars("varB_3",NcGroup::Children); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.124",__FILE__,__LINE__); groupSet = groupA0.getVars("varC_5",NcGroup::Children); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.125",__FILE__,__LINE__); groupSet = groupA0.getVars("var_1",NcGroup::ParentsAndCurrent); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.126",__FILE__,__LINE__); iter=groupSet.find(var_1); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.127",__FILE__,__LINE__); groupSet = groupA0.getVars("varA_1",NcGroup::ParentsAndCurrent); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.128",__FILE__,__LINE__); groupSet = groupA0.getVars("varA0_2",NcGroup::ParentsAndCurrent); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.129",__FILE__,__LINE__); iter=groupSet.find(varA0_2); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.130",__FILE__,__LINE__); groupSet = groupA0.getVars("varB_3",NcGroup::ParentsAndCurrent); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.131",__FILE__,__LINE__); groupSet = groupA0.getVars("varC_5",NcGroup::ParentsAndCurrent); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.132",__FILE__,__LINE__); groupSet = groupA0.getVars("var_1",NcGroup::ChildrenAndCurrent); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.133",__FILE__,__LINE__); groupSet = groupA0.getVars("varA_1",NcGroup::ChildrenAndCurrent); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.134",__FILE__,__LINE__); groupSet = groupA0.getVars("varA0_2",NcGroup::ChildrenAndCurrent); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.135",__FILE__,__LINE__); iter=groupSet.find(varA0_2); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.136",__FILE__,__LINE__); groupSet = groupA0.getVars("varB_3",NcGroup::ChildrenAndCurrent); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.137",__FILE__,__LINE__); groupSet = groupA0.getVars("varC_5",NcGroup::ChildrenAndCurrent); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.138",__FILE__,__LINE__); groupSet = groupA0.getVars("var_1",NcGroup::All); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.139",__FILE__,__LINE__); iter=groupSet.find(var_1); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.140",__FILE__,__LINE__); groupSet = groupA0.getVars("varA_1",NcGroup::All); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.141",__FILE__,__LINE__); groupSet = groupA0.getVars("varA0_2",NcGroup::All); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.142",__FILE__,__LINE__); iter=groupSet.find(varA0_2); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.143",__FILE__,__LINE__); groupSet = groupA0.getVars("varB_3",NcGroup::All); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.144",__FILE__,__LINE__); groupSet = groupA0.getVars("varC_5",NcGroup::All); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.145",__FILE__,__LINE__); ///////////// ///////////// groupSet = groupB.getVars("var_1"); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.146",__FILE__,__LINE__); groupSet = groupB.getVars("varA_1"); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.147",__FILE__,__LINE__); groupSet = groupB.getVars("varA0_2"); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.148",__FILE__,__LINE__); groupSet = groupB.getVars("varB_3"); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.149",__FILE__,__LINE__); iter=groupSet.find(varB_3); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.150",__FILE__,__LINE__); groupSet = groupB.getVars("varC_5"); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.151",__FILE__,__LINE__); groupSet = groupB.getVars("var_1",NcGroup::Current); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.152",__FILE__,__LINE__); groupSet = groupB.getVars("varA_1",NcGroup::Current); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.153",__FILE__,__LINE__); groupSet = groupB.getVars("varA0_2",NcGroup::Current); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.154",__FILE__,__LINE__); groupSet = groupB.getVars("varB_3",NcGroup::Current); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.155",__FILE__,__LINE__); iter=groupSet.find(varB_3); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.156",__FILE__,__LINE__); groupSet = groupB.getVars("varC_5",NcGroup::Current); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.157",__FILE__,__LINE__); groupSet = groupB.getVars("var_1",NcGroup::Parents); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.158",__FILE__,__LINE__); iter=groupSet.find(var_1); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.159",__FILE__,__LINE__); groupSet = groupB.getVars("varA_1",NcGroup::Parents); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.160",__FILE__,__LINE__); iter=groupSet.find(varA_1); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.161",__FILE__,__LINE__); groupSet = groupB.getVars("varA0_2",NcGroup::Parents); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.162",__FILE__,__LINE__); groupSet = groupB.getVars("varB_3",NcGroup::Parents); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.163",__FILE__,__LINE__); groupSet = groupB.getVars("varC_5",NcGroup::Parents); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.164",__FILE__,__LINE__); groupSet = groupB.getVars("var_1",NcGroup::Children); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.165",__FILE__,__LINE__); groupSet = groupB.getVars("varA_1",NcGroup::Children); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.166",__FILE__,__LINE__); groupSet = groupB.getVars("varA0_2",NcGroup::Children); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.167",__FILE__,__LINE__); groupSet = groupB.getVars("varB_3",NcGroup::Children); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.168",__FILE__,__LINE__); groupSet = groupB.getVars("varC_5",NcGroup::Children); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.169",__FILE__,__LINE__); groupSet = groupB.getVars("var_1",NcGroup::ParentsAndCurrent); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.170",__FILE__,__LINE__); iter=groupSet.find(var_1); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.171",__FILE__,__LINE__); groupSet = groupB.getVars("varA_1",NcGroup::ParentsAndCurrent); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.172",__FILE__,__LINE__); iter=groupSet.find(varA_1); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.173",__FILE__,__LINE__); groupSet = groupB.getVars("varA0_2",NcGroup::ParentsAndCurrent); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.174",__FILE__,__LINE__); groupSet = groupB.getVars("varB_3",NcGroup::ParentsAndCurrent); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.175",__FILE__,__LINE__); iter=groupSet.find(varB_3); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.176",__FILE__,__LINE__); groupSet = groupB.getVars("varC_5",NcGroup::ParentsAndCurrent); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.177",__FILE__,__LINE__); groupSet = groupB.getVars("var_1",NcGroup::ChildrenAndCurrent); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.178",__FILE__,__LINE__); groupSet = groupB.getVars("varA_1",NcGroup::ChildrenAndCurrent); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.179",__FILE__,__LINE__); groupSet = groupB.getVars("varA0_2",NcGroup::ChildrenAndCurrent); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.180",__FILE__,__LINE__); groupSet = groupB.getVars("varB_3",NcGroup::ChildrenAndCurrent); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.181",__FILE__,__LINE__); iter=groupSet.find(varB_3); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.182",__FILE__,__LINE__); groupSet = groupB.getVars("varC_5",NcGroup::ChildrenAndCurrent); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.183",__FILE__,__LINE__); groupSet = groupB.getVars("var_1",NcGroup::All); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.184",__FILE__,__LINE__); iter=groupSet.find(var_1); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.185",__FILE__,__LINE__); groupSet = groupB.getVars("varA_1",NcGroup::All); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.186",__FILE__,__LINE__); iter=groupSet.find(varA_1); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.187",__FILE__,__LINE__); groupSet = groupB.getVars("varA0_2",NcGroup::All); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.188",__FILE__,__LINE__); groupSet = groupB.getVars("varB_3",NcGroup::All); if(groupSet.size() != 1) throw NcException("NcException","Error in test 7.189",__FILE__,__LINE__); iter=groupSet.find(varB_3); if( iter == groupSet.end()) throw NcException("NcException","Error in test 7.190",__FILE__,__LINE__); groupSet = groupB.getVars("varC_5",NcGroup::All); if(groupSet.size() != 0) throw NcException("NcException","Error in test 7.191",__FILE__,__LINE__); cout <<" ----------- passed\n"; } } } catch (NcException& e) { cout << "unknown error"<