File: conversion_test.go

package info (click to toggle)
golang-github-seccomp-containers-golang 0.6.0-3
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 176 kB
  • sloc: makefile: 27; sh: 11
file content (27 lines) | stat: -rw-r--r-- 637 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package seccomp // import "github.com/seccomp/containers-golang"

import (
	"testing"
)

func TestGoArchToSeccompArchSuccess(t *testing.T) {
	for goArch, seccompArch := range goArchToSeccompArchMap {
		res, err := GoArchToSeccompArch(goArch)
		if err != nil {
			t.Fatalf("expected nil, but got error: %v", err)
		}
		if seccompArch != res {
			t.Fatalf("expected %s, but got: %s", seccompArch, res)
		}
	}
}

func TestGoArchToSeccompArchFailure(t *testing.T) {
	res, err := GoArchToSeccompArch("wrong")
	if err == nil {
		t.Fatal("expected error, but got nil")
	}
	if res != "" {
		t.Fatalf("expected empty res, but got: %s", res)
	}
}