Advertisement
Guest User

Untitled

a guest
Nov 19th, 2017
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. animeshf@ubuntu:~/Desktop/HW10$ make run-valgrind
  2. gcc -std=c99 -pedantic -Wall -Werror -Wextra -g -DDEBUG test.o list.o -o test
  3. valgrind --leak-check=yes --show-reachable=yes --tool=memcheck ./test
  4. ==13976== Memcheck, a memory error detector
  5. ==13976== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
  6. ==13976== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
  7. ==13976== Command: ./test
  8. ==13976==
  9.  
  10. TEST CASE 1
  11. An empty list should have size 0:
  12. Size: 0
  13.  
  14. TEST CASE 2
  15. After adding one element, size should be 1:
  16. Size: 1
  17.  
  18. TEST CASE 3
  19. Traversal should print the one element:
  20. Andrew, 26
  21.  
  22. TEST CASE 4
  23. The one element should be the front and back:
  24. Andrew, 26
  25. Andrew, 26
  26.  
  27. TEST CASE 5
  28. Andrew should be contained in the list:
  29. Andrew is in list
  30.  
  31. TEST CASE 6
  32. Collin should not be contained in the list:
  33. Collin isn't in list
  34.  
  35. TEST CASE 7
  36. Pop Andrew from the front...
  37. Success!
  38.  
  39. TEST CASE 8
  40. Add Collin, pop from the back...
  41. Size is 0
  42. Success!
  43.  
  44. TEST CASE 9
  45. There should be 7 elements in this list:
  46. Size: 7
  47.  
  48. TEST CASE 10
  49. Front should be last element pushed to front (Leahy):
  50. Leahy, 66
  51.  
  52. TEST CASE 11
  53. Last element pushed (Nick):
  54. Nick, 23
  55.  
  56. TEST CASE 12
  57. The person at index 2 should be Andrew:
  58. Andrew, 25
  59.  
  60. TEST CASE 13
  61. There should be someone age 24 in the list:
  62. Clayton, 24
  63.  
  64. TEST CASE 14
  65. There should be nobody age 30 in the list:
  66. Success!
  67.  
  68. TEST CASE 15
  69. Popping front twice leaves a size 5 list:
  70. Size: 5
  71.  
  72. TEST CASE 16
  73. Print the 5 elements from the list:
  74. Andrew, 25
  75. Clayton, 24
  76. Marie, 22
  77. Henry, 21
  78. Nick, 23
  79.  
  80. TEST CASE 20
  81. Let's try making a deep copy of a list of 4 people:
  82. Original:
  83. Shayan, 22
  84. Patrick, 19
  85. Brandi, 21
  86. Baijun, 20
  87. Copy:
  88. Shayan, 22
  89. Patrick, 19
  90. Brandi, 21
  91. Baijun, 20
  92.  
  93. TEST CASE 21
  94. After emptying first list, second should persist:
  95. Shayan, 22
  96. Patrick, 19
  97. Brandi, 21
  98. Baijun, 20
  99.  
  100. TEST CASE 22
  101. shallow copy test, both data pointers should be the same
  102.  
  103. TEST CASE 23
  104. reverse test
  105.  
  106. TEST CASE 24
  107. concat test
  108.  
  109. TEST CASE 25
  110. Passing in null lists to functions should return 0...
  111. Success!
  112.  
  113. Make sure to write more test cases as well in test.c! The ones given are NOT comprehensive.
  114. Also test using valgrind. No credit will be given to functions with memory leaks or memory errors.
  115. ==13976==
  116. ==13976== HEAP SUMMARY:
  117. ==13976== in use at exit: 0 bytes in 0 blocks
  118. ==13976== total heap usage: 109 allocs, 109 frees, 2,602 bytes allocated
  119. ==13976==
  120. ==13976== All heap blocks were freed -- no leaks are possible
  121. ==13976==
  122. ==13976== For counts of detected and suppressed errors, rerun with: -v
  123. ==13976== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement