summaryrefslogtreecommitdiff
path: root/cesar/hle/test/src/hle_send_to_arm.c
diff options
context:
space:
mode:
authorsave2008-04-07 14:17:42 +0000
committersave2008-04-07 14:17:42 +0000
commit3d58a62727346b7ac1a6cb36fed1a06ed72228dd (patch)
treed7788c3cf9f76426aef0286d0202e2097f0fa0eb /cesar/hle/test/src/hle_send_to_arm.c
parent095dca4b0a8d4924093bab424f71f588fdd84613 (diff)
Moved the complete svn base into the cesar directory.
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@1769 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/hle/test/src/hle_send_to_arm.c')
-rw-r--r--cesar/hle/test/src/hle_send_to_arm.c82
1 files changed, 82 insertions, 0 deletions
diff --git a/cesar/hle/test/src/hle_send_to_arm.c b/cesar/hle/test/src/hle_send_to_arm.c
new file mode 100644
index 0000000000..677501f0d7
--- /dev/null
+++ b/cesar/hle/test/src/hle_send_to_arm.c
@@ -0,0 +1,82 @@
+/* Cesar project {{{
+ *
+ * Copyright (C) 2007 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file test/hle_recv.c
+ * \brief unit test to test the hle when it sends a data to the CL.
+ * \ingroup hle
+ *
+ * « long description »
+ */
+#include "common/std.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "lib/test.h"
+#include "lib/blk.h"
+#include "lib/trace.h"
+
+#include "cl/cl.h"
+
+#include "hle/hle.h"
+#include "lib/test.h"
+
+#include "hle/inc/trace.h"
+
+unsigned int packet1 []__attribute__((aligned(2048))) =
+{ 0xa1b2c3d4, 0x00040002, 0x00000000, 0x00000000,
+ 0x0000ffff, 0x00000001, 0x46973299, 0x0007c33e,
+ 0x00000042, 0x00000042, 0x12005452, 0x00080235,
+ 0x4c205227, 0x00450008, 0x4e043400, 0x06400040,
+ 0x000a1917, 0x79cb0f02, 0x1b04d547, 0x6b285000,
+ 0x0000babc, 0x02800000, 0x396bf0fa, 0x04020000,
+ 0x0301b405, 0x01010003, 0x00000204};
+unsigned int packet1_len = 106;
+
+unsigned int packet2[] = { 0xa1b2c3d4, 0x00040002, 0x00000000, 0x00000000,
+ 0x0000ffff, 0x00000001, 0x469732d4, 0x0000da24, 0x0000005d,
+ 0x0000005d, 0x12005452, 0x00080235, 0x4c205227, 0x00450008,
+ 0x09064f00, 0x06400040, 0x000a901c, 0x000a0f02, 0x01040202,
+ 0x46d6bd01, 0x0d0071cf, 0x185072c5, 0x4b65b0f9, 0x00000000,
+ 0x53ff2300, 0x0071424d, 0x18000000, 0x0000c807, 0x00000000,
+ 0x00000000, 0x00010000, 0x0000feff, 0x00000a01, 0x00000000 };
+unsigned int packet2_len = 133;
+
+test_t test;
+
+int main (void)
+{
+ hle_t *hle;
+ cl_t *cl;
+
+ test_init(test, 0, NULL);
+ trace_init ();
+
+ // The function cl_init has been overided.
+ cl = cl_init (NULL, NULL);
+ hle = hle_init (cl);
+
+ hle_data_recv(hle, (u8 *) packet1, packet1_len);
+ hle_mme_recv(hle, (u8 *) packet1, packet1_len);
+
+ hle_trace_print (hle);
+
+ hle_uninit (hle);
+ cl_uninit (cl);
+
+ test_begin (test, "Memory test")
+ {
+ test_fail_if (blk_check_memory() == false, "Memory not freed");
+ }
+ test_end;
+
+ test_result (test);
+ return test_nb_failed (test) == 0 ? 0 : 1;
+}
+