Skip to content

Commit b1dab28

Browse files
committed
Update test_maps.f90
Minor cleanup
1 parent 0b31288 commit b1dab28

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

test/hashmaps/test_maps.f90

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,15 @@ subroutine run_hashmap_tests(error, map, name, hasher)
146146
end select
147147

148148
! Set key to a new value
149-
call map % set_other_data( key, (i+test_size), exists )
149+
call map % set_other_data( key, -i, exists )
150150
call check(error, exists, "Failure on key interface set_other_data for"//trim(name))
151151

152152
! Get updated value and verify it is correct.
153153
call map % get_other_data( key, data, exists )
154154
call check(error, exists, "Failure on key interface for get_other_data after set_other_data for"//trim(name))
155155
select type(data)
156156
type is (integer)
157-
call check(error, data == (i+test_size), "Failure on key interface set_other_data data check for"//trim(name))
157+
call check(error, data == -i, "Failure on key interface set_other_data data check for"//trim(name))
158158
class default
159159
call test_failed(error, "Key interface set_other_data get_other_data didn't return an integer for "//trim(name))
160160
end select
@@ -167,7 +167,7 @@ subroutine run_hashmap_tests(error, map, name, hasher)
167167
call map%get_all_keys(keys)
168168
call check(error, size(keys) == test_size, "Failure on key interface for get_all_keys for "//trim(name))
169169

170-
! Check remove and get all keys function
170+
! Check key remove
171171
do i = 1, test_size
172172
call set(key, [i])
173173

@@ -211,15 +211,15 @@ subroutine run_hashmap_tests(error, map, name, hasher)
211211
end select
212212

213213
! Set key to a new value
214-
call map % set_other_data( key_array, (i+test_size), exists )
214+
call map % set_other_data( key_array, -i, exists )
215215
call check(error, exists, "Failure on int8 interface set_other_data for"//trim(name))
216216

217217
! Get updated value and verify it is correct.
218218
call map % get_other_data( key_array, data, exists )
219219
call check(error, exists, "Failure on int8 interface for get_other_data after set_other_data for"//trim(name))
220220
select type(data)
221221
type is (integer)
222-
call check(error, data == (i+test_size), &
222+
call check(error, data == -i, &
223223
"Failure on int8 interface set_other_data data check for"//trim(name))
224224
class default
225225
call test_failed(error, &
@@ -234,7 +234,7 @@ subroutine run_hashmap_tests(error, map, name, hasher)
234234
call map%get_all_keys(keys)
235235
call check(error, size(keys) == test_size, "Failure on int8 interface for get_all_keys for "//trim(name))
236236

237-
! Check remove and get all keys function
237+
! Check key remove
238238
do i = 1, test_size
239239
key_array = transfer(i,key_array)
240240

@@ -279,15 +279,15 @@ subroutine run_hashmap_tests(error, map, name, hasher)
279279
end select
280280

281281
! Set key to a new value
282-
call map % set_other_data( key_array, (i+test_size), exists )
282+
call map % set_other_data( key_array, -i, exists )
283283
call check(error, exists, "Failure on int32 interface set_other_data for"//trim(name))
284284

285285
! Get updated value and verify it is correct.
286286
call map % get_other_data( key_array, data, exists )
287287
call check(error, exists, "Failure on int32 interface for get_other_data after set_other_data for"//trim(name))
288288
select type(data)
289289
type is (integer)
290-
call check(error, data == (i+test_size), &
290+
call check(error, data == -i, &
291291
"Failure on int32 interface set_other_data data check for"//trim(name))
292292
class default
293293
call test_failed(error, &
@@ -301,7 +301,7 @@ subroutine run_hashmap_tests(error, map, name, hasher)
301301
call map%get_all_keys(keys)
302302
call check(error, size(keys) == test_size, "Failure on int32 interface for get_all_keys for "//trim(name))
303303

304-
! Check remove and get all keys function
304+
! Check key remove
305305
do i = 1, test_size
306306
key_array = i
307307

@@ -347,7 +347,7 @@ subroutine run_hashmap_tests(error, map, name, hasher)
347347
end select
348348

349349
! Set key to a new value
350-
call map % set_other_data( char_key, (i+test_size), exists )
350+
call map % set_other_data( char_key, -i, exists )
351351
call check(error, exists, "Failure on char interface set_other_data for"//trim(name))
352352

353353
! Get updated value and verify it is correct.
@@ -356,7 +356,7 @@ subroutine run_hashmap_tests(error, map, name, hasher)
356356
"Failure on char interface for get_other_data after set_other_data for"//trim(name))
357357
select type(data)
358358
type is (integer)
359-
call check(error, data == (i+test_size), &
359+
call check(error, data == -i, &
360360
"Failure on char interface set_other_data data check for"//trim(name))
361361
class default
362362
call test_failed(error, &
@@ -370,7 +370,7 @@ subroutine run_hashmap_tests(error, map, name, hasher)
370370
call map%get_all_keys(keys)
371371
call check(error, size(keys) == test_size, "Failure on char interface for get_all_keys for "//trim(name))
372372

373-
! Check remove and get all keys function
373+
! Check key remove
374374
do i = 1, test_size
375375
write(char_key, '(I0)') i
376376

@@ -409,7 +409,7 @@ subroutine run_hashmap_tests(error, map, name, hasher)
409409
end select
410410
enddo
411411

412-
! Check miscellaneous functions calls
412+
! Check miscellaneous functions
413413
block
414414
real :: ratio
415415
integer :: num_slots, nprobes, depth, bits

0 commit comments

Comments
 (0)