Research portable Memory game | Исследовать портируемую игру Память
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README 5.9KB

8 months ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. Automated tests for uthash
  2. ==============================================================================
  3. Run "make" in this directory to build the tests and run them.
  4. test1: make 10-item hash, iterate and print each one
  5. test2: make 10-item hash, lookup items with even keys, print
  6. test3: make 10-item hash, delete items with even keys, print others
  7. test4: 10 structs have dual hash handles, separate keys
  8. test5: 10 structs have dual hash handles, lookup evens by alt key
  9. test6: test alt malloc macros (and alt key-comparison macro)
  10. test7: test alt malloc macros with 1000 structs so bucket expansion occurs
  11. test8: test num_items counter in UT_hash_handle
  12. test9: test "find" after bucket expansion
  13. test10: dual-hash handle test, bucket expansion on one and not the other
  14. test11: read dat file of names into hash, sort them and print
  15. test12: create hash with string keys, add 10 items, lookup each item
  16. test13: make 10-item hash, delete items with even keys, reverse print others
  17. test14: read dat file of names into hash, read file again and lookup each one
  18. test15: build string-keyed hash of 3 items, lookup one item (c.f. test40.c)
  19. test16: hash on aggregate key, iterate, lookup, using generalized macros
  20. test17: sort, add more items, sort again
  21. test18: test pathological HASH_DEL(a,a) scenario (single head,deletee variable)
  22. test19: sort two hash tables with shared elements using HASH_SRT
  23. test20: test a 5-byte "binary" key
  24. test21: test a structure key (userguide)
  25. test22: test multi-field key using flexible array member (userguide utf32)
  26. test23: test whether delete in iteration works
  27. test24: make 10-item hash and confirm item count (HASH_COUNT)
  28. test25: CDL / DL / LL tests
  29. test26: test the linked list sort macros in utlist.h
  30. test27: LL_APPEND, SORT
  31. test28: CDL / DL / LL tests
  32. test29: DL_APPEND, SORT
  33. test30: CDL_PREPEND, SORT
  34. test31: CDL_PREPEND, SORT
  35. test32: DL_PREPEND
  36. test33: LL_PREPEND
  37. test34: CDL_PREPEND
  38. test35: CDL_PREPEND
  39. test36: HASH_SELECT
  40. test37: HASH_CLEAR
  41. test38: find-or-add test on integer keys in short loop
  42. test39: HASH_ADD_KEYPTR then HASH_FIND using array element as key pointer
  43. test40: HASH_ADD_KEYPTR on string keys; pointer equivalent to test15.c
  44. test41: test LL_FOREACH_SAFE,DL_FOREACH_SAFE,CDL_FOREACH_SAFE
  45. test42: test LL_SEARCH, LL_SEARCH_SCALAR, and DL and CDL counterparts
  46. test43: test utarray with intpair objects
  47. test44: test utarray with int objects
  48. test45: test utarray with int objects
  49. test46: test utarray with char* objects
  50. test47: test utstring
  51. test48: test utarray of int
  52. test49: test utarray of str
  53. test50: test utarray of long
  54. test51: test utarray of intpair
  55. test52: test utarray of intchar
  56. test53: test utstring
  57. test54: test utstring
  58. test55: test utstring
  59. test56: test uthash, utlist and utstring together for #define conflicts etc
  60. test57: test uthash HASH_ADD_PTR and HASH_FIND_PTR
  61. test58: test HASH_ITER macro
  62. test59: sample of multi-level hash
  63. test60: sample of multi-level hash that also does HASH_DEL and free
  64. test61: test utarray_find
  65. test62: test macros used in safe unaligned reads on non-Intel type platforms
  66. test63: LL_CONCAT test
  67. test64: DL_CONCAT test
  68. test65: LRU cache example courtesy of jehiah.cz with modifications
  69. test66: test example where output variable to HASH_FIND needs extra parens
  70. test67: test utarray_prev
  71. test68: test DL_REPLACE_ELEM (Zoltán Lajos Kis)
  72. test69: test DL_PREPEND_ELEM (Zoltán Lajos Kis)
  73. test70: test LL_REPLACE_ELEM (Zoltán Lajos Kis)
  74. test71: test LL_PREPEND_ELEM (Zoltán Lajos Kis)
  75. test72: test CDL_REPLACE_ELEM (Zoltán Lajos Kis)
  76. test73: test CDL_PREPEND_ELEM (Zoltán Lajos Kis)
  77. test74: test utstring with utstring_find (Joe Wei)
  78. test75: test utstring with utstring_findR (Joe Wei)
  79. test76: test utstring with _utstring_find (Joe Wei)
  80. test77: test utstring with _utstring_findR (Joe Wei)
  81. test78: test utlist "2" family with flexible Prev/Next naming eg. DL_DELETE2
  82. test79: test HASH_REPLACE
  83. test80: test utarray_insert past end of array
  84. test81: test utarray_insert past end of array
  85. test82: test utarray_inserta past end of array
  86. test83: test HASH_REPLACE_STR with char[] key
  87. test84: test HASH_REPLACE_STR with char* key
  88. test85: test HASH_OVERHEAD on null and non null hash
  89. test86: test *_APPEND_ELEM / *_PREPEND_ELEM (Thilo Schulz)
  90. test87: test HASH_ADD_INORDER() macro (Thilo Schulz)
  91. test88: test alt key-comparison and strlen macros
  92. test89: test code from the tinydtls project
  93. test90: regression-test HASH_ADD_KEYPTR_INORDER (IronBug)
  94. test91: test LL_INSERT_INORDER etc.
  95. test92: HASH_NONFATAL_OOM
  96. test93: alt_fatal
  97. test94: utlist with fields named other than 'next' and 'prev'
  98. test95: utstack
  99. test96: HASH_FUNCTION + HASH_KEYCMP
  100. Other Make targets
  101. ================================================================================
  102. pedantic: makes the tests with extra CFLAGS for pedantic compiling
  103. cplusplus: compiles all the C tests using the C++ compiler to test compatibility
  104. debug: makes the tests with debugging symbols and no optimization
  105. example: builds the 'example' program from the user guide
  106. ================================================================================
  107. Testing a specific hash function
  108. --------------------------------
  109. Set EXTRA_CFLAGS with this Makefile to use a specific hash function:
  110. EXTRA_CFLAGS=-DHASH_FUNCTION=HASH_BER make
  111. Other files
  112. ================================================================================
  113. keystats: key statistics analyzer. See the uthash User Guide.
  114. emit_keys: reads a data file of unique strings, emits as keys w/HASH_EMIT_KEYS=1
  115. all_funcs: a script which executes the test suite with every hash function
  116. win32tests:builds and runs the test suite under Microsoft Visual Studio
  117. LINUX/FREEBSD
  118. -------------
  119. hashscan: tool to examine a running process and get info on its hash tables
  120. test_sleep:used as a subject for inspection by hashscan
  121. Manual performance testing
  122. ================================================================================
  123. # test performance characteristics on keys that are English dictionary words
  124. emit_keys /usr/share/dict/words > words.keys
  125. ./keystats words.keys