cpumanager: test: add missing helper
add back the missing AssertStateEqual helper; it is needed by some tests we still want to run. Signed-off-by: Francesco Romani <fromani@redhat.com>
This commit is contained in:
		@@ -18,6 +18,7 @@ package state
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"os"
 | 
						"os"
 | 
				
			||||||
 | 
						"reflect"
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
	"testing"
 | 
						"testing"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -397,3 +398,17 @@ func TestCheckpointStateClear(t *testing.T) {
 | 
				
			|||||||
		})
 | 
							})
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func AssertStateEqual(t *testing.T, sf State, sm State) {
 | 
				
			||||||
 | 
						cpusetSf := sf.GetDefaultCPUSet()
 | 
				
			||||||
 | 
						cpusetSm := sm.GetDefaultCPUSet()
 | 
				
			||||||
 | 
						if !cpusetSf.Equals(cpusetSm) {
 | 
				
			||||||
 | 
							t.Errorf("State CPUSet mismatch. Have %v, want %v", cpusetSf, cpusetSm)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						cpuassignmentSf := sf.GetCPUAssignments()
 | 
				
			||||||
 | 
						cpuassignmentSm := sm.GetCPUAssignments()
 | 
				
			||||||
 | 
						if !reflect.DeepEqual(cpuassignmentSf, cpuassignmentSm) {
 | 
				
			||||||
 | 
							t.Errorf("State CPU assignments mismatch. Have %s, want %s", cpuassignmentSf, cpuassignmentSm)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user