TestErrBuiltin
This commit is contained in:
@@ -80,52 +80,24 @@ func TestErrCompileInstrOrValue(t *testing.T) {
|
|||||||
ctx.compileInstrOrValue(nil, &ssa.Call{}, true)
|
ctx.compileInstrOrValue(nil, &ssa.Call{}, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestErrAdvance(t *testing.T) {
|
func TestErrBuiltin(t *testing.T) {
|
||||||
defer func() {
|
test := func(builtin string, fn func(ctx *context)) {
|
||||||
if r := recover(); r == nil {
|
defer func() {
|
||||||
t.Fatal("advance: no error?")
|
if r := recover(); r == nil {
|
||||||
}
|
t.Fatal(builtin, ": no error?")
|
||||||
}()
|
}
|
||||||
var ctx context
|
}()
|
||||||
ctx.advance(nil, nil)
|
var ctx context
|
||||||
}
|
fn(&ctx)
|
||||||
|
}
|
||||||
func TestErrAlloca(t *testing.T) {
|
test("advance", func(ctx *context) { ctx.advance(nil, nil) })
|
||||||
defer func() {
|
test("alloca", func(ctx *context) { ctx.alloca(nil, nil) })
|
||||||
if r := recover(); r == nil {
|
test("allocaCStr", func(ctx *context) { ctx.allocaCStr(nil, nil) })
|
||||||
t.Fatal("alloca: no error?")
|
test("stringData", func(ctx *context) { ctx.stringData(nil, nil) })
|
||||||
}
|
test("sigsetjmp", func(ctx *context) { ctx.sigsetjmp(nil, nil) })
|
||||||
}()
|
test("siglongjmp", func(ctx *context) { ctx.siglongjmp(nil, nil) })
|
||||||
var ctx context
|
test("cstr(NoArgs)", func(ctx *context) { cstr(nil, nil) })
|
||||||
ctx.alloca(nil, nil)
|
test("cstr(Nonconst)", func(ctx *context) { cstr(nil, []ssa.Value{&ssa.Parameter{}}) })
|
||||||
}
|
|
||||||
|
|
||||||
func TestErrAllocaCStr(t *testing.T) {
|
|
||||||
defer func() {
|
|
||||||
if r := recover(); r == nil {
|
|
||||||
t.Fatal("allocaCStr: no error?")
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
var ctx context
|
|
||||||
ctx.allocaCStr(nil, nil)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestCStrNoArgs(t *testing.T) {
|
|
||||||
defer func() {
|
|
||||||
if r := recover(); r == nil {
|
|
||||||
t.Fatal("cstr: no error?")
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
cstr(nil, nil)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestCStrNonconst(t *testing.T) {
|
|
||||||
defer func() {
|
|
||||||
if r := recover(); r == nil {
|
|
||||||
t.Fatal("cstr: no error?")
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
cstr(nil, []ssa.Value{&ssa.Parameter{}})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPkgNoInit(t *testing.T) {
|
func TestPkgNoInit(t *testing.T) {
|
||||||
|
|||||||
Reference in New Issue
Block a user