diff options
Diffstat (limited to 'src/bank-lib/testing_api_helpers.c')
-rw-r--r-- | src/bank-lib/testing_api_helpers.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/bank-lib/testing_api_helpers.c b/src/bank-lib/testing_api_helpers.c index a047c2a71..411391e5a 100644 --- a/src/bank-lib/testing_api_helpers.c +++ b/src/bank-lib/testing_api_helpers.c | |||
@@ -83,6 +83,36 @@ TALER_TESTING_run_fakebank (const char *bank_url) | |||
83 | return fakebankd; | 83 | return fakebankd; |
84 | } | 84 | } |
85 | 85 | ||
86 | |||
87 | /** | ||
88 | * Look for substring in a programs' name. | ||
89 | * | ||
90 | * @param prog program's name to look into | ||
91 | * @param marker chunk to find in @a prog | ||
92 | */ | ||
93 | int | ||
94 | TALER_TESTING_has_in_name (const char *prog_name, | ||
95 | const char *marker) | ||
96 | { | ||
97 | size_t name_pos; | ||
98 | size_t pos; | ||
99 | |||
100 | if (!prog_name || !marker) | ||
101 | return GNUNET_NO; | ||
102 | |||
103 | pos = 0; | ||
104 | name_pos = 0; | ||
105 | while (prog_name[pos]) | ||
106 | { | ||
107 | if ('/' == prog_name[pos]) | ||
108 | name_pos = pos + 1; | ||
109 | pos++; | ||
110 | } | ||
111 | if (name_pos == pos) | ||
112 | return GNUNET_YES; | ||
113 | return strstr(prog_name + name_pos, marker) != NULL; | ||
114 | } | ||
115 | |||
86 | /** | 116 | /** |
87 | * Start the (Python) bank process. Assume the port | 117 | * Start the (Python) bank process. Assume the port |
88 | * is available and the database is clean. Use the "prepare | 118 | * is available and the database is clean. Use the "prepare |