Skip to content

Commit 35b0b7e

Browse files
committed
[Test] Fake memory difference
Signed-off-by: Antón Casas <antoncasas@eprosima.com>
1 parent f5e8030 commit 35b0b7e

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

examples/BinaryEntityCreation/main.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#define STREAM_HISTORY 8
2323
#define BUFFER_SIZE UXR_CONFIG_UDP_TRANSPORT_MTU* STREAM_HISTORY
2424

25+
uint8_t test_array[4] = {0, 1, 2, 3};
26+
2527
void on_topic(
2628
uxrSession* session,
2729
uxrObjectId object_id,
@@ -54,6 +56,16 @@ int main(
5456
char* port = argv[2];
5557
uint32_t max_topics = (args == 4) ? (uint32_t)atoi(argv[3]) : UINT32_MAX;
5658

59+
for (size_t i = 0; i < sizeof(test_array); i++)
60+
{
61+
if (test_array[i] != i)
62+
{
63+
printf("Error in array initialization.\n");
64+
return 1;
65+
}
66+
test_array[i] = i*2;
67+
}
68+
5769
// Transport
5870
uxrUDPTransport transport;
5971
if (!uxr_init_udp_transport(&transport, UXR_IPv4, ip, port))
@@ -147,5 +159,10 @@ int main(
147159
uxr_delete_session(&session);
148160
uxr_close_udp_transport(&transport);
149161

162+
if (test_array[2] != 4)
163+
{
164+
printf("Error in array modification.\n");
165+
return 1;
166+
}
150167
return 0;
151168
}

test/memory/consumption/stack_analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
with open('stack.csv', 'w+') as csv_file:
1212
csv_writer = csv.writer(csv_file, delimiter=',', quoting=csv.QUOTE_ALL)
1313
csv_writer.writerow(['stack'])
14-
csv_writer.writerow([max(stack)])
14+
csv_writer.writerow([max(stack)+1111])
1515

0 commit comments

Comments
 (0)