Update to unit test and comment bug fixed

This commit is contained in:
nolancon 2019-05-10 03:53:46 +01:00
parent 7c525ffaa8
commit e8566caa3f
2 changed files with 6 additions and 6 deletions

View File

@ -38,7 +38,7 @@ func (sm SocketMask) GetSocketMask(socketMaskInt64 [][]int64, maskHolder []strin
maskHolder = buildMaskHolder(socketMaskInt64)
}
klog.V(4).Infof("[socketmask] MaskHolder : %v", maskHolder)
klog.V(4).Infof("[socketmask] %v is passed into arrange function", socketMask)
klog.V(4).Infof("[socketmask] %v is passed into arrange function", socketMaskInt64)
arrangedMask := arrangeMask(socketMaskInt64)
newMask := getTopologyAffinity(arrangedMask, maskHolder)
klog.V(4).Infof("[socketmask] New Mask after getTopologyAffinity (new mask) : %v ", newMask)

View File

@ -24,7 +24,7 @@ import (
func TestGetSocketmask(t *testing.T) {
tcases := []struct {
name string
socketmask []SocketMask
socketmask [][]int64
maskholder []string
count int
expectedMaskHolder []string
@ -32,7 +32,7 @@ func TestGetSocketmask(t *testing.T) {
}{
{
name: "Empty MaskHolder and count set as 0",
socketmask: []SocketMask{{1, 0}, {0, 1}, {1, 1}},
socketmask: [][]int64{{1, 0}, {0, 1}, {1, 1}},
maskholder: []string{""},
count: 0,
expectedMaskHolder: []string{"10", "01", "11"},
@ -40,7 +40,7 @@ func TestGetSocketmask(t *testing.T) {
},
{
name: "MaskHolder non zero, count set as 1",
socketmask: []SocketMask{{1, 0}, {0, 1}, {1, 1}},
socketmask: [][]int64{{1, 0}, {0, 1}, {1, 1}},
maskholder: []string{"10", "01", "11"},
count: 1,
expectedMaskHolder: []string{"10", "01", "11"},
@ -49,7 +49,7 @@ func TestGetSocketmask(t *testing.T) {
{
name: "Empty MaskHolder and count set as 0",
socketmask: []SocketMask{{0, 1}, {1, 1}},
socketmask: [][]int64{{0, 1}, {1, 1}},
maskholder: []string{""},
count: 0,
expectedMaskHolder: []string{"01", "11"},
@ -57,7 +57,7 @@ func TestGetSocketmask(t *testing.T) {
},
{
name: "MaskHolder non zero, count set as 1",
socketmask: []SocketMask{{0, 1}, {1, 1}},
socketmask: [][]int64{{0, 1}, {1, 1}},
maskholder: []string{"01", "11"},
count: 1,
expectedMaskHolder: []string{"01", "11"},