@@ -126,52 +126,35 @@ int main(void) {
126
126
assert (params.cpuparams .n_threads == 1010 );
127
127
#endif // _WIN32
128
128
129
- if (common_has_curl ()) {
130
- printf (" test-arg-parser: test curl-related functions\n\n " );
131
- const char * GOOD_URL = " https://ggml.ai/" ;
132
- const char * BAD_URL = " https://www.google.com/404" ;
133
- const char * BIG_FILE = " https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-large-v1.bin" ;
134
-
135
- {
136
- printf (" test-arg-parser: test good URL\n\n " );
137
- auto res = common_remote_get_content (GOOD_URL, {});
138
- assert (res.first == 200 );
139
- assert (res.second .size () > 0 );
140
- std::string str (res.second .data (), res.second .size ());
141
- assert (str.find (" llama.cpp" ) != std::string::npos);
142
- }
143
-
144
- {
145
- printf (" test-arg-parser: test bad URL\n\n " );
146
- auto res = common_remote_get_content (BAD_URL, {});
147
- assert (res.first == 404 );
148
- }
129
+ printf (" test-arg-parser: test curl-related functions\n\n " );
130
+ const char * GOOD_URL = " http://ggml.ai/" ;
131
+ const char * BAD_URL = " http://ggml.ai/404" ;
132
+
133
+ {
134
+ printf (" test-arg-parser: test good URL\n\n " );
135
+ auto res = common_remote_get_content (GOOD_URL, {});
136
+ assert (res.first == 200 );
137
+ assert (res.second .size () > 0 );
138
+ std::string str (res.second .data (), res.second .size ());
139
+ assert (str.find (" llama.cpp" ) != std::string::npos);
140
+ }
149
141
150
- {
151
- printf (" test-arg-parser: test max size error\n " );
152
- common_remote_params params;
153
- params.max_size = 1 ;
154
- try {
155
- common_remote_get_content (GOOD_URL, params);
156
- assert (false && " it should throw an error" );
157
- } catch (std::exception & e) {
158
- printf (" expected error: %s\n\n " , e.what ());
159
- }
160
- }
142
+ {
143
+ printf (" test-arg-parser: test bad URL\n\n " );
144
+ auto res = common_remote_get_content (BAD_URL, {});
145
+ assert (res.first == 404 );
146
+ }
161
147
162
- {
163
- printf (" test-arg-parser: test timeout error\n " );
164
- common_remote_params params;
165
- params.timeout = 1 ;
166
- try {
167
- common_remote_get_content (BIG_FILE, params);
168
- assert (false && " it should throw an error" );
169
- } catch (std::exception & e) {
170
- printf (" expected error: %s\n\n " , e.what ());
171
- }
148
+ {
149
+ printf (" test-arg-parser: test max size error\n " );
150
+ common_remote_params params;
151
+ params.max_size = 1 ;
152
+ try {
153
+ common_remote_get_content (GOOD_URL, params);
154
+ assert (false && " it should throw an error" );
155
+ } catch (std::exception & e) {
156
+ printf (" expected error: %s\n\n " , e.what ());
172
157
}
173
- } else {
174
- printf (" test-arg-parser: no curl, skipping curl-related functions\n " );
175
158
}
176
159
177
160
printf (" test-arg-parser: all tests OK\n\n " );
0 commit comments