1
1
mirror of https://github.com/go-gitea/gitea synced 2025-01-10 09:44:43 +00:00

Fix fuzz test (#33156)

This commit is contained in:
Lunny Xiao 2025-01-08 23:15:47 -08:00 committed by GitHub
parent 2a02734f93
commit ba5e3a5161
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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