Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for TestValuePanic (0.14 sec)

  1. src/sync/atomic/value_test.go

    		t.Fatalf("wrong value: got %+v, want foo", x)
    	}
    	v.Store("barbaz")
    	x = v.Load()
    	if xx, ok := x.(string); !ok || xx != "barbaz" {
    		t.Fatalf("wrong value: got %+v, want barbaz", x)
    	}
    }
    
    func TestValuePanic(t *testing.T) {
    	const nilErr = "sync/atomic: store of nil value into Value"
    	const badErr = "sync/atomic: store of inconsistently typed value into Value"
    	var v Value
    	func() {
    		defer func() {
    			err := recover()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 6.1K bytes
    - Viewed (0)
  2. src/reflect/all_test.go

    	badCall(func() { call(v.Field(7).Field(1).Method(0)) })        // .namedT2.t0.W
    	badCall(func() { call(v.Field(7).Field(1).Elem().Method(0)) }) // .namedT2.t0.W
    }
    
    func TestValuePanic(t *testing.T) {
    	vo := ValueOf
    	shouldPanic("reflect.Value.Addr of unaddressable value", func() { vo(0).Addr() })
    	shouldPanic("call of reflect.Value.Bool on float64 Value", func() { vo(0.0).Bool() })
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 218.8K bytes
    - Viewed (0)
Back to top