Merge pull request #33446 from raja-sami-10p/pkg/platform

Increase the Coverage of pkg/platform
Upstream-commit: 7ff205571f6016c10638e16026d1673b2f5b6615
Component: engine
This commit is contained in:
Sebastiaan van Stijn
2017-06-01 19:14:15 +02:00
committed by GitHub
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,16 @@
// +build linux,386 linux,amd64 linux,arm64
package platform
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestCharToString(t *testing.T) {
machineInBytes := [65]int8{120, 56, 54, 95, 54, 52}
machineInString := charsToString(machineInBytes)
assert.NotNil(t, machineInString, "Unable to convert char into string.")
assert.Equal(t, string("x86_64"), machineInString, "Parsed machine code not equal.")
}

View File

@ -0,0 +1,16 @@
// +build linux,arm linux,ppc64 linux,ppc64le s390x
package platform
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestTestCharToString(t *testing.T) {
machineInBytes := [65]uint8{120, 56, 54, 95, 54, 52}
machineInString := charsToString(machineInBytes)
assert.NotNil(t, machineInString, "Unable to convert char into string.")
assert.Equal(t, string("x86_64"), machineInString, "Parsed machine code not equal.")
}