comparison src/cs/services/mks/tests/mks_test.c @ 0:b6a5e36de839

src/cs: initial import from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 15 Jul 2018 04:39:26 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:b6a5e36de839
1 /********************************************************************************/
2 /* */
3 /* File Name: mks_test.c */
4 /* */
5 /* Purpose: This file contains MKS test generic functions. */
6 /* */
7 /* Note: None. */
8 /* */
9 /* Revision History: */
10 /* 11/21/2001 Laurent Sollier Create. */
11 /* */
12 /* (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved */
13 /* */
14 /********************************************************************************/
15
16 #include "tests/rv/rv_test_filter_redirect.h"
17 #include "tests/rv/rv_test.h"
18
19 #if (MKS_TEST == SW_COMPILED)
20
21
22 /********************************************************************************/
23 /* Global variables for tests */
24 /********************************************************************************/
25
26 T_RVF_MB_ID mb_mks_test;
27 T_RV_RETURN mks_test_path;
28
29 /********************************************************************************/
30 /* */
31 /* Function Name: mks_test_set_mb_id */
32 /* */
33 /* Purpose: This function is called to set MKS test MB IDs. */
34 /* */
35 /* Note: None. */
36 /* */
37 /* Revision History: */
38 /* 11/21/01 Laurent Sollier Create. */
39 /* */
40 /********************************************************************************/
41 void mks_test_set_mb_id (T_RVF_MB_ID mb_id[])
42 {
43 mb_mks_test = mb_id[0];
44 mks_test_path.callback_func = NULL;
45 mks_test_path.addr_id = rvf_get_taskid();
46 }
47 /********************* End of mks_test_set_mb_id function *********************/
48
49
50
51 /********************************************************************************/
52 /* */
53 /* Function Name: fix_mks_test_verdict */
54 /* */
55 /* Purpose: The purpose of this function is to fix test_verdict */
56 /* param value depending on error_type param value. */
57 /* */
58 /* Note: None. */
59 /* */
60 /* Revision History: */
61 /* 11/21/01 Laurent Sollier Create. */
62 /* */
63 /********************************************************************************/
64
65 T_RV_TEST_RET fix_mks_test_verdict (T_RV_TEST_ERR_TYPE *error_type)
66 {
67 T_RV_TEST_RET test_verdict;
68
69 /******************** fix_mks_test_verdict function begins ********************/
70
71 switch (*error_type)
72 {
73 case NO_ERR:
74 {
75 test_verdict = TEST_PASSED;
76 break;
77 }
78 case NO_EVENT_RECV:
79 {
80 test_verdict = TEST_IRRECOVERABLY_FAILED;
81 break;
82 }
83 case BAD_EVENT_RECV:
84 {
85 test_verdict = TEST_IRRECOVERABLY_FAILED;
86 break;
87 }
88 case EVENT_PARAM_ERROR:
89 {
90 test_verdict = TEST_IRRECOVERABLY_FAILED;
91 break;
92 }
93 case DATA_ERROR:
94 {
95 test_verdict = TEST_IRRECOVERABLY_FAILED;
96 break;
97 }
98 case MEMORY_ERROR:
99 {
100 test_verdict = TEST_IRRECOVERABLY_FAILED;
101 break;
102 }
103 default:
104 {
105 rvf_send_trace ("!!! ERROR !!! Wrong error_type value",
106 36,
107 NULL_PARAM,
108 RV_TRACE_LEVEL_ERROR,
109 TRACE_RVTEST);
110 test_verdict = TEST_IRRECOVERABLY_FAILED;
111 break;
112 }
113 } /* End of "switch (*error_type)" */
114
115 return (test_verdict);
116 }
117
118 /******************** End of fix_mks_test_verdict function ********************/
119 #else
120
121 /* Add a dummy function in order to allow compilation of the MKS test lib on
122 ARM V1.22 compiler */
123 void mks_test_dummy(void)
124 {
125 }
126 #endif /* #if (MKS_TEST == SW_COMPILED) */