Ticket #364 (closed defect: fixed)
MgDataPropertyDefinition::Length ,GetLength() and SetLength() can be assigned to with a negative value;
| Reported by: | jessicacao | Owned by: | Tom Fukushima |
|---|---|---|---|
| Priority: | medium | Milestone: | 2.0 |
| Component: | General | Version: | |
| Severity: | major | Keywords: | MgDataPropertyDefinition::SetLength |
| Cc: | Trevor Wekel | External ID: | 985014, 1044251 |
Description
MgDataPropertyDefinition::Length ,GetLength?() and SetLength?() can be assigned to with a negative value;
1. Construct an instance of MgDataPropertyDefinition? using the following code
MgDataPropertyDefinition? dataPropDefinition = new MgDataPropertyDefinition?("dataPropDefinition");
2. Assigned a negative value to Length and use method GetLength? to return the value
dataPropDefinition.Length = -10; Assert.AreEqual?(-10, dataPropDefinition.GetLength?());
3. Use the method SetLength? to set a negative value, and use Length to return the value
dataPropDefinition.SetLength?(-23);
Assert.AreEqual?(-23, dataPropDefinition.Length);
Sample code:
MgDataPropertyDefinition? dataPropDefinition = new MgDataPropertyDefinition?("dataPropDefinition");
dataPropDefinition.Length = -10;
Assert.AreEqual?(-10, dataPropDefinition.Length);
Assert.AreEqual?(-10, dataPropDefinition.GetLength?());
dataPropDefinition.SetLength?(-23);
Assert.AreEqual?(-23 dataPropDefinition.Length);
Assert.AreEqual?(-23, dataPropDefinition.GetLength?());
