@@ -228,7 +228,7 @@ func BenchmarkELFLoader(b *testing.B) {
228
228
}
229
229
230
230
func TestDataSections (t * testing.T ) {
231
- file := fmt . Sprintf ( "testdata/loader-%s.elf" , internal . ClangEndian )
231
+ file := testutils . NativeFile ( t , "testdata/loader-%s.elf" )
232
232
coll , err := LoadCollectionSpec (file )
233
233
if err != nil {
234
234
t .Fatal (err )
@@ -258,7 +258,7 @@ func TestDataSections(t *testing.T) {
258
258
}
259
259
260
260
func TestInlineASMConstant (t * testing.T ) {
261
- file := fmt . Sprintf ( "testdata/loader-%s.elf" , internal . ClangEndian )
261
+ file := testutils . NativeFile ( t , "testdata/loader-%s.elf" )
262
262
coll , err := LoadCollectionSpec (file )
263
263
if err != nil {
264
264
t .Fatal (err )
@@ -289,7 +289,7 @@ func TestInlineASMConstant(t *testing.T) {
289
289
func TestFreezeRodata (t * testing.T ) {
290
290
testutils .SkipOnOldKernel (t , "5.9" , "sk_lookup program type" )
291
291
292
- file := fmt . Sprintf ( "testdata/constants-%s.elf" , internal . ClangEndian )
292
+ file := testutils . NativeFile ( t , "testdata/constants-%s.elf" )
293
293
spec , err := LoadCollectionSpec (file )
294
294
if err != nil {
295
295
t .Fatal (err )
@@ -470,7 +470,7 @@ func TestLoadInvalidInitializedBTFMap(t *testing.T) {
470
470
}
471
471
472
472
func TestStringSection (t * testing.T ) {
473
- file := fmt . Sprintf ( "testdata/strings-%s.elf" , internal . ClangEndian )
473
+ file := testutils . NativeFile ( t , "testdata/strings-%s.elf" )
474
474
spec , err := LoadCollectionSpec (file )
475
475
if err != nil {
476
476
t .Fatalf ("load collection spec: %s" , err )
@@ -784,7 +784,7 @@ func TestInvalidKfunc(t *testing.T) {
784
784
t .Skip ("bpf_testmod not loaded" )
785
785
}
786
786
787
- file := fmt . Sprintf ( "testdata/invalid-kfunc-%s.elf" , internal . ClangEndian )
787
+ file := testutils . NativeFile ( t , "testdata/invalid-kfunc-%s.elf" )
788
788
coll , err := LoadCollection (file )
789
789
if err == nil {
790
790
coll .Close ()
0 commit comments