Skip to content
This repository was archived by the owner on Jul 8, 2022. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cpp_test_suite/asyn/asyn_attr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ int main(int argc, char **argv)
catch (CommunicationFailed &e)
{
finish = true;
if (strcmp(e.errors[1].reason,"API_DeviceTimedOut") == 0)
if (strcmp(e.errors[1].reason,API_DeviceTimedOut) == 0)
{
to = true;
coutv << "Timeout exception" << std::endl;
Expand Down Expand Up @@ -241,7 +241,7 @@ int main(int argc, char **argv)
catch (CommunicationFailed &e)
{
finish = true;
if (strcmp(e.errors[1].reason,"API_DeviceTimedOut") == 0)
if (strcmp(e.errors[1].reason,API_DeviceTimedOut) == 0)
{
to = true;
coutv << "Timeout exception" << std::endl;
Expand Down Expand Up @@ -270,7 +270,7 @@ int main(int argc, char **argv)
}
catch (CommunicationFailed &e)
{
if (strcmp(e.errors[1].reason,"API_DeviceTimedOut") == 0)
if (strcmp(e.errors[1].reason,API_DeviceTimedOut) == 0)
{
to = true;
coutv << "Timeout exception" << std::endl;
Expand Down
4 changes: 2 additions & 2 deletions cpp_test_suite/asyn/asyn_attr_cb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void MyCallBack::attr_read(AttrReadEvent *att)
catch (DevFailed &e)
{
long nb_err = e.errors.length();
if (strcmp(e.errors[nb_err - 1].reason,"API_AttributeFailed") == 0)
if (strcmp(e.errors[nb_err - 1].reason,API_AttributeFailed) == 0)
{
attr_failed = true;
coutv << "Read attributes failed error" << std::endl;
Expand All @@ -63,7 +63,7 @@ void MyCallBack::attr_read(AttrReadEvent *att)
coutv << "error[" << i << "].reason = " << att->errors[i].reason << std::endl;

attr_failed = true;
if (strcmp(att->errors[nb_err - 1].reason,"API_DeviceTimedOut") == 0)
if (strcmp(att->errors[nb_err - 1].reason,API_DeviceTimedOut) == 0)
{
to = true;
coutv << "Timeout error" << std::endl;
Expand Down
6 changes: 3 additions & 3 deletions cpp_test_suite/asyn/asyn_attr_multi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ int main(int argc, char **argv)
catch (CommunicationFailed &e)
{
finish = true;
if (strcmp(e.errors[1].reason,"API_DeviceTimedOut") == 0)
if (strcmp(e.errors[1].reason,API_DeviceTimedOut) == 0)
{
to = true;
coutv << "Timeout exception" << std::endl;
Expand Down Expand Up @@ -219,7 +219,7 @@ int main(int argc, char **argv)
catch (CommunicationFailed &e)
{
finish = true;
if (strcmp(e.errors[1].reason,"API_DeviceTimedOut") == 0)
if (strcmp(e.errors[1].reason,API_DeviceTimedOut) == 0)
{
to = true;
coutv << "Timeout exception" << std::endl;
Expand Down Expand Up @@ -248,7 +248,7 @@ int main(int argc, char **argv)
}
catch (CommunicationFailed &e)
{
if (strcmp(e.errors[1].reason,"API_DeviceTimedOut") == 0)
if (strcmp(e.errors[1].reason,API_DeviceTimedOut) == 0)
{
to = true;
coutv << "Timeout exception" << std::endl;
Expand Down
4 changes: 2 additions & 2 deletions cpp_test_suite/asyn/asyn_cb_cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ void MyCallBack::cmd_ended(CmdDoneEvent *cmd)
coutv << "error length = " << nb_err << std::endl;
for (int i = 0;i < nb_err;i++)
coutv << "error[" << i << "].reason = " << cmd->errors[i].reason << std::endl;
if (strcmp(cmd->errors[nb_err - 1].reason,"API_DeviceTimedOut") == 0)
if (strcmp(cmd->errors[nb_err - 1].reason,API_DeviceTimedOut) == 0)
{
to = true;
coutv << "Timeout error" << std::endl;
}
else if (strcmp(cmd->errors[nb_err - 1].reason,"API_CommandFailed") == 0)
else if (strcmp(cmd->errors[nb_err - 1].reason,API_CommandFailed) == 0)
{
cmd_failed = true;
coutv << "Command failed error" << std::endl;
Expand Down
6 changes: 3 additions & 3 deletions cpp_test_suite/asyn/asyn_cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ int main(int argc, char **argv)
catch (CommunicationFailed &e)
{
finish = true;
if (strcmp(e.errors[1].reason,"API_DeviceTimedOut") == 0)
if (strcmp(e.errors[1].reason,API_DeviceTimedOut) == 0)
{
to = true;
coutv << "Timeout exception" << std::endl;
Expand Down Expand Up @@ -203,7 +203,7 @@ int main(int argc, char **argv)
catch (CommunicationFailed &e)
{
finish = true;
if (strcmp(e.errors[1].reason,"API_DeviceTimedOut") == 0)
if (strcmp(e.errors[1].reason,API_DeviceTimedOut) == 0)
{
to = true;
coutv << "Timeout exception" << std::endl;
Expand Down Expand Up @@ -232,7 +232,7 @@ int main(int argc, char **argv)
}
catch (CommunicationFailed &e)
{
if (strcmp(e.errors[1].reason,"API_DeviceTimedOut") == 0)
if (strcmp(e.errors[1].reason,API_DeviceTimedOut) == 0)
{
to = true;
coutv << "Timeout exception" << std::endl;
Expand Down
6 changes: 3 additions & 3 deletions cpp_test_suite/asyn/asyn_write_attr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ int main(int argc, char **argv)
catch (CommunicationFailed &e)
{
finish = true;
if (strcmp(e.errors[1].reason,"API_DeviceTimedOut") == 0)
if (strcmp(e.errors[1].reason,API_DeviceTimedOut) == 0)
{
to = true;
coutv << "Timeout exception" << std::endl;
Expand Down Expand Up @@ -233,7 +233,7 @@ int main(int argc, char **argv)
catch (CommunicationFailed &e)
{
finish = true;
if (strcmp(e.errors[1].reason,"API_DeviceTimedOut") == 0)
if (strcmp(e.errors[1].reason,API_DeviceTimedOut) == 0)
{
to = true;
coutv << "Timeout exception" << std::endl;
Expand Down Expand Up @@ -261,7 +261,7 @@ int main(int argc, char **argv)
}
catch (CommunicationFailed &e)
{
if (strcmp(e.errors[1].reason,"API_DeviceTimedOut") == 0)
if (strcmp(e.errors[1].reason,API_DeviceTimedOut) == 0)
{
to = true;
coutv << "Timeout exception" << std::endl;
Expand Down
6 changes: 3 additions & 3 deletions cpp_test_suite/asyn/asyn_write_attr_multi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ int main(int argc, char **argv)
catch (CommunicationFailed &e)
{
finish = true;
if (strcmp(e.errors[1].reason,"API_DeviceTimedOut") == 0)
if (strcmp(e.errors[1].reason,API_DeviceTimedOut) == 0)
{
to = true;
coutv << "Timeout exception" << std::endl;
Expand Down Expand Up @@ -203,7 +203,7 @@ int main(int argc, char **argv)
catch (CommunicationFailed &e)
{
finish = true;
if (strcmp(e.errors[1].reason,"API_DeviceTimedOut") == 0)
if (strcmp(e.errors[1].reason,API_DeviceTimedOut) == 0)
{
to = true;
coutv << "Timeout exception" << std::endl;
Expand Down Expand Up @@ -231,7 +231,7 @@ int main(int argc, char **argv)
}
catch (CommunicationFailed &e)
{
if (strcmp(e.errors[1].reason,"API_DeviceTimedOut") == 0)
if (strcmp(e.errors[1].reason,API_DeviceTimedOut) == 0)
{
to = true;
coutv << "Timeout exception" << std::endl;
Expand Down
6 changes: 3 additions & 3 deletions cpp_test_suite/asyn/asyn_write_cb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ void MyCallBack::attr_written(AttrWrittenEvent *att)
coutv << "error length = " << nb_err << std::endl;
for (int i = 0;i < nb_err;i++)
coutv << "error[" << i << "].reason = " << att->errors.errors[i].reason << std::endl;
if (strcmp(att->errors.errors[nb_err - 1].reason,"API_DeviceTimedOut") == 0)
if (strcmp(att->errors.errors[nb_err - 1].reason,API_DeviceTimedOut) == 0)
{
to = true;
coutv << "Timeout error" << std::endl;
}
else if (strcmp(att->errors.errors[nb_err - 1].reason,"API_AttributeFailed") == 0)
else if (strcmp(att->errors.errors[nb_err - 1].reason,API_AttributeFailed) == 0)
{
attr_failed = true;
coutv << "Write attributes failed error" << std::endl;
Expand All @@ -58,7 +58,7 @@ void MyCallBack::attr_written(AttrWrittenEvent *att)
{
if (faulty_attr_nb != 0)
{
if (strcmp(att->errors.errors[0].reason,"API_AttributeFailed") == 0)
if (strcmp(att->errors.errors[0].reason,API_AttributeFailed) == 0)
{
if ((strcmp(att->errors.err_list[0].err_stack[0].reason,"aaa") == 0) &&
(att->errors.err_list[0].idx_in_call == 0) &&
Expand Down
10 changes: 5 additions & 5 deletions cpp_test_suite/asyn/auto_asyn_cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ void MyCallBack::cmd_ended(CmdDoneEvent *cmd)
coutv << "error length = " << nb_err << std::endl;
for (int i = 0;i < nb_err;i++)
coutv << "error[" << i << "].reason = " << cmd->errors[i].reason.in() << std::endl;
if (strcmp(cmd->errors[nb_err - 1].reason,"API_DeviceTimedOut") == 0)
if (strcmp(cmd->errors[nb_err - 1].reason,API_DeviceTimedOut) == 0)
{
to = true;
coutv << "Timeout error" << std::endl;
}
else if (strcmp(cmd->errors[nb_err - 1].reason,"API_CommandFailed") == 0)
else if (strcmp(cmd->errors[nb_err - 1].reason,API_CommandFailed) == 0)
{
cmd_failed = true;
coutv << "Command failed error" << std::endl;
Expand Down Expand Up @@ -87,12 +87,12 @@ void MyCallBack::attr_read(AttrReadEvent *att)
coutv << "error length = " << nb_err << std::endl;
for (int i = 0;i < nb_err;i++)
coutv << "error[" << i << "].reason = " << att->errors[i].reason.in() << std::endl;
if (strcmp(att->errors[nb_err - 1].reason,"API_DeviceTimedOut") == 0)
if (strcmp(att->errors[nb_err - 1].reason,API_DeviceTimedOut) == 0)
{
to = true;
coutv << "Timeout error" << std::endl;
}
else if (strcmp(att->errors[nb_err - 1].reason,"API_AttributeFailed") == 0)
else if (strcmp(att->errors[nb_err - 1].reason,API_AttributeFailed) == 0)
{
attr_failed = true;
coutv << "Read attributes failed error" << std::endl;
Expand Down Expand Up @@ -120,7 +120,7 @@ void MyCallBack::attr_written(AttrWrittenEvent *att)
coutv << "error length = " << nb_err << std::endl;
for (long i = 0;i < nb_err;i++)
coutv << "error[" << i << "].reason = " << att->errors.err_list[i].err_stack[0].reason.in() << std::endl;
if (strcmp(att->errors.err_list[nb_err - 1].err_stack[0].reason.in(),"API_DeviceTimedOut") == 0)
if (strcmp(att->errors.err_list[nb_err - 1].err_stack[0].reason.in(),API_DeviceTimedOut) == 0)
{
to = true;
coutv << "Timeout error" << std::endl;
Expand Down
43 changes: 13 additions & 30 deletions cpp_test_suite/cpp_test_ds/DevTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ Tango::DevLong DevTest::IOSubscribeEvent(const Tango::DevVarStringArray *in_data
{
std::stringstream ss;
ss << "Event type " << (*in_data)[2] << " not recognized as a valid event type";
Tango::Except::throw_exception("DevTest_WrongEventType",ss.str(),"DevTest::IOSubscribeEvent");
TANGO_THROW_EXCEPTION("DevTest_WrongEventType", ss.str());
}

int eve_id = remote_dev->subscribe_event(att_name,eve,&cb,filters);
Expand All @@ -390,9 +390,7 @@ void DevTest::IOUnSubscribeEvent(Tango::DevLong &in_data)
std::map<int,std::string>::iterator ite = event_atts.find(in_data);
if (ite == event_atts.end())
{
Tango::Except::throw_exception("DevTest_WrongEventID",
"Cant find event id in map",
"DevTest::IOUnSubscribeEvent");
TANGO_THROW_EXCEPTION("DevTest_WrongEventID", "Cant find event id in map");
}
remote_dev->unsubscribe_event(in_data);

Expand Down Expand Up @@ -819,7 +817,7 @@ void DevTest::write_Short_attr_w(Tango::WAttribute &att)
att.get_write_value(sh);
// cout << "Attribute value = " << sh << std::endl;
if (Short_attr_w_except == true)
Tango::Except::throw_exception("Aaaa","Bbbb","Cccc");
TANGO_THROW_EXCEPTION("Aaaa", "Bbbb");
}

void DevTest::write_Short_attr_w2(Tango::WAttribute &att)
Expand Down Expand Up @@ -904,9 +902,7 @@ void DevTest::write_attr_asyn_write_except(Tango::WAttribute &att)
att.get_write_value(lg);
cout << "Attribute value = " << lg << std::endl;
Tango_sleep(2);
Tango::Except::throw_exception((const char *)"aaa",
(const char *)"This is a test",
(const char *)"DevTest::write_attr_hardware");
TANGO_THROW_EXCEPTION("aaa", "This is a test");
}

void DevTest::write_String_spec_attr_w(Tango::WAttribute &att)
Expand Down Expand Up @@ -1245,7 +1241,7 @@ void DevTest::write_attr_hardware(std::vector<long> &att_idx)
break;

case 1:
Tango::Except::throw_exception("DevTest_WriteAttrHardware","DevFailed from write_attr_hardware","DevTest::write_attr_hardware");
TANGO_THROW_EXCEPTION("DevTest_WriteAttrHardware", "DevFailed from write_attr_hardware");
break;

case 2:
Expand Down Expand Up @@ -1279,9 +1275,7 @@ void DevTest::read_Short_attr(Tango::Attribute &att)
}
else
{
Tango::Except::throw_exception((const char *)"aaa",
(const char *)"This is a test",
(const char *)"DevTest::read_attr");
TANGO_THROW_EXCEPTION("aaa", "This is a test");
}
}

Expand All @@ -1290,10 +1284,7 @@ void DevTest::read_Long_attr(Tango::Attribute &att)
cout << "[DevTest::read_attr] attribute name Long_attr" << std::endl;
if (Long_attr_except)
{
Tango::Except::throw_exception(
"Long_attr_except",
"Test exception is enabled for this attribute",
"DevTest::read_Long_attr");
TANGO_THROW_EXCEPTION("Long_attr_except", "Test exception is enabled for this attribute");
}
att.set_value(&attr_long);
}
Expand Down Expand Up @@ -1510,9 +1501,7 @@ void DevTest::read_attr_asyn_except(TANGO_UNUSED(Tango::Attribute &att))
Tango_sleep(2);
cout << "Leaving reading attr_asyn_except attribute" << std::endl;

Tango::Except::throw_exception((const char *)"aaa",
(const char *)"This is a test",
(const char *)"DevTest::read_attr");
TANGO_THROW_EXCEPTION("aaa", "This is a test");
}

void DevTest::read_PollLong_attr(Tango::Attribute &att)
Expand Down Expand Up @@ -1544,11 +1533,11 @@ void DevTest::read_PollString_spec_attr(Tango::Attribute &att)
}
else if ((PollString_spec_attr_num % 4) == 2)
{
Tango::Except::throw_exception((const char *)"aaaa",(const char *)"bbb",(const char *)"ccc");
TANGO_THROW_EXCEPTION("aaaa", "bbb");
}
else
{
Tango::Except::throw_exception((const char *)"xxx",(const char *)"yyy",(const char *)"zzz");
TANGO_THROW_EXCEPTION("xxx", "yyy");
}

// att.set_value(attr_str_array, 2);
Expand Down Expand Up @@ -1675,9 +1664,7 @@ void DevTest::read_Event_change_tst(Tango::Attribute &att)
}
else
{
Tango::Except::throw_exception((const char *)"bbb",
(const char *)"This is a test",
(const char *)"DevTest::read_attr");
TANGO_THROW_EXCEPTION("bbb", "This is a test");
}
}

Expand All @@ -1690,9 +1677,7 @@ void DevTest::read_Event64_change_tst(Tango::Attribute &att)
}
else
{
Tango::Except::throw_exception((const char *)"bbb64",
(const char *)"This is a test",
(const char *)"DevTest::read_attr");
TANGO_THROW_EXCEPTION("bbb64", "This is a test");
}
}
void DevTest::read_Event_quality_tst(Tango::Attribute &att)
Expand All @@ -1706,9 +1691,7 @@ void DevTest::read_Event_quality_tst(Tango::Attribute &att)
}
else
{
Tango::Except::throw_exception((const char *)"ccc",
(const char *)"This is a test",
(const char *)"DevTest::read_attr");
TANGO_THROW_EXCEPTION("ccc", "This is a test");
}
}

Expand Down
4 changes: 1 addition & 3 deletions cpp_test_suite/cpp_test_ds/IOMisc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,9 +422,7 @@ CORBA::Any *IOSleepExcept::execute(TANGO_UNUSED(Tango::DeviceImpl *device), cons

Tango_sleep(in);

Tango::Except::throw_exception((const char *)"aaa",
(const char *)"This is a test ",
(const char *)"IOSleepExcept::execute()");
TANGO_THROW_EXCEPTION("aaa", "This is a test ");

return insert();
}
Expand Down
2 changes: 1 addition & 1 deletion cpp_test_suite/cpp_test_ds/IOStr1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ CORBA::Any *IOPollStr1::execute(TANGO_UNUSED(Tango::DeviceImpl *device),TANGO_UN
else
{
delete [] argout;
Tango::Except::throw_exception((const char*)"qqq",(const char *)"www",(const char *)"eee");
TANGO_THROW_EXCEPTION("qqq", "www");
}

return insert(argout);
Expand Down
Loading