Search Options

Results per page
Sort
Preferred Languages
Advance

Results 191 - 200 of 1,675 for mypanic (0.21 sec)

  1. test/typeparam/issue48318.go

    	Data U `xml:"data"`
    }
    
    func main() {
    	src := &A[string, int]{Name: "name", Data: 1}
    	data, err := xml.Marshal(src)
    	if err != nil {
    		panic(err)
    	}
    	dst := &A[string, int]{}
    	err = xml.Unmarshal(data, dst)
    	if err != nil {
    		panic(err)
    	}
    	if *src != *dst {
    		panic(fmt.Sprintf("wanted %#v got %#v", src, dst))
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 581 bytes
    - Viewed (0)
  2. test/abi/defer_recover_results.go

    //go:registerparams
    func F() (a int, b string, _ int, c S, d [2]int) {
    	a, b, c, d = a0, b0, c0, d0
    	defer func() { recover() }()
    	panic("XXX")
    	return
    }
    
    func main() {
    	a1, b1, zero, c1, d1 := F()
    	if a1 != a0 || b1 != b0 || c1 != c0 || d1 != d0 || zero != 0 { // unnamed result gets zero value
    		panic("FAIL")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 06 20:22:15 UTC 2021
    - 800 bytes
    - Viewed (0)
  3. test/fixedbugs/issue13799.go

    package main
    
    import "fmt"
    
    func main() {
    	// Just run test over and over again. This main func is just for
    	// convenience; if test were the main func, we could also trigger
    	// the panic just by running the program over and over again
    	// (sometimes it takes 1 time, sometimes it takes ~4,000+).
    	for iter := 0; ; iter++ {
    		if iter%50 == 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 18:50:24 UTC 2023
    - 4.9K bytes
    - Viewed (0)
  4. src/crypto/elliptic/nistec.go

    	q, err := curve.newPoint().ScalarBaseMult(s1)
    	if err != nil {
    		panic("crypto/elliptic: nistec rejected normalized scalar")
    	}
    	p, err := curve.pointFromAffine(Px, Py)
    	if err != nil {
    		panic("crypto/elliptic: CombinedMult was called on an invalid point")
    	}
    	s2 = curve.normalizeScalar(s2)
    	p, err = p.ScalarMult(p, s2)
    	if err != nil {
    		panic("crypto/elliptic: nistec rejected normalized scalar")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 21 16:19:34 UTC 2022
    - 9.6K bytes
    - Viewed (0)
  5. src/cmd/go/testdata/script/test_fuzz_mutate_crash.txt

    		if len(a) > 0 && len(b) > 0 {
    			panic("these inputs caused a crash!")
    		}
    	})
    }
    
    func FuzzInt(f *testing.F) {
    	f.Add(0)
    	f.Fuzz(func(t *testing.T, a int) {
    		if a != 0 {
    			panic("this input caused a crash!")
    		}
    	})
    }
    
    func FuzzUint(f *testing.F) {
    	f.Add(uint(0))
    	f.Fuzz(func(t *testing.T, a uint) {
    		if a != 0 {
    			panic("this input caused a crash!")
    		}
    	})
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 16 16:53:11 UTC 2023
    - 8.3K bytes
    - Viewed (0)
  6. test/chan/select3.go

    const never = "function did"
    
    func unreachable() {
    	panic("control flow shouldn't reach here")
    }
    
    // Calls f and verifies that f always/never panics depending on signal.
    func testPanic(signal string, f func()) {
    	defer func() {
    		s := never
    		if recover() != nil {
    			s = always // f panicked
    		}
    		if s != signal {
    			panic(signal + " panic")
    		}
    	}()
    	f()
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Jul 08 02:10:12 UTC 2017
    - 4.1K bytes
    - Viewed (0)
  7. test/ken/cplx3.go

    	d := r - 1.292308
    	if d < 0 {
    		d = - d
    	}
    	if d > 1e-6 {
    		println(r, "!= 1.292308")
    		panic(0)
    	}
    	d = i + 0.1384615
    	if d < 0 {
    		d = - d
    	}
    	if d > 1e-6 {
    		println(i, "!= -0.1384615")
    		panic(0)
    	}
    
    	c := *(*complex128)(unsafe.Pointer(&c0))
    	if c != c0 {
    		println(c, "!=", c)
    		panic(0)
    	}
    
    	var a interface{}
    	switch c := reflect.ValueOf(a); c.Kind() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 24 05:24:24 UTC 2012
    - 888 bytes
    - Viewed (0)
  8. test/chan/sendstmt.go

    	cc := make(chan chan int, 1)
    	c := make(chan int, 1)
    	cc <- c
    	select {
    	case <-cc <- 2:
    	default:
    		panic("nonblock")
    	}
    	if <-c != 2 {
    		panic("bad receive")
    	}
    }
    
    func sendprec() {
    	c := make(chan bool, 1)
    	c <- false || true // not a syntax error: same as c <- (false || true)
    	if !<-c {
    		panic("sent false")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 15 02:39:16 UTC 2017
    - 672 bytes
    - Viewed (0)
  9. test/fixedbugs/bug264.go

    var a, b = foo() // foo is called once
    var c, _ = bar() // bar is called twice
    var _, _ = bal() // bal is called twice
    
    func main() {
    	if fooCount != 1 {
    		panic("fooCount != 1")
    	}
    	if barCount != 1 {
    		panic("barCount != 1")
    	}
    	if balCount != 1 {
    		panic("balCount != 1")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Jul 11 14:36:33 UTC 2015
    - 717 bytes
    - Viewed (0)
  10. src/crypto/x509/root.go

    // pool is not available (for instance in a container which does not have a root
    // certificate bundle). SetFallbackRoots will panic if roots is nil.
    //
    // SetFallbackRoots may only be called once, if called multiple times it will
    // panic.
    //
    // The fallback behavior can be forced on all platforms, even when there is a
    // system certificate pool, by setting GODEBUG=x509usefallbackroots=1 (note that
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 2.3K bytes
    - Viewed (0)
Back to top