Commit fe816f21 authored by Lennart Bucher's avatar Lennart Bucher
Browse files

udjusting the expectation for the generated code

parent 8337a0ef
Pipeline #186229 passed with stages
in 2 minutes and 11 seconds
......@@ -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 <= 0){
if(0 <= counter && counter <= 1-1){
(component->in1)(i0, i1-0) = msg->data[counter];
}
else if(0 > counter){
(component->in1)(i0, i1+0-0+1) = 0;
(component->in1)(i0, i1+1-1-0+1) = 0;
}
else{
(component->in1)(i0, i1) = 0;
......@@ -66,11 +66,11 @@ class RosAdapter_tests_structs_arrayHandlingComp: public IAdapter_tests_structs_
int counter = 0;
for(int i0 = 0; i0 < 4; i0++){
for(int i1 = 0; i1 < 4; i1++){
if(0 <= counter && counter <= 3){
if(0 <= counter && counter <= 4-1){
(component->in2)(i0, i1) = msg->data[counter] != 0;
}
else if(0 > counter){
(component->in2)(i0, i1+3-0+1) = 0;
(component->in2)(i0, i1+4-1-0+1) = 0;
}
else{
(component->in2)(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 <= 9){
if(0 <= counter && counter <= 10-1){
(component->in3)(i0, i1-0) = msg->poses[counter].pose.orientation.x;
}
else if(0 > counter){
(component->in3)(i0, i1+9-0+1) = 0;
(component->in3)(i0, i1+10-1-0+1) = 0;
}
else{
(component->in3)(i0, i1) = 0;
......
......@@ -16,7 +16,7 @@ class RosAdapter_test_basicGenericInstance_basicGeneric: public IAdapter_test_ba
RosAdapter_test_basicGenericInstance_basicGeneric(){
}
void init(test_basicGenericInstance_basicGeneric* comp){
this->component = comp;
char* tmp = strdup("");
......@@ -30,17 +30,28 @@ class RosAdapter_test_basicGenericInstance_basicGeneric: public IAdapter_test_ba
ros::spin();
}
void _name1Callback(const std_msgs::Float64MultiArray::ConstPtr& msg){
int counter = 0;
for(int i0 = 0; i0 < n; i0++){
for(int i1 = 0; i1 < n; i1++){
(component->mat1)(i0, i1) = msg->data[counter];
counter++;
}
}
}
void _name1Callback(const std_msgs::Float64MultiArray::ConstPtr& msg){
int counter = 0;
for(int i0 = 0; i0 < n; i0++){
for(int i1 = 0; i1 < n; i1++){
if(0 <= counter && counter <= n-1){
(component->mat1)(i0, i1) = msg->data[counter];
}
else if(0 > counter){
(component->mat1)(i0, i1+n-1-0+1) = 0;
}
else{
(component->mat1)(i0, i1) = 0;
}
counter++;
}
}
}
void publish_name1Publisher(){
std_msgs::Float64MultiArray tmpMsg;
tmpMsg.data.resize(n * n);
......
......@@ -41,11 +41,11 @@ class RosAdapter_tests_structs_matrixTypesComp: public IAdapter_tests_structs_ma
int counter = 0;
for(int i0 = 0; i0 < 3; i0++){
for(int i1 = 0; i1 < 1; i1++){
if(0 <= counter && counter <= 0){
if(0 <= counter && counter <= 1-1){
(component->in1)(i0, i1) = msg->data[counter];
}
else if(0 > counter){
(component->in1)(i0, i1+0-0+1) = 0;
(component->in1)(i0, i1+1-1-0+1) = 0;
}
else{
(component->in1)(i0, i1) = 0;
......@@ -61,11 +61,11 @@ class RosAdapter_tests_structs_matrixTypesComp: public IAdapter_tests_structs_ma
int counter = 0;
for(int i0 = 0; i0 < 4; i0++){
for(int i1 = 0; i1 < 4; i1++){
if(0 <= counter && counter <= 3){
if(0 <= counter && counter <= 4-1){
(component->in2)(i0, i1) = msg->data[counter] != 0;
}
else if(0 > counter){
(component->in2)(i0, i1+3-0+1) = 0;
(component->in2)(i0, i1+4-1-0+1) = 0;
}
else{
(component->in2)(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