summaryrefslogtreecommitdiff
path: root/test_general
diff options
context:
space:
mode:
authorlaranjeiro2007-12-14 15:21:03 +0000
committerlaranjeiro2007-12-14 15:21:03 +0000
commitb5c90e360f34b7fcfde5481ee340bd14a0f7f557 (patch)
tree96426c1fd2975ca6c283afb6041a730547a7c850 /test_general
parent82ba01c4d425138ee361f5d20ef611ee00238ff5 (diff)
Debugged the memory leak in the integration test with the cl.
In the cl_send_data a blk_release mfs was present to release the MFS, but the SAR does not provide a ref to the cl it only borrow the mfs to the cl to get some links data. The release is done in the SAR on the cl_send_data return. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@1148 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'test_general')
-rw-r--r--test_general/integration/hle-cl-sar-pbproc/maximus_log2
-rw-r--r--test_general/integration/hle-cl-sar-pbproc/src/Maximus.py39
-rw-r--r--test_general/integration/hle-cl-sar-pbproc/src/hle-cl-sar-pbproc.c1
-rw-r--r--test_general/station/src/int_station.c15
4 files changed, 24 insertions, 33 deletions
diff --git a/test_general/integration/hle-cl-sar-pbproc/maximus_log b/test_general/integration/hle-cl-sar-pbproc/maximus_log
index 1d66cdebf9..f04ea94bd8 100644
--- a/test_general/integration/hle-cl-sar-pbproc/maximus_log
+++ b/test_general/integration/hle-cl-sar-pbproc/maximus_log
@@ -1 +1 @@
-Maximus(1000000): *** Exit Fulminata Maximus simulator ***
+Maximus(1001000): *** Exit Fulminata Maximus simulator ***
diff --git a/test_general/integration/hle-cl-sar-pbproc/src/Maximus.py b/test_general/integration/hle-cl-sar-pbproc/src/Maximus.py
index d26850d115..c6ebd7f173 100644
--- a/test_general/integration/hle-cl-sar-pbproc/src/Maximus.py
+++ b/test_general/integration/hle-cl-sar-pbproc/src/Maximus.py
@@ -12,7 +12,7 @@ maximus.init (sys.argv)
# TEI of station 1 will be 1
station1 = maximus.create_sta()
-station1.debug()
+#station1.debug()
# TEI of station 2 will be 2
station2 = maximus.create_sta()
@@ -58,15 +58,6 @@ fc1.add_param_ushort ("lid", 1)
fc1.add_param_ushort ("tei", 2)
fc1.send()
-fc2 = maximus.create_fcall ("fc_station_link_add")
-fc2.set_sta (station2)
-fc2.add_param_ushort ("type", 0)
-fc2.add_param_ushort ("bcast", 0)
-fc2.add_param_ushort ("mme", 0)
-fc2.add_param_ushort ("lid", 1)
-fc2.add_param_ushort ("tei", 1)
-fc2.send()
-
fc1 = maximus.create_fcall ("fc_station_link_add")
fc1.set_sta (station1)
fc1.add_param_ushort ("type", 1)
@@ -80,6 +71,15 @@ fc2 = maximus.create_fcall ("fc_station_link_add")
fc2.set_sta (station2)
fc2.add_param_ushort ("type", 0)
fc2.add_param_ushort ("bcast", 0)
+fc2.add_param_ushort ("mme", 0)
+fc2.add_param_ushort ("lid", 1)
+fc2.add_param_ushort ("tei", 1)
+fc2.send()
+
+fc2 = maximus.create_fcall ("fc_station_link_add")
+fc2.set_sta (station2)
+fc2.add_param_ushort ("type", 0)
+fc2.add_param_ushort ("bcast", 0)
fc2.add_param_ushort ("mme", 1)
fc2.add_param_ushort ("lid", 248)
fc2.add_param_ushort ("tei", 1)
@@ -131,25 +131,14 @@ maximus.wait (1000000)
while not station1.is_idle() and not station2.is_idle() :
maximus.wait(10000)
-fc1 = maximus.create_fcall ("fc_station_link_remove")
+maximus.wait(1000)
+fc1 = maximus.create_fcall ("fc_station_uninit")
fc1.set_sta (station1)
-fc1.add_param_ushort ("type", 1)
-fc1.add_param_ushort ("bcast", 0)
-fc1.add_param_ushort ("mme", 0)
-fc1.add_param_ushort ("lid", 1)
-fc1.add_param_ushort ("tei", 2)
fc1.send()
-fc2 = maximus.create_fcall ("fc_station_link_remove")
+fc2 = maximus.create_fcall ("fc_station_uninit")
fc2.set_sta (station2)
-fc2.add_param_ushort ("type", 0)
-fc2.add_param_ushort ("bcast", 0)
-fc2.add_param_ushort ("mme", 0)
-fc2.add_param_ushort ("lid", 1)
-fc2.add_param_ushort ("tei", 1)
fc2.send()
-
-#maximus.wait(1000)
-station1.remove()
+#station1.remove()
station2.remove() \ No newline at end of file
diff --git a/test_general/integration/hle-cl-sar-pbproc/src/hle-cl-sar-pbproc.c b/test_general/integration/hle-cl-sar-pbproc/src/hle-cl-sar-pbproc.c
index 37dc76567f..1eceadbf4f 100644
--- a/test_general/integration/hle-cl-sar-pbproc/src/hle-cl-sar-pbproc.c
+++ b/test_general/integration/hle-cl-sar-pbproc/src/hle-cl-sar-pbproc.c
@@ -18,6 +18,7 @@
#include "lib/test.h"
#include "lib/read_word.h"
+#include "lib/restrack.h"
#include "mac/sar/sar.h"
#include "cl/cl.h"
diff --git a/test_general/station/src/int_station.c b/test_general/station/src/int_station.c
index e7c9dd1255..b36899ad76 100644
--- a/test_general/station/src/int_station.c
+++ b/test_general/station/src/int_station.c
@@ -51,8 +51,8 @@ int_station_t *int_station_init (void)
int_sta_global.cl
= cl_init (int_sta_global.mac_store, int_sta_global.sar);
-
- int_sta_global.hle = hle_init(int_sta_global.cl);
+
+ int_sta_global.hle = hle_init (int_sta_global.cl);
// Create the Thread for the SAR.
cyg_thread_create (9, &sar_process, (cyg_addrword_t) int_sta_global.sar,
@@ -85,10 +85,11 @@ void int_station_uninit (int_station_t *ctx)
dbg_assert (ctx->hle);
pbproc_activate (ctx->pbproc, false);
+
pbproc_uninit (ctx->pbproc);
sar_uninit (ctx->sar);
cl_uninit (ctx->cl);
- hle_uninit(ctx->hle);
+ hle_uninit (ctx->hle);
blk_release (ctx->mac_config);
@@ -246,12 +247,12 @@ void int_station_link_remove (int_station_t *ctx, uint type, uint bcast,
mfs->rx.head = mfs->rx.head->next;
blk_release_desc ((blk_t *) pb);
}
- }
- // remove the MFS from the sar
- sar_mfs_remove (ctx->sar, mfs);
+ // remove the MFS from the sar
+ sar_mfs_remove (ctx->sar, mfs);
- blk_release (mfs);
+ blk_release (mfs);
+ }
}
/**