diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-12-04 21:57:43 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-12-04 21:57:43 +0100 |
commit | 4ba37b5833de99db9e9afe8928b31c864182405c (patch) | |
tree | 30662897c6ff3d608e47d22f8bab9ce8703b26e7 /src/memfile_test.c | |
parent | 2ab2e8608f9b2c85432715bb9a7f226fdbf8cd35 (diff) | |
download | vim-git-4ba37b5833de99db9e9afe8928b31c864182405c.tar.gz |
patch 8.1.2388: using old C style commentsv8.1.2388
Problem: Using old C style comments.
Solution: Use // comments where appropriate.
Diffstat (limited to 'src/memfile_test.c')
-rw-r--r-- | src/memfile_test.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/memfile_test.c b/src/memfile_test.c index 0a20330e6..a35261946 100644 --- a/src/memfile_test.c +++ b/src/memfile_test.c @@ -15,11 +15,11 @@ #undef NDEBUG #include <assert.h> -/* Must include main.c because it contains much more than just main() */ +// Must include main.c because it contains much more than just main() #define NO_VIM_MAIN #include "main.c" -/* This file has to be included because the tested functions are static */ +// This file has to be included because the tested functions are static #include "memfile.c" #define index_to_key(i) ((i) ^ 15167) @@ -39,21 +39,21 @@ test_mf_hash(void) mf_hash_init(&ht); - /* insert some items and check invariants */ + // insert some items and check invariants for (i = 0; i < TEST_COUNT; i++) { assert(ht.mht_count == i); - /* check that number of buckets is a power of 2 */ + // check that number of buckets is a power of 2 num_buckets = ht.mht_mask + 1; assert(num_buckets > 0 && (num_buckets & (num_buckets - 1)) == 0); - /* check load factor */ + // check load factor assert(ht.mht_count <= (num_buckets << MHT_LOG_LOAD_FACTOR)); if (i < (MHT_INIT_SIZE << MHT_LOG_LOAD_FACTOR)) { - /* first expansion shouldn't have occurred yet */ + // first expansion shouldn't have occurred yet assert(num_buckets == MHT_INIT_SIZE); assert(ht.mht_buckets == ht.mht_small_buckets); } @@ -66,7 +66,7 @@ test_mf_hash(void) key = index_to_key(i); assert(mf_hash_find(&ht, key) == NULL); - /* allocate and add new item */ + // allocate and add new item item = LALLOC_CLEAR_ONE(mf_hashitem_T); assert(item != NULL); item->mhi_key = key; @@ -76,13 +76,13 @@ test_mf_hash(void) if (ht.mht_mask + 1 != num_buckets) { - /* hash table was expanded */ + // hash table was expanded assert(ht.mht_mask + 1 == num_buckets * MHT_GROWTH_FACTOR); assert(i + 1 == (num_buckets << MHT_LOG_LOAD_FACTOR)); } } - /* check presence of inserted items */ + // check presence of inserted items for (i = 0; i < TEST_COUNT; i++) { key = index_to_key(i); @@ -91,7 +91,7 @@ test_mf_hash(void) assert(item->mhi_key == key); } - /* delete some items */ + // delete some items for (i = 0; i < TEST_COUNT; i++) { if (i % 100 < 70) @@ -114,7 +114,7 @@ test_mf_hash(void) } } - /* check again */ + // check again for (i = 0; i < TEST_COUNT; i++) { key = index_to_key(i); @@ -131,7 +131,7 @@ test_mf_hash(void) } } - /* free hash table and all remaining items */ + // free hash table and all remaining items mf_hash_free_all(&ht); } |