Commit ff06a49
Fix HTTPAPIEX_ExecuteRequest failing with HTTPAPI_REQUEST_HEAD (#528)
The HTTPAPI_REQUEST_TYPE enum is defined using the MU_DEFINE_ENUM
macro, which implicitely adds HTTPAPI_REQUEST_TYPE_INVALID as the first
value. This makes checking the validity of requestType with MU_COUNT_ARG
incorrect: HTTPAPI_REQUEST_TYPE_INVALID is accepted and
HTTPAPI_REQUEST_HEAD is rejected.
Unit tests:
- Change all uses of HTTPAPI_REQUEST_PATCH (the previous last value in the
enum) to HTTPAPI_REQUEST_HEAD (the current last value in the enum) to test
that it is accepted.
- Change HTTPAPIEX_ExecuteRequest_fails_with_invalid_request_type to use
a request type outside of the enum.
- Add HTTPAPIEX_ExecuteRequest_fails_with_invalid_request_type_2, which
explicitely tests that HTTPAPIEX_INVALID_ARG is rejected.
Co-authored-by: Pierrick Arsenault <[email protected]>
Co-authored-by: Eric Wolz <[email protected]>1 parent fb2c745 commit ff06a49
2 files changed
+121
-79
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
339 | 360 | | |
340 | 361 | | |
341 | 362 | | |
| |||
350 | 371 | | |
351 | 372 | | |
352 | 373 | | |
353 | | - | |
| 374 | + | |
354 | 375 | | |
355 | 376 | | |
356 | 377 | | |
| |||
0 commit comments