Fix fuzz test (#33156) (#33158)

Backport #33156 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
pull/33174/head
Giteabot 3 weeks ago committed by GitHub
parent a330f42f01
commit 12c24c2189
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      tests/fuzz/fuzz_test.go

@ -19,6 +19,7 @@ func newFuzzRenderContext() *markup.RenderContext {
func FuzzMarkdownRenderRaw(f *testing.F) { func FuzzMarkdownRenderRaw(f *testing.F) {
f.Fuzz(func(t *testing.T, data []byte) { f.Fuzz(func(t *testing.T, data []byte) {
setting.IsInTesting = true
setting.AppURL = "http://localhost:3000/" setting.AppURL = "http://localhost:3000/"
markdown.RenderRaw(newFuzzRenderContext(), bytes.NewReader(data), io.Discard) markdown.RenderRaw(newFuzzRenderContext(), bytes.NewReader(data), io.Discard)
}) })
@ -26,6 +27,7 @@ func FuzzMarkdownRenderRaw(f *testing.F) {
func FuzzMarkupPostProcess(f *testing.F) { func FuzzMarkupPostProcess(f *testing.F) {
f.Fuzz(func(t *testing.T, data []byte) { f.Fuzz(func(t *testing.T, data []byte) {
setting.IsInTesting = true
setting.AppURL = "http://localhost:3000/" setting.AppURL = "http://localhost:3000/"
markup.PostProcessDefault(newFuzzRenderContext(), bytes.NewReader(data), io.Discard) markup.PostProcessDefault(newFuzzRenderContext(), bytes.NewReader(data), io.Discard)
}) })

Loading…
Cancel
Save