Skip to content

Commit

Permalink
Remove large test values that fail on 32-bit architectures
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrks committed Nov 11, 2019
1 parent d296277 commit 2834c7e
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions api_tests/config_test.go
Expand Up @@ -43,19 +43,12 @@ func Test_max_depth(t *testing.T) {
{jsonDepth: 5, cfgMaxDepth: 6},
{jsonDepth: 5, cfgMaxDepth: 5},
{jsonDepth: 5, cfgMaxDepth: 4, expectedErr: "max depth"},
// Now try some larger values to figure out the limit
// Try a large depth without a limit
{jsonDepth: 128000, cfgMaxDepth: -1},
{jsonDepth: 512000, cfgMaxDepth: -1},
{jsonDepth: 768000, cfgMaxDepth: -1},
{jsonDepth: 860367, cfgMaxDepth: -1}, // largest value for jsoniter without stack overflow
}

for _, test := range tests {
t.Run(fmt.Sprintf("jsonDepth:%v_cfgMaxDepth:%v", test.jsonDepth, test.cfgMaxDepth), func(t *testing.T) {
if testing.Short() && test.jsonDepth >= 512000 {
t.Skip("skipping in -short due to large input data")
}

should := require.New(t)
cfg := jsoniter.Config{MaxDepth: test.cfgMaxDepth}.Froze()

Expand Down

0 comments on commit 2834c7e

Please sign in to comment.