1 : /*
2 : * This file is part of MIN Test Framework. Copyright © 2008 Nokia Corporation
3 : * and/or its subsidiary(-ies).
4 : * Contact: Konrad Marek Zapalowicz
5 : * Contact e-mail: DG.MIN-Support@nokia.com
6 : *
7 : * This program is free software: you can redistribute it and/or modify it
8 : * under the terms of the GNU General Public License as published by the Free
9 : * Software Foundation, version 2 of the License.
10 : *
11 : * This program is distributed in the hope that it will be useful, but WITHOUT
12 : * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 : * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 : * more details. You should have received a copy of the GNU General Public
15 : * License along with this program. If not, see
16 : * <http://www.gnu.org/licenses/>.
17 : */
18 :
19 :
20 : /**
21 : * @file scripter_keyword.c
22 : * @version 0.1
23 : * @brief This file contains implementation of MIN Scripter keyword
24 : * interface.
25 : */
26 :
27 : /* ------------------------------------------------------------------------- */
28 : /* INCLUDE FILES */
29 : #include <min_logger.h>
30 : #include <scripter_keyword.h>
31 : /* ------------------------------------------------------------------------- */
32 : /* EXTERNAL DATA STRUCTURES */
33 : /* None */
34 :
35 : /* ------------------------------------------------------------------------- */
36 : /* EXTERNAL GLOBAL VARIABLES */
37 :
38 : /* ------------------------------------------------------------------------- */
39 : /* EXTERNAL FUNCTION PROTOTYPES */
40 : /* None */
41 :
42 : /* ------------------------------------------------------------------------- */
43 : /* GLOBAL VARIABLES */
44 : /* None */
45 :
46 : /* ------------------------------------------------------------------------- */
47 : /* CONSTANTS */
48 : /* None */
49 :
50 : /* ------------------------------------------------------------------------- */
51 : /* MACROS */
52 : /* None */
53 :
54 : /* ------------------------------------------------------------------------- */
55 : /* LOCAL GLOBAL VARIABLES */
56 : /* None */
57 :
58 : /* ------------------------------------------------------------------------- */
59 : /* LOCAL CONSTANTS AND MACROS */
60 : /* None */
61 :
62 : /* ------------------------------------------------------------------------- */
63 : /* MODULE DATA STRUCTURES */
64 : /* None */
65 :
66 : /* ------------------------------------------------------------------------- */
67 : /* LOCAL FUNCTION PROTOTYPES */
68 : /* None */
69 :
70 : /* ------------------------------------------------------------------------- */
71 : /* FORWARD DECLARATIONS */
72 : /* None */
73 :
74 : /* ------------------------------------------------------------------------- */
75 : /* ==================== LOCAL FUNCTIONS ==================================== */
76 : /* None */
77 :
78 : /* ------------------------------------------------------------------------- */
79 : /* ======================== FUNCTIONS ====================================== */
80 : /* ------------------------------------------------------------------------- */
81 : TScripterKeyword get_keyword (const char *label)
82 5715 : {
83 5715 : TScripterKeyword retval = EKeywordUnknown;
84 :
85 5715 : if (label == INITPTR) {
86 0 : MIN_ERROR ("parameter is INITPTR");
87 0 : goto EXIT;
88 : }
89 5715 : if (strcmp (label, "createx") == 0) {
90 322 : retval = EKeywordCreate;
91 5393 : } else if (strcmp (label, "delete") == 0) {
92 284 : retval = EKeywordDelete;
93 5109 : } else if (strcmp (label, "title") == 0) {
94 1006 : retval = EKeywordTitle;
95 4103 : } else if (strcmp (label, "run") == 0) {
96 348 : retval = EKeywordRun;
97 3755 : } else if (strcmp (label, "request") == 0) {
98 39 : retval = EKeywordRequest;
99 3716 : } else if (strcmp (label, "release") == 0) {
100 39 : retval = EKeywordRelease;
101 3677 : } else if (strcmp (label, "wait") == 0) {
102 39 : retval = EKeywordWait;
103 3638 : } else if (strcmp (label, "set") == 0) {
104 39 : retval = EKeywordSet;
105 3599 : } else if (strcmp (label, "unset") == 0) {
106 39 : retval = EKeywordUnset;
107 3560 : } else if (strcmp (label, "loop") == 0) {
108 234 : retval = EKeywordLoop;
109 3326 : } else if (strcmp (label, "endloop") == 0) {
110 234 : retval = EKeywordEndloop;
111 3092 : } /*else if (strcmp (label, "set") == 0) {
112 : retval = EKeywordSkipIt;
113 : } else if (strcmp (label, "unset") == 0) {
114 : retval = EKeywordSkipIt;
115 : }*/ else if (strcmp (label, "print") == 0) {
116 470 : retval = EKeywordPrint;
117 2622 : } else if (strcmp (label, "pause") == 0) {
118 80 : retval = EKeywordPause;
119 2542 : } else if (strcmp (label, "resume") == 0) {
120 40 : retval = EKeywordResume;
121 2502 : } else if (strcmp (label, "cancel") == 0) {
122 39 : retval = EKeywordCancel;
123 2463 : } else if (strcmp (label, "allocate") == 0) {
124 91 : retval = EKeywordAllocate;
125 2372 : } else if (strcmp (label, "free") == 0) {
126 91 : retval = EKeywordFree;
127 2281 : } else if (strcmp (label, "remote") == 0) {
128 104 : retval = EKeywordRemote;
129 2177 : } else if (strcmp (label, "allownextresult") == 0) {
130 77 : retval = EKeywordAllowNextResult;
131 2100 : } else if (strcmp (label, "allowerrorcodes") == 0) {
132 0 : retval = EKeywordAllowNextResult;
133 2100 : } else if (strcmp (label, "complete") == 0) {
134 0 : retval = EKeywordComplete;
135 2100 : } else if (strcmp (label, "canceliferror") == 0) {
136 41 : retval = EKeywordCancelIfError;
137 2059 : } else if (strcmp (label, "timeout") == 0) {
138 0 : retval = EKeywordTimeout;
139 2059 : } else if (strcmp (label, "sleep") == 0) {
140 306 : retval = EKeywordSleep;
141 1753 : } else if (strcmp (label, "pausecombiner") == 0) {
142 0 : retval = EKeywordSleep;
143 1753 : } else if (strcmp (label, "waittestclass") == 0) {
144 : /* We need to recognize this keyword, but we are using Events
145 : for that stuff so this keyword will be skipped. */
146 0 : retval = EKeywordSkipIt;
147 1753 : } else if (strcmp (label, "priority") == 0) {
148 0 : retval = EKeywordSkipIt;
149 1753 : } else if (strcmp (label, "expect") == 0) {
150 40 : retval = EKeywordExpect;
151 1713 : } else if (strcmp (label, "sendreceive") == 0) {
152 1 : retval = EKeywordSendreceive;
153 1712 : } else if (strcmp (label, "var") == 0) {
154 157 : retval = EKeywordVar;
155 1555 : } else if (strcmp (label, "testinterference") == 0){
156 720 : retval = EKeywordInterference;
157 835 : } else if (strcmp (label, "if") == 0){
158 157 : retval = EKeywordIf;
159 678 : } else if (strcmp (label, "else") == 0){
160 39 : retval = EKeywordElse;
161 639 : } else if (strcmp (label, "endif") == 0){
162 157 : retval = EKeywordEndif;
163 482 : } else if (strcmp (label, "breakloop") == 0){
164 40 : retval = EKeywordBreakloop;
165 : } else {
166 442 : retval = EKeywordClassName;
167 : }
168 :
169 5715 : EXIT:
170 5715 : return retval;
171 : }
172 :
173 : /* ------------------------------------------------------------------------- */
174 : /* ================= OTHER EXPORTED FUNCTIONS ============================== */
175 : /* None */
176 :
177 : /* ------------------------------------------------------------------------- */
178 : /* ================= TESTS FOR LOCAL FUNCTIONS ============================= */
179 : #ifdef MIN_UNIT_TEST
180 : #include "min_scripter_if.tests"
181 : #endif /* MIN_UNIT_TEST */
182 : /* End of file */
|