Commit aea56c78 authored by Sascha Dewes's avatar Sascha Dewes
Browse files

Changed upperBound in case [:] is used to define bounds to match the behavior...

Changed upperBound in case [:] is used to define bounds to match the behavior in the case where the boundary symbols are missing entirely (i.e. copy the entire array as no limit was specified)
parent 4529acaf
Pipeline #346949 passed with stage
in 58 seconds
......@@ -91,7 +91,7 @@ public class SetStructPortInstruction{
//extract bounds from msgField
lowerBound = boundExists ? split[0].replaceAll("[^0-9]", "")+"-1" : "0";
boundExists = !split[1].replaceAll("[^0-9]", "").isEmpty() && !split[1].replaceAll("[^0-9]", "").equals("0"); //0 is not a valid bound in EMAM;
upperBound = boundExists ? split[1].replaceAll("[^0-9]", "")+"-1" : dimSizes.get(dimSizes.size()-1)+"-1";
upperBound = boundExists ? split[1].replaceAll("[^0-9]", "")+"-1" : "msg->data.size()-1";
} else { //no bounds given
lowerBound = "0";
upperBound = "msg->data.size()-1";
......
......@@ -46,11 +46,11 @@ class RosAdapter_tests_structs_arrayHandlingComp: public IAdapter_tests_structs_
int counter = 0;
for(int i0 = 0; i0 < 3; i0++){
for(int i1 = 0; i1 < 1; i1++){
if(0 <= counter && counter <= 1-1){
if(0 <= counter && counter <= msg->data.size()-1){
(component->in1)(i0, i1-0) = msg->data[counter];
}
else if(0 > counter){
(component->in1)(i0, i1+1-1-0+1) = 0;
(component->in1)(i0, i1+msg->data.size()-1-0+1) = 0;
}
else{
(component->in1)(i0, i1) = 0;
......@@ -86,11 +86,11 @@ class RosAdapter_tests_structs_arrayHandlingComp: public IAdapter_tests_structs_
int counter = 0;
for(int i0 = 0; i0 < 1; i0++){
for(int i1 = 0; i1 < 10; i1++){
if(0 <= counter && counter <= 10-1){
if(0 <= counter && counter <= msg->data.size()-1){
(component->in3)(i0, i1-0) = msg->poses[counter].pose.orientation.x;
}
else if(0 > counter){
(component->in3)(i0, i1+10-1-0+1) = 0;
(component->in3)(i0, i1+msg->data.size()-1-0+1) = 0;
}
else{
(component->in3)(i0, i1) = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment