TUN-2921: Rework address selection logic to avoid corner cases

This commit is contained in:
Igor Postelnik
2020-04-27 14:25:37 -05:00
parent c782716e49
commit 976eb24883
6 changed files with 57 additions and 13 deletions

View File

@@ -58,6 +58,7 @@ func TestRegions_Giveback_Region1(t *testing.T) {
rs.GiveBack(&addr0)
assert.Equal(t, &addr0, rs.GetUnusedAddr(nil, 3))
}
func TestRegions_Giveback_Region2(t *testing.T) {
rs := makeRegions()
rs.region1.Use(&addr0, 0)