MCPcopy Create free account
hub / github.com/F-Stack/f-stack / test_cmdline_socket_fns

Function test_cmdline_socket_fns

dpdk/app/test/test_cmdline_lib.c:152–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152static int
153test_cmdline_socket_fns(void)
154{
155 cmdline_parse_ctx_t ctx;
156 struct cmdline *cl;
157
158 cl = cmdline_stdin_new(NULL, "prompt");
159 if (cl != NULL)
160 goto error;
161 cl = cmdline_stdin_new(&ctx, NULL);
162 if (cl != NULL)
163 goto error;
164 cl = cmdline_file_new(NULL, "prompt", NULL_INPUT);
165 if (cl != NULL)
166 goto error;
167 cl = cmdline_file_new(&ctx, NULL, NULL_INPUT);
168 if (cl != NULL)
169 goto error;
170 cl = cmdline_file_new(&ctx, "prompt", NULL);
171 if (cl != NULL)
172 goto error;
173 cl = cmdline_file_new(&ctx, "prompt", "-/invalid/~/path");
174 if (cl != NULL) {
175 printf("Error: succeeded in opening invalid file for reading!");
176 cmdline_free(cl);
177 return -1;
178 }
179 cl = cmdline_file_new(&ctx, "prompt", NULL_INPUT);
180 if (cl == NULL) {
181 printf("Error: failed to open /dev/null for reading!");
182 return -1;
183 }
184 cmdline_free(cl);
185 cl = NULL;
186
187 /* void functions */
188 cmdline_stdin_exit(NULL);
189
190 return 0;
191error:
192 printf("Error: function accepted null parameter!\n");
193 cmdline_free(cl);
194 return -1;
195}
196
197static int
198test_cmdline_fns(void)

Callers 1

test_cmdline_libFunction · 0.85

Calls 5

cmdline_stdin_newFunction · 0.85
cmdline_file_newFunction · 0.85
cmdline_freeFunction · 0.85
cmdline_stdin_exitFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected