Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(445)

Side by Side Diff: chrome/test/pyautolib/argc_argv.i

Issue 222873002: Remove pyauto tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/pyautolib/PYAUTO_TESTS ('k') | chrome/test/pyautolib/asan_stub.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 //
5 // Make functions using (int argc, char** argv) usable as (sys.argv) from python
6
7 %typemap(in) (int argc, char **argv) {
8 int i;
9 if (!PyList_Check($input)) {
10 PyErr_SetString(PyExc_ValueError, "Expecting a list");
11 return NULL;
12 }
13 $1 = PyList_Size($input);
14 $2 = (char **) malloc(($1+1)*sizeof(char *));
15 for (i = 0; i < $1; i++) {
16 PyObject *s = PyList_GetItem($input,i);
17 if (!PyString_Check(s)) {
18 free($2);
19 PyErr_SetString(PyExc_ValueError, "List items must be strings");
20 return NULL;
21 }
22 $2[i] = PyString_AsString(s);
23 }
24 $2[i] = 0;
25 }
26
27 %typemap(freearg) (int argc, char **argv) {
28 if ($2) free($2);
29 }
30
OLDNEW
« no previous file with comments | « chrome/test/pyautolib/PYAUTO_TESTS ('k') | chrome/test/pyautolib/asan_stub.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698