File: error_test.go

package info (click to toggle)
runc 1.0.0~rc2%2Bgit20161109.131.5137186-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,928 kB
  • ctags: 2,274
  • sloc: sh: 1,102; ansic: 487; makefile: 123
file content (25 lines) | stat: -rw-r--r-- 795 bytes parent folder | download | duplicates (7)
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
package libcontainer

import "testing"

func TestErrorCode(t *testing.T) {
	codes := map[ErrorCode]string{
		IdInUse:             "Id already in use",
		InvalidIdFormat:     "Invalid format",
		ContainerPaused:     "Container paused",
		ConfigInvalid:       "Invalid configuration",
		SystemError:         "System error",
		ContainerNotExists:  "Container does not exist",
		ContainerNotStopped: "Container is not stopped",
		ContainerNotRunning: "Container is not running",
		ConsoleExists:       "Console exists for process",
		ContainerNotPaused:  "Container is not paused",
		NoProcessOps:        "No process operations",
	}

	for code, expected := range codes {
		if actual := code.String(); actual != expected {
			t.Fatalf("expected string %q but received %q", expected, actual)
		}
	}
}