Skip to content

Commit 7b2e34d

Browse files
committed
Fix test
1 parent 57b686d commit 7b2e34d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/execution_from_ssp_custom_algo_test.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,12 @@ int main()
6868
if (rc < 0) { goto Lerror; }
6969

7070
char name[SLAVE_NAME_MAX_SIZE];
71+
int found_slave = 0;
7172
for (size_t i = 0; i < numSlaves; i++) {
72-
strncpy_s(name, SLAVE_NAME_MAX_SIZE, infos[i].name, SLAVE_NAME_MAX_SIZE-1);
73-
name[SLAVE_NAME_MAX_SIZE-1] = '\0';
73+
strncpy(name, infos[i].name, SLAVE_NAME_MAX_SIZE - 1);
74+
name[SLAVE_NAME_MAX_SIZE - 1] = '\0';
7475
if (0 == strncmp(name, "KnuckleBoomCrane", SLAVE_NAME_MAX_SIZE)) {
76+
found_slave = 1;
7577
double value = -1;
7678
cosim_slave_index slaveIndex = infos[i].index;
7779
cosim_value_reference varIndex = 2;
@@ -85,6 +87,10 @@ int main()
8587
}
8688
}
8789
}
90+
if (!found_slave) {
91+
fprintf(stderr, "Slave not found: %s\n", name);
92+
goto Lfailure;
93+
}
8894

8995
cosim_execution_start(execution);
9096
Sleep(100);

0 commit comments

Comments
 (0)