Commit bef0b52
committed
test: add unit tests for MAX_GEOMETRY_DEPTH limit in GeoJsonParser
Add three tests to GeoJsonParserTest to verify the fix for
StackOverflowError caused by deeply nested GeometryCollection objects
(introduced in the accompanying fix commit):
- testDeeplyNestedGeometryCollection_doesNotThrowStackOverflow:
Ensures parsing 2000-level nesting no longer throws StackOverflowError
- testGeometryBeyondMaxDepth_returnsNull:
Ensures geometry exceeding MAX_GEOMETRY_DEPTH (20) returns null
instead of crashing
- testShallowNestedGeometryCollection_parsedCorrectly:
Ensures normal shallow nesting still parses correctly (regression guard)
Relates to: #16991 parent 0b04ac5 commit bef0b52
1 file changed
Lines changed: 47 additions & 0 deletions
Lines changed: 47 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
389 | 436 | | |
0 commit comments