7
7
)
8
8
9
9
func TestNewMapping (t * testing.T ) {
10
- guid .Init (16 ) // Use 16-bit GUID to be easily tested
10
+ guid .Init (16 , 1 , 1 ) // Use 16-bit GUID to be easily tested
11
11
resMap := NewResourcesMap (testPartitions )
12
12
13
13
for i := range resMap .resourcesGUIDMap {
@@ -22,7 +22,7 @@ func TestNewMapping(t *testing.T) {
22
22
}
23
23
24
24
func TestRandGUIDSearch_1 (t * testing.T ) {
25
- guid .Init (16 ) // Use 16-bit GUID to be easily tested
25
+ guid .Init (16 , 1 , 1 ) // Use 16-bit GUID to be easily tested
26
26
resMap := NewResourcesMap (testPartitions )
27
27
28
28
for i := 0 ; i < 100000 ; i ++ {
@@ -36,7 +36,7 @@ func TestRandGUIDSearch_1(t *testing.T) {
36
36
}
37
37
38
38
func TestRandGUIDSearch_2 (t * testing.T ) {
39
- guid .Init (16 ) // Use 16-bit GUID to be easily tested
39
+ guid .Init (16 , 1 , 1 ) // Use 16-bit GUID to be easily tested
40
40
resMap := NewResourcesMap (testPartitions )
41
41
42
42
for i := 0 ; i < 100000 ; i ++ {
@@ -50,7 +50,7 @@ func TestRandGUIDSearch_2(t *testing.T) {
50
50
}
51
51
52
52
func TestRandGUIDSearch_3 (t * testing.T ) {
53
- guid .Init (16 ) // Use 16-bit GUID to be easily tested
53
+ guid .Init (16 , 1 , 1 ) // Use 16-bit GUID to be easily tested
54
54
resMap := NewResourcesMap (testPartitions )
55
55
56
56
for i := 0 ; i < 100000 ; i ++ {
@@ -64,7 +64,7 @@ func TestRandGUIDSearch_3(t *testing.T) {
64
64
}
65
65
66
66
func TestRandGUIDSearch_4 (t * testing.T ) {
67
- guid .Init (16 ) // Use 16-bit GUID to be easily tested
67
+ guid .Init (16 , 1 , 1 ) // Use 16-bit GUID to be easily tested
68
68
resMap := NewResourcesMap (testPartitions )
69
69
70
70
for i := 0 ; i < 100000 ; i ++ {
@@ -78,7 +78,7 @@ func TestRandGUIDSearch_4(t *testing.T) {
78
78
}
79
79
80
80
func TestRandGUIDSearch_5 (t * testing.T ) {
81
- guid .Init (16 ) // Use 16-bit GUID to be easily tested
81
+ guid .Init (16 , 1 , 1 ) // Use 16-bit GUID to be easily tested
82
82
resMap := NewResourcesMap (testPartitions )
83
83
84
84
randGUID , err := resMap .RandGUIDFittestSearch (* NewResourcesCPUClass (0 , 1 , 1512 ))
@@ -90,7 +90,7 @@ func TestRandGUIDSearch_5(t *testing.T) {
90
90
}
91
91
92
92
func TestRandGUIDSearch_6 (t * testing.T ) {
93
- guid .Init (16 ) // Use 16-bit GUID to be easily tested
93
+ guid .Init (16 , 1 , 1 ) // Use 16-bit GUID to be easily tested
94
94
resMap := NewResourcesMap (testPartitions )
95
95
96
96
randGUID , err := resMap .RandGUIDFittestSearch (* NewResourcesCPUClass (1 , 2 , 1512 ))
@@ -102,7 +102,7 @@ func TestRandGUIDSearch_6(t *testing.T) {
102
102
}
103
103
104
104
func TestFirstGUIDOffer (t * testing.T ) {
105
- guid .Init (16 ) // Use 16-bit GUID to be easily tested
105
+ guid .Init (16 , 1 , 1 ) // Use 16-bit GUID to be easily tested
106
106
resMap := NewResourcesMap (testPartitions )
107
107
108
108
targetResources := []Resources {
@@ -130,7 +130,7 @@ func TestFirstGUIDOffer(t *testing.T) {
130
130
}
131
131
132
132
func TestLowestResources (t * testing.T ) {
133
- guid .Init (16 ) // Use 16-bit GUID to be easily tested
133
+ guid .Init (16 , 1 , 1 ) // Use 16-bit GUID to be easily tested
134
134
resMap := NewResourcesMap (testPartitions )
135
135
136
136
lowestResources := * resMap .LowestResources ()
@@ -139,7 +139,7 @@ func TestLowestResources(t *testing.T) {
139
139
}
140
140
141
141
func TestHigherRandomGUIDSearch_1 (t * testing.T ) {
142
- guid .Init (16 ) // Use 16-bit GUID to be easily tested
142
+ guid .Init (16 , 1 , 1 ) // Use 16-bit GUID to be easily tested
143
143
resMap := NewResourcesMap (testPartitions )
144
144
145
145
randGUID , err := resMap .HigherRandGUIDSearch (* guid .NewGUIDInteger (5000 ), * NewResourcesCPUClass (0 , 1 , 256 ))
@@ -196,15 +196,15 @@ func TestHigherRandomGUIDSearch_1(t *testing.T) {
196
196
}
197
197
198
198
func TestHigherRandomGUIDSearch_2 (t * testing.T ) {
199
- guid .Init (16 ) // Use 16-bit GUID to be easily tested
199
+ guid .Init (16 , 1 , 1 ) // Use 16-bit GUID to be easily tested
200
200
resMap := NewResourcesMap (testPartitions )
201
201
202
202
_ , err := resMap .HigherRandGUIDSearch (* guid .NewGUIDInteger (64000 ), * NewResourcesCPUClass (0 , 1 , 256 ))
203
203
assert .Error (t , err , "" )
204
204
}
205
205
206
206
func TestHigherRandomGUIDSearch_3 (t * testing.T ) {
207
- guid .Init (16 ) // Use 16-bit GUID to be easily tested
207
+ guid .Init (16 , 1 , 1 ) // Use 16-bit GUID to be easily tested
208
208
resMap := NewResourcesMap (testPartitions )
209
209
210
210
randGUID , err := resMap .HigherRandGUIDSearch (* guid .NewGUIDInteger (12287 ), * NewResourcesCPUClass (0 , 1 , 550 ))
@@ -247,7 +247,7 @@ func TestHigherRandomGUIDSearch_3(t *testing.T) {
247
247
}
248
248
249
249
func TestLowerRandomGUID_1 (t * testing.T ) {
250
- guid .Init (16 ) // Use 16-bit GUID to be easily tested
250
+ guid .Init (16 , 1 , 1 ) // Use 16-bit GUID to be easily tested
251
251
resMap := NewResourcesMap (testPartitions )
252
252
253
253
randGUID , err := resMap .LowerRandGUIDOffer (* guid .NewGUIDInteger (12287 ), * NewResourcesCPUClass (0 , 1 , 1024 ))
@@ -269,7 +269,7 @@ func TestLowerRandomGUID_1(t *testing.T) {
269
269
}
270
270
271
271
func TestLowerRandomGUIDOffer_2 (t * testing.T ) {
272
- guid .Init (16 ) // Use 16-bit GUID to be easily tested
272
+ guid .Init (16 , 1 , 1 ) // Use 16-bit GUID to be easily tested
273
273
resMap := NewResourcesMap (testPartitions )
274
274
275
275
randGUID , err := resMap .LowerRandGUIDOffer (* guid .NewGUIDInteger (20000 ), * NewResourcesCPUClass (0 , 2 , 2500 ))
@@ -298,7 +298,7 @@ func TestLowerRandomGUIDOffer_2(t *testing.T) {
298
298
}
299
299
300
300
func TestLowerRandomGUIDOffer_3 (t * testing.T ) {
301
- guid .Init (16 ) // Use 16-bit GUID to be easily tested
301
+ guid .Init (16 , 1 , 1 ) // Use 16-bit GUID to be easily tested
302
302
resMap := NewResourcesMap (testPartitions )
303
303
304
304
randGUID , err := resMap .LowerRandGUIDOffer (* guid .NewGUIDInteger (15000 ), * NewResourcesCPUClass (0 , 2 , 1512 ))
@@ -320,7 +320,7 @@ func TestLowerRandomGUIDOffer_3(t *testing.T) {
320
320
}
321
321
322
322
func TestLowerRandomGUIDOffer_4 (t * testing.T ) {
323
- guid .Init (16 ) // Use 16-bit GUID to be easily tested
323
+ guid .Init (16 , 1 , 1 ) // Use 16-bit GUID to be easily tested
324
324
resMap := NewResourcesMap (testPartitions )
325
325
326
326
randGUID , err := resMap .LowerRandGUIDOffer (* guid .NewGUIDInteger (35000 ), * NewResourcesCPUClass (1 , 1 , 1512 ))
@@ -349,7 +349,7 @@ func TestLowerRandomGUIDOffer_4(t *testing.T) {
349
349
}
350
350
351
351
func TestLowerRandomGUIDOffer_5 (t * testing.T ) {
352
- guid .Init (16 ) // Use 16-bit GUID to be easily tested
352
+ guid .Init (16 , 1 , 1 ) // Use 16-bit GUID to be easily tested
353
353
resMap := NewResourcesMap (testPartitions )
354
354
355
355
randGUID , err := resMap .LowerRandGUIDOffer (* guid .NewGUIDInteger (50000 ), * NewResourcesCPUClass (1 , 2 , 2049 ))
@@ -399,7 +399,7 @@ func TestLowerRandomGUIDOffer_5(t *testing.T) {
399
399
}
400
400
401
401
func TestLowerPartitionsOffer_1 (t * testing.T ) {
402
- guid .Init (16 ) // Use 16-bit GUID to be easily tested
402
+ guid .Init (16 , 1 , 1 ) // Use 16-bit GUID to be easily tested
403
403
resMap := NewResourcesMap (testPartitions )
404
404
405
405
res , err := resMap .LowerPartitionsOffer (* NewResourcesCPUClass (0 , 1 , 512 ))
@@ -410,7 +410,7 @@ func TestLowerPartitionsOffer_1(t *testing.T) {
410
410
}
411
411
412
412
func TestLowerPartitionsOffer_2 (t * testing.T ) {
413
- guid .Init (16 ) // Use 16-bit GUID to be easily tested
413
+ guid .Init (16 , 1 , 1 ) // Use 16-bit GUID to be easily tested
414
414
resMap := NewResourcesMap (testPartitions )
415
415
416
416
res , err := resMap .LowerPartitionsOffer (* NewResourcesCPUClass (0 , 1 , 750 ))
@@ -421,7 +421,7 @@ func TestLowerPartitionsOffer_2(t *testing.T) {
421
421
}
422
422
423
423
func TestLowerPartitionsOffer_3 (t * testing.T ) {
424
- guid .Init (16 ) // Use 16-bit GUID to be easily tested
424
+ guid .Init (16 , 1 , 1 ) // Use 16-bit GUID to be easily tested
425
425
resMap := NewResourcesMap (testPartitions )
426
426
427
427
res , err := resMap .LowerPartitionsOffer (* NewResourcesCPUClass (0 , 1 , 1550 ))
@@ -432,7 +432,7 @@ func TestLowerPartitionsOffer_3(t *testing.T) {
432
432
}
433
433
434
434
func TestLowerPartitionsOffer_4 (t * testing.T ) {
435
- guid .Init (16 ) // Use 16-bit GUID to be easily tested
435
+ guid .Init (16 , 1 , 1 ) // Use 16-bit GUID to be easily tested
436
436
resMap := NewResourcesMap (testPartitions )
437
437
438
438
res , err := resMap .LowerPartitionsOffer (* NewResourcesCPUClass (0 , 2 , 1550 ))
@@ -443,7 +443,7 @@ func TestLowerPartitionsOffer_4(t *testing.T) {
443
443
}
444
444
445
445
func TestLowerPartitionsOffer_5 (t * testing.T ) {
446
- guid .Init (16 ) // Use 16-bit GUID to be easily tested
446
+ guid .Init (16 , 1 , 1 ) // Use 16-bit GUID to be easily tested
447
447
resMap := NewResourcesMap (testPartitions )
448
448
449
449
res , err := resMap .LowerPartitionsOffer (* NewResourcesCPUClass (0 , 2 , 2049 ))
@@ -454,7 +454,7 @@ func TestLowerPartitionsOffer_5(t *testing.T) {
454
454
}
455
455
456
456
func TestLowerPartitionsOffer_6 (t * testing.T ) {
457
- guid .Init (16 ) // Use 16-bit GUID to be easily tested
457
+ guid .Init (16 , 1 , 1 ) // Use 16-bit GUID to be easily tested
458
458
resMap := NewResourcesMap (testPartitions )
459
459
460
460
res , err := resMap .LowerPartitionsOffer (* NewResourcesCPUClass (1 , 2 , 2049 ))
0 commit comments