Skip to content
This repository was archived by the owner on Jul 8, 2022. It is now read-only.

Commit d5de343

Browse files
mliszczbourtemb
authored andcommitted
Update test for exception in reading alarmed attr
If attribute was in ALARM state (e.g. due to max_value being exceeded) and reading started to fail, the attribute should not impact Device state any more (Device stays ON). If later reading starts to work again, the Device shall also switch to ALARM state.
1 parent 6db0d9d commit d5de343

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

cpp_test_suite/new_tests/cxx_attr_misc.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,6 +1030,13 @@ cout << "status = " << status << endl;
10301030
TS_ASSERT(strcmp(status,"The device is in ON state.") == 0);
10311031
}
10321032

1033+
void set_Long_attr_value(DevLong value)
1034+
{
1035+
DeviceData input;
1036+
input << value;
1037+
TS_ASSERT_THROWS_NOTHING(device1->command_inout("IOSetAttr", input));
1038+
}
1039+
10331040
void set_attribute_exception_flag(short attribute_disc, bool enabled)
10341041
{
10351042
std::vector<short> flags(2);
@@ -1062,14 +1069,16 @@ cout << "status = " << status << endl;
10621069
{
10631070
const short EXCEPTION_IN_Long_attr = 5;
10641071

1065-
assert_dev_state(Tango::ON);
1072+
set_Long_attr_value(2000);
1073+
assert_dev_state(Tango::ALARM);
10661074

10671075
set_attribute_exception_flag(EXCEPTION_IN_Long_attr, true);
1068-
10691076
assert_dev_state(Tango::ON);
10701077

10711078
set_attribute_exception_flag(EXCEPTION_IN_Long_attr, false);
1079+
assert_dev_state(Tango::ALARM);
10721080

1081+
set_Long_attr_value(1200);
10731082
assert_dev_state(Tango::ON);
10741083
}
10751084

0 commit comments

Comments
 (0)