|
|
@@ -31,30 +31,35 @@ TEST(CipConnectionObject, StateConfiguring) {
|
|
|
ConnectionObjectState state = GetConnectionObjectState(&connection_object);
|
|
|
CHECK_EQUAL(kConnectionObjectStateConfiguring, state);
|
|
|
}
|
|
|
+
|
|
|
TEST(CipConnectionObject, StateWaitingForConnectionID) {
|
|
|
CipConnectionObject connection_object = { 0 };
|
|
|
connection_object.state = 2;
|
|
|
ConnectionObjectState state = GetConnectionObjectState(&connection_object);
|
|
|
CHECK_EQUAL(kConnectionObjectStateWaitingForConnectionID, state);
|
|
|
}
|
|
|
+
|
|
|
TEST(CipConnectionObject, StateEstablished) {
|
|
|
CipConnectionObject connection_object = { 0 };
|
|
|
connection_object.state = 3;
|
|
|
ConnectionObjectState state = GetConnectionObjectState(&connection_object);
|
|
|
CHECK_EQUAL(kConnectionObjectStateEstablished, state);
|
|
|
}
|
|
|
+
|
|
|
TEST(CipConnectionObject, StateTimedOut) {
|
|
|
CipConnectionObject connection_object = { 0 };
|
|
|
connection_object.state = 4;
|
|
|
ConnectionObjectState state = GetConnectionObjectState(&connection_object);
|
|
|
CHECK_EQUAL(kConnectionObjectStateTimedOut, state);
|
|
|
}
|
|
|
+
|
|
|
TEST(CipConnectionObject, StateDeferredDelete) {
|
|
|
CipConnectionObject connection_object = { 0 };
|
|
|
connection_object.state = 5;
|
|
|
ConnectionObjectState state = GetConnectionObjectState(&connection_object);
|
|
|
CHECK_EQUAL(kConnectionObjectStateDeferredDelete, state);
|
|
|
}
|
|
|
+
|
|
|
TEST(CipConnectionObject, StateClosing) {
|
|
|
CipConnectionObject connection_object = { 0 };
|
|
|
connection_object.state = 6;
|
|
|
@@ -62,3 +67,37 @@ TEST(CipConnectionObject, StateClosing) {
|
|
|
CHECK_EQUAL(kConnectionObjectStateClosing, state);
|
|
|
}
|
|
|
|
|
|
+TEST(CipConnectionObject, StateInvalid) {
|
|
|
+ CipConnectionObject connection_object = { 0 };
|
|
|
+ connection_object.state = 7;
|
|
|
+ ConnectionObjectState state = GetConnectionObjectState(&connection_object);
|
|
|
+ CHECK_EQUAL(kConnectionObjectStateInvalid, state);
|
|
|
+}
|
|
|
+
|
|
|
+TEST(CipConnectionObject, InstanceTypeInvalid) {
|
|
|
+ CipConnectionObject connection_object = { 0 };
|
|
|
+ connection_object.instance_type = 4;
|
|
|
+ ConnectionObjectInstanceType type = GetConnectionObjectInstanceType(&connection_object);
|
|
|
+ CHECK_EQUAL(kConnectionObjectInstanceTypeInvalid, type);
|
|
|
+}
|
|
|
+
|
|
|
+TEST(CipConnectionObject, InstanceTypeIExplicitMessaging) {
|
|
|
+ CipConnectionObject connection_object = { 0 };
|
|
|
+ connection_object.instance_type = 0;
|
|
|
+ ConnectionObjectInstanceType type = GetConnectionObjectInstanceType(&connection_object);
|
|
|
+ CHECK_EQUAL(kConnectionObjectInstanceTypeExplicitMessaging, type);
|
|
|
+}
|
|
|
+
|
|
|
+TEST(CipConnectionObject, InstanceTypeIO) {
|
|
|
+ CipConnectionObject connection_object = { 0 };
|
|
|
+ connection_object.instance_type = 1;
|
|
|
+ ConnectionObjectInstanceType type = GetConnectionObjectInstanceType(&connection_object);
|
|
|
+ CHECK_EQUAL(kConnectionObjectInstanceTypeIO, type);
|
|
|
+}
|
|
|
+
|
|
|
+TEST(CipConnectionObject, InstanceTypeCipBridged) {
|
|
|
+ CipConnectionObject connection_object = { 0 };
|
|
|
+ connection_object.instance_type = 2;
|
|
|
+ ConnectionObjectInstanceType type = GetConnectionObjectInstanceType(&connection_object);
|
|
|
+ CHECK_EQUAL(kConnectionObjectInstanceTypeCipBridged, type);
|
|
|
+}
|