diff src/memfile_test.c @ 18800:f41b55f9357c v8.1.2388

patch 8.1.2388: using old C style comments Commit: https://github.com/vim/vim/commit/4ba37b5833de99db9e9afe8928b31c864182405c Author: Bram Moolenaar <Bram@vim.org> Date: Wed Dec 4 21:57:43 2019 +0100 patch 8.1.2388: using old C style comments Problem: Using old C style comments. Solution: Use // comments where appropriate.
author Bram Moolenaar <Bram@vim.org>
date Wed, 04 Dec 2019 22:00:04 +0100
parents aa9c4703a01b
children
line wrap: on
line diff
--- 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);
 }