github.com/mvdan/u-root-coreutils@v0.0.0-20230122170626-c2eef2898555/pkg/boot/multiboot/internal/trampoline/pkg_test.go (about) 1 // Copyright 2021 the u-root Authors. All rights reserved 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package trampoline 6 7 import ( 8 "testing" 9 ) 10 11 // TODO: add a unit test that actually verifies that Setup() is 12 // doing the right thing. 13 func TestSetupExecutesWithoutCrashing(t *testing.T) { 14 var magic, infoAddr, entryPoint uintptr 15 somebytes, err := Setup("<path unused>", magic, infoAddr, entryPoint) 16 if len(somebytes) != 0 { 17 // Expected behavior for linux/amd64 18 } else if err != nil { 19 // Expected behavior for all other arch/OS's 20 } else { 21 t.Fatal("didn't expect this") 22 } 23 }