aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Morales <victor.morales@intel.com>2019-01-22 18:22:34 +0000
committerGerrit Code Review <gerrit@onap.org>2019-01-22 18:22:34 +0000
commitf26259e651ee0be263a3398d2d0ca0eb27c8995c (patch)
tree1f8e9472b61a50602372d6e6c96531b97340507a
parent073d2f7806257f27b5b92088dc59ae5a98ae6c38 (diff)
parent96c1fc6a2be0cf4dc39d93bfc7f8df0cd76a7b14 (diff)
Merge "Fix sorting with right index value"
-rw-r--r--src/k8splugin/api/defhandler_test.go4
-rw-r--r--src/k8splugin/api/profilehandler_test.go4
-rw-r--r--src/k8splugin/rb/definition_test.go4
-rw-r--r--src/k8splugin/rb/profile_test.go4
4 files changed, 8 insertions, 8 deletions
diff --git a/src/k8splugin/api/defhandler_test.go b/src/k8splugin/api/defhandler_test.go
index 3dbd1aa4..fd17f50e 100644
--- a/src/k8splugin/api/defhandler_test.go
+++ b/src/k8splugin/api/defhandler_test.go
@@ -216,12 +216,12 @@ func TestRBDefListHandler(t *testing.T) {
// Since the order of returned slice is not guaranteed
// Check both and return error if both don't match
sort.Slice(got, func(i, j int) bool {
- return got[i].UUID < got[i].UUID
+ return got[i].UUID < got[j].UUID
})
// Sort both as it is not expected that testCase.expected
// is sorted
sort.Slice(testCase.expected, func(i, j int) bool {
- return testCase.expected[i].UUID < testCase.expected[i].UUID
+ return testCase.expected[i].UUID < testCase.expected[j].UUID
})
if reflect.DeepEqual(testCase.expected, got) == false {
diff --git a/src/k8splugin/api/profilehandler_test.go b/src/k8splugin/api/profilehandler_test.go
index 87725882..49efd659 100644
--- a/src/k8splugin/api/profilehandler_test.go
+++ b/src/k8splugin/api/profilehandler_test.go
@@ -223,12 +223,12 @@ func TestRBProfileListHandler(t *testing.T) {
// Since the order of returned slice is not guaranteed
// Check both and return error if both don't match
sort.Slice(got, func(i, j int) bool {
- return got[i].UUID < got[i].UUID
+ return got[i].UUID < got[j].UUID
})
// Sort both as it is not expected that testCase.expected
// is sorted
sort.Slice(testCase.expected, func(i, j int) bool {
- return testCase.expected[i].UUID < testCase.expected[i].UUID
+ return testCase.expected[i].UUID < testCase.expected[j].UUID
})
if reflect.DeepEqual(testCase.expected, got) == false {
diff --git a/src/k8splugin/rb/definition_test.go b/src/k8splugin/rb/definition_test.go
index 6074f8b3..b3603136 100644
--- a/src/k8splugin/rb/definition_test.go
+++ b/src/k8splugin/rb/definition_test.go
@@ -149,12 +149,12 @@ func TestListDefinition(t *testing.T) {
// Since the order of returned slice is not guaranteed
// Check both and return error if both don't match
sort.Slice(got, func(i, j int) bool {
- return got[i].UUID < got[i].UUID
+ return got[i].UUID < got[j].UUID
})
// Sort both as it is not expected that testCase.expected
// is sorted
sort.Slice(testCase.expected, func(i, j int) bool {
- return testCase.expected[i].UUID < testCase.expected[i].UUID
+ return testCase.expected[i].UUID < testCase.expected[j].UUID
})
if reflect.DeepEqual(testCase.expected, got) == false {
diff --git a/src/k8splugin/rb/profile_test.go b/src/k8splugin/rb/profile_test.go
index a760830b..26b9747c 100644
--- a/src/k8splugin/rb/profile_test.go
+++ b/src/k8splugin/rb/profile_test.go
@@ -150,12 +150,12 @@ func TestListProfiles(t *testing.T) {
// Since the order of returned slice is not guaranteed
// Check both and return error if both don't match
sort.Slice(got, func(i, j int) bool {
- return got[i].UUID < got[i].UUID
+ return got[i].UUID < got[j].UUID
})
// Sort both as it is not expected that testCase.expected
// is sorted
sort.Slice(testCase.expected, func(i, j int) bool {
- return testCase.expected[i].UUID < testCase.expected[i].UUID
+ return testCase.expected[i].UUID < testCase.expected[j].UUID
})
if reflect.DeepEqual(testCase.expected, got) == false {