Add numerical ids manager

Signed-off-by: Alessandro Boch <aboch@docker.com>
This commit is contained in:
Alessandro Boch
2015-06-17 16:46:05 -07:00
parent eb66d4456e
commit b512536cb3
5 changed files with 194 additions and 13 deletions
+2 -2
View File
@@ -127,7 +127,7 @@ func TestGetFirstAvailable(t *testing.T) {
}
for n, i := range input {
bytePos, bitPos := GetFirstAvailable(i.mask)
bytePos, bitPos, _ := GetFirstAvailable(i.mask)
if bytePos != i.bytePos || bitPos != i.bitPos {
t.Fatalf("Error in (%d) getFirstAvailable(). Expected (%d, %d). Got (%d, %d)", n, i.bytePos, i.bitPos, bytePos, bitPos)
}
@@ -201,7 +201,7 @@ func TestCheckIfAvailable(t *testing.T) {
}
for n, i := range input {
bytePos, bitPos := CheckIfAvailable(i.head, i.ordinal)
bytePos, bitPos, _ := CheckIfAvailable(i.head, i.ordinal)
if bytePos != i.bytePos || bitPos != i.bitPos {
t.Fatalf("Error in (%d) checkIfAvailable(ord:%d). Expected (%d, %d). Got (%d, %d)", n, i.ordinal, i.bytePos, i.bitPos, bytePos, bitPos)
}