adding cs235

This commit is contained in:
dm
2016-04-06 20:46:10 -07:00
parent 8e52ce1982
commit cf99ec6565
178 changed files with 13079 additions and 0 deletions
+661
View File
@@ -0,0 +1,661 @@
{
Dynamic Linker Bug
Memcheck:Cond
fun:_dl_relocate_object
fun:dl_main
fun:_dl_sysdep_start
fun:_dl_start
obj:/lib/ld-2.6.so
}
{
<insert a suppression name here>
Memcheck:Cond
fun:strlen
fun:_ZNSsC1EPKcRKSaIcE
fun:_Z11generateKeyv
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z12CompareListsRK10LinkedListRSt4listISsSaISsEE
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z12CompareListsRK10LinkedListRSt4listISsSaISsEE
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z12CompareListsRK10LinkedListRSt4listISsSaISsEE
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z12CompareListsRK10LinkedListRSt4listISsSaISsEE
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z12CompareListsRK10LinkedListRSt4listISsSaISsEE
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZSteqIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_ZNK10LinkedList4FindERKSsP6LLNode
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZSteqIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_ZNK10LinkedList4FindERKSsP6LLNode
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:strlen
fun:_ZNSsC1EPKcRKSaIcE
fun:_Z11generateKeyv
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZSteqIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_ZNK10LinkedList4FindERKSsP6LLNode
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZSteqIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_ZSt6__findISt14_List_iteratorISsESsET_S2_S2_RKT0_St18input_iterator_tag
fun:_ZSt4findISt14_List_iteratorISsESsET_S2_S2_RKT0_
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZSteqIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_ZNK10LinkedList4FindERKSsP6LLNode
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:strlen
fun:_ZNSsC1EPKcRKSaIcE
fun:_Z11generateKeyv
fun:_Z7TestBSTb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z7TestBSTb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZSteqIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZSteqIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z7TestBSTb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:strlen
fun:_ZNSsC1EPKcRKSaIcE
fun:_Z11generateKeyv
fun:_Z7TestBSTb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
}
{
<insert a suppression name here>
Memcheck:Cond
fun:strlen
fun:_ZNSsC1EPKcRKSaIcE
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStltIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStltIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
}
{
<insert a suppression name here>
Memcheck:Cond
fun:strlen
fun:_ZNSsC1EPKcRKSaIcE
fun:_Z11generateKeyv
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z12CompareListsRK10LinkedListRSt4listISsSaISsEE
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z12CompareListsRK10LinkedListRSt4listISsSaISsEE
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z12CompareListsRK10LinkedListRSt4listISsSaISsEE
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z12CompareListsRK10LinkedListRSt4listISsSaISsEE
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZNK10LinkedList4FindERKSsP6LLNode
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZNK10LinkedList4FindERKSsP6LLNode
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:strlen
fun:_ZNSsC1EPKcRKSaIcE
fun:_Z11generateKeyv
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZSteqIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZNK10LinkedList4FindERKSsP6LLNode
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:strlen
fun:_ZNSsC1EPKcRKSaIcE
fun:_Z11generateKeyv
fun:_Z7TestBSTb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z7TestBSTb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z7TestBSTb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:strlen
fun:_ZNSsC1EPKcRKSaIcE
fun:_Z11generateKeyv
fun:_Z7TestBSTb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
}
{
<insert a suppression name here>
Memcheck:Cond
fun:strlen
fun:_ZNSsC1EPKcRKSaIcE
fun:_Z11generateKeyv
fun:_Z7TestBSTb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStltIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
}
{
<insert a suppression name here>
Memcheck:Cond
fun:strlen
fun:_ZNSsC1EPKcRKSaIcE
fun:_Z11generateKeyv
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z12CompareListsRK10LinkedListRSt4listISsSaISsEE
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z12CompareListsRK10LinkedListRSt4listISsSaISsEE
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z12CompareListsRK10LinkedListRSt4listISsSaISsEE
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z12CompareListsRK10LinkedListRSt4listISsSaISsEE
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z12CompareListsRK10LinkedListRSt4listISsSaISsEE
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZSteqIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZSteqIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
}
{
<insert a suppression name here>
Memcheck:Cond
fun:strlen
fun:_ZNSsC1EPKcRKSaIcE
fun:_Z11generateKeyv
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZSteqIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZSteqIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_ZSt6__findISt14_List_iteratorISsESsET_S2_S2_RKT0_St18input_iterator_tag
fun:_ZSt4findISt14_List_iteratorISsESsET_S2_S2_RKT0_
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_Z14TestLinkedListb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:_ZNKSs7compareERKSs
fun:_ZSteqIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
}
{
<insert a suppression name here>
Memcheck:Cond
fun:strlen
fun:_ZNSsC1EPKcRKSaIcE
fun:_Z11generateKeyv
fun:_Z7TestBSTb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:strlen
fun:_ZNSsC1EPKcRKSaIcE
fun:_Z11generateKeyv
fun:_Z7TestBSTb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:strlen
fun:_ZNSsC1EPKcRKSaIcE
fun:_Z11generateKeyv
fun:_Z7TestBSTb
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:bcmp
fun:_ZNSt11char_traitsIcE7compareEPKcS2_j
fun:_ZSteqIcEN9__gnu_cxx11__enable_ifIXsrSt9__is_charIT_E7__valueEbE6__typeERKSbIS3_St11char_traitsIS3_ESaIS3_EESC_
fun:_ZStneIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_
fun:_ZN3tut12_GLOBAL__N_113ensure_equalsISsSsEEvPKcRKT0_RKT_
fun:_ZN7BSTTest7initBSTER3BST
fun:_ZN3tut11test_objectI7BSTTestE4testILi2EEEvv
fun:_ZN3tut10test_groupI7BSTTestLi50EE13run_test_seh_EMNS_11test_objectIS1_EEFvvERNS2_11safe_holderIS4_EERSs
fun:_ZN3tut10test_groupI7BSTTestLi50EE9run_test_ERKSt17_Rb_tree_iteratorISt4pairIKiMNS_11test_objectIS1_EEFvvEEERNS2_11safe_holderIS7_EE
fun:_ZN3tut10test_groupI7BSTTestLi50EE8run_nextEv
fun:_ZNK3tut11test_runner23run_all_tests_in_group_ESt23_Rb_tree_const_iteratorISt4pairIKSsPNS_10group_baseEEE
fun:_ZNK3tut11test_runner9run_testsEv
}
{
<insert a suppression name here>
Memcheck:Cond
fun:bcmp
fun:_ZNSt11char_traitsIcE7compareEPKcS2_j
fun:_ZSteqIcEN9__gnu_cxx11__enable_ifIXsrSt9__is_charIT_E7__valueEbE6__typeERKSbIS3_St11char_traitsIS3_ESaIS3_EESC_
fun:_ZNK10LinkedList4FindERKSsP6LLNode
fun:_ZN3tut11test_objectI14LinkedListTestE4testILi8EEEvv
fun:_ZN3tut10test_groupI14LinkedListTestLi50EE13run_test_seh_EMNS_11test_objectIS1_EEFvvERNS2_11safe_holderIS4_EERSs
fun:_ZN3tut10test_groupI14LinkedListTestLi50EE9run_test_ERKSt17_Rb_tree_iteratorISt4pairIKiMNS_11test_objectIS1_EEFvvEEERNS2_11safe_holderIS7_EE
fun:_ZN3tut10test_groupI14LinkedListTestLi50EE8run_nextEv
fun:_ZNK3tut11test_runner23run_all_tests_in_group_ESt23_Rb_tree_const_iteratorISt4pairIKSsPNS_10group_baseEEE
fun:_ZNK3tut11test_runner9run_testsEv
fun:_Z3runRKSsi
fun:main
}
{
<insert a suppression name here>
Memcheck:Cond
fun:bcmp
fun:_ZNSt11char_traitsIcE7compareEPKcS2_j
fun:_ZSteqIcEN9__gnu_cxx11__enable_ifIXsrSt9__is_charIT_E7__valueEbE6__typeERKSbIS3_St11char_traitsIS3_ESaIS3_EESC_
fun:_ZSt6__findISt14_List_iteratorISsESsET_S2_S2_RKT0_St18input_iterator_tag
fun:_ZSt4findISt14_List_iteratorISsESsET_S2_S2_RKT0_
fun:_ZN3tut11test_objectI14LinkedListTestE4testILi9EEEvv
fun:_ZN3tut10test_groupI14LinkedListTestLi50EE13run_test_seh_EMNS_11test_objectIS1_EEFvvERNS2_11safe_holderIS4_EERSs
fun:_ZN3tut10test_groupI14LinkedListTestLi50EE9run_test_ERKSt17_Rb_tree_iteratorISt4pairIKiMNS_11test_objectIS1_EEFvvEEERNS2_11safe_holderIS7_EE
fun:_ZN3tut10test_groupI14LinkedListTestLi50EE8run_nextEv
fun:_ZNK3tut11test_runner23run_all_tests_in_group_ESt23_Rb_tree_const_iteratorISt4pairIKSsPNS_10group_baseEEE
fun:_ZNK3tut11test_runner9run_testsEv
fun:_Z3runRKSsi
}
{
<insert a suppression name here>
Memcheck:Cond
fun:bcmp
fun:_ZNSt11char_traitsIcE7compareEPKcS2_j
fun:_ZSteqIcEN9__gnu_cxx11__enable_ifIXsrSt9__is_charIT_E7__valueEbE6__typeERKSbIS3_St11char_traitsIS3_ESaIS3_EESC_
fun:_ZN3tut11test_objectI14LinkedListTestE4testILi9EEEvv
fun:_ZN3tut10test_groupI14LinkedListTestLi50EE13run_test_seh_EMNS_11test_objectIS1_EEFvvERNS2_11safe_holderIS4_EERSs
fun:_ZN3tut10test_groupI14LinkedListTestLi50EE9run_test_ERKSt17_Rb_tree_iteratorISt4pairIKiMNS_11test_objectIS1_EEFvvEEERNS2_11safe_holderIS7_EE
fun:_ZN3tut10test_groupI14LinkedListTestLi50EE8run_nextEv
fun:_ZNK3tut11test_runner23run_all_tests_in_group_ESt23_Rb_tree_const_iteratorISt4pairIKSsPNS_10group_baseEEE
fun:_ZNK3tut11test_runner9run_testsEv
fun:_Z3runRKSsi
fun:main
}
+16
View File
@@ -0,0 +1,16 @@
#!/bin/bash
EXE=dont_run_me
g++ -o$EXE Student_Code/*.cpp ignoreme.a -g
if (( $? )) ;
then
echo Compilation Failed;
read -p "Press enter to exit";
else
chmod 755 $EXE;
valgrind --tool=memcheck --leak-check=yes --max-stackframe=5000000 --show-reachable=yes --suppressions=DONT_DELETE.supp ./$EXE
rm ./$EXE
read -p "Press any key to exit..."
fi;
+21
View File
@@ -0,0 +1,21 @@
#include "Factory.h"
#include "linkedlist.h"
//You may add #include statements here
/*
You will MODIFY THIS DOCUMENT.
*/
//=======================================================================================
/*
getLinkedList()
Creates and returns an object whose class extends LinkedListInterface.
This should be an object of a class you have created.
Example: If you made a class called "LinkedList", you might say, "return new LinkedList();".
*/
LinkedListInterface * Factory::getLinkedList()
{
return new linkedlist();//Modify this line
}
+23
View File
@@ -0,0 +1,23 @@
#pragma once
#include "LinkedListInterface.h"
using namespace std;
/*
WARNING: It is expressly forbidden to modify any part of this document, including its name
*/
//=======================================================================================
/*
getLinkedList()
Creates and returns an object whose class extends LinkedListInterface.
This should be an object of a class you have created.
Example: If you made a class called "LinkedList", you might say, "return new LinkedList();".
*/
class Factory
{
public:
static LinkedListInterface * getLinkedList();
};
//=======================================================================================
@@ -0,0 +1,80 @@
//YOU MAY NOT MODIFY THIS DOCUMENT
#pragma once
#include <string>
using namespace std;
class LinkedListInterface
{
public:
LinkedListInterface(void){};
virtual ~LinkedListInterface(void){};
/*
insertHead
A node with the given value should be inserted at the beginning of the list.
Only non-negative values should be added to the list. Do not allow
duplicate values in the list.
*/
virtual void insertHead(int value) = 0;
/*
insertTail
A node with the given value should be inserted at the end of the list.
Only non-negative values should be added to the list. Do not allow
duplicate values in the list.
*/
virtual void insertTail(int value) = 0;
/*
insertAfter
A node with the given value should be inserted immediately after the
node whose value is equal to insertionNode.
A node should only be added if the node whose value is equal to
insertionNode is in the list. Only non-negative values should be
added to the list. Do not allow duplicate values in the list.
*/
virtual void insertAfter(int value, int insertionNode) = 0;
/*
remove
The node with the given value should be removed from the list.
The list may or may not include a node with the given value.
*/
virtual void remove(int value) = 0;
/*
clear
Remove all nodes from the list.
*/
virtual void clear() = 0;
/*
at
Returns the value of the node at the given index. The list begins at
index 0.
If the given index is out of range of the list, return -1;
*/
virtual int at(int index) = 0;
/*
size
Returns the number of nodes in the list.
*/
virtual int size() = 0;
};
+37
View File
@@ -0,0 +1,37 @@
CXXFLAGS= -Wall -g -std=c++0x
OBJECTS=Factory.o linkedlist.o node.o ../ignoreme.a
EXE=main
all: libpwnd.so $(EXE)
$(EXE): $(OBJECTS)
$(CXX) $(CXXFLAGS) $(OBJECTS) -o $@
main.o: main.cpp Factory.o linkedlist.o node.o libpwnd.so ../ignoreme.a
g++ -Wall -g -o main Factory.o linkedlist.o ../ignoreme.a
Factory.o: Factory.cpp Factory.h
linkedlist.o: linkedlist.cpp linkedlist.h
node.o: node.cpp node.h
test: linkedlist.o node.o test.cpp
$(CXX) $(CXXFLAGS) linkedlist.o node.o test.cpp -o $@
run: main
LD_PRELOAD=libpwnd.so LD_LIBRARY_PATH=. ./main
clean:
@rm -vf *.o
@rm -vf $(EXE)
@rm -vf *.1
@rm -vf *.0
drun: main
LD_PRELOAD=libpwnd.so LD_LIBRARY_PATH=. gdb ./main
debug: test
LD_PRELOAD=libpwnd.so LD_LIBRARY_PATH=. gdb ./test
valgrind: $(EXE)
LD_PRELOAD=libpwnd.so LD_LIBRARY_PATH=. valgrind --tool=memcheck --leak-check=yes ./$(EXE)
libpwnd.so: pwnd.c
gcc -shared -o libpwnd.so.1.0 pwnd.c
ln -fs libpwnd.so.1.0 libpwnd.so.1
ln -fs libpwnd.so.1 libpwnd.so
+158
View File
@@ -0,0 +1,158 @@
#include "linkedlist.h"
linkedlist::linkedlist(): head(NULL) {}
linkedlist::~linkedlist(){clear();}
bool linkedlist::is_it_zero(int value) {
if(value < 0)
return false;
else
return true;
}
bool linkedlist::has_a(int value) {
// cout << "has_a(" << value << ")" << endl;
node* node_ptr = head;
if(head == NULL)
return false;
while(node_ptr != NULL) {
if(node_ptr->value == value)
return true;
node_ptr = node_ptr->next;
}
return false;
}
void linkedlist::insertHead(int value) {
// cout << "inserthead(" << value << ")" << endl;
// cout << *this << endl;
if(!is_it_zero(value))
return;
if(has_a(value))
return;
head = new node(value, head);
// cout << *this << endl << endl;
}
void linkedlist::insertTail(int value) {
// cout << "insertTail(" << value << ")" << endl;
// cout << *this << endl;
if(!is_it_zero(value))
return;
if(has_a(value))
return;
if(head == NULL) {
insertHead(value);
return;
}
node* node_ptr = head;
while(node_ptr != NULL) {
if(node_ptr->next == NULL) {
node_ptr->next = new node(value, NULL);
break;
}
node_ptr = node_ptr->next;
}
// cout << *this << endl << endl;
}
void linkedlist::insertAfter(int value, int insertionNode) {
// cout << "insertAfter(" << value << ", insertionNode" << insertionNode << ")" << endl;
// cout << *this << endl;
if(value < 0 || insertionNode < 0) {
//cout << "first check" << endl;
return;
}
if(has_a(value) || !has_a(insertionNode)) {
//cout << "failing" << endl;
return;
}
node* node_ptr = head;
while(node_ptr != NULL) {
if(node_ptr->value == insertionNode) {
node* temp = new node(value, NULL);
temp->next = node_ptr->next;
node_ptr->next = temp;
}
node_ptr = node_ptr->next;
}
// cout << *this << endl << endl;
}
void linkedlist::remove(int value) {
// cout << "remove(" << value << ")" << endl;
// cout << *this << endl;
if(!is_it_zero(value))
return;
if(!has_a(value))
return;
node* node_ptr = head;
if(node_ptr->value == value) {
//cout << "first" << endl;
node* ptr = head;
head = head->next;
delete ptr;
return;
}
while(node_ptr != NULL) {
if(node_ptr->next == NULL)
return;
if(node_ptr->next->value == value) {
node* ptr = node_ptr->next;
node_ptr->next = node_ptr->next->next;
delete ptr;
}
node_ptr = node_ptr->next;
}
// cout << *this << endl << endl;
}
void linkedlist::clear() {
// cout << "clear()" << endl;
node* node_ptr = head;
while(head) {
node_ptr = head;
head = head->next;
delete node_ptr;
}
}
int linkedlist::at(int index) {
// cout << *this << endl;
// cout << "at(" << index << ")" << endl;
if(index < 0) {
//cout << "is it zero" << endl;
return -1;
}
if(size() <= index) {
// cout << "this is the index=" << index << " size(" << size() << ")"<<endl;
return -1;
}
node* node_ptr = head;
for(int i = 0; i < index; i++){
node_ptr = node_ptr->next;
}
if(head == NULL)
return -1;
return node_ptr->value;
}
int linkedlist::size() {
int size_of_list = 0;
node* node_ptr = head;
while(node_ptr != NULL) {
size_of_list++;
node_ptr = node_ptr->next;
}
// cout << "size(" << size_of_list << ")" << endl;
return size_of_list;
}
ostream & operator<<(ostream & os, linkedlist & f) {
node* node_ptr = f.head;
while(node_ptr != NULL) {
os << node_ptr->value << ",";
node_ptr = node_ptr->next;
}
return os;
}
+25
View File
@@ -0,0 +1,25 @@
#ifndef __LINKEDLIST_H__
#define __LINKEDLIST_H__
#include <iostream>
#include "LinkedListInterface.h"
#include "node.h"
using namespace std;
class linkedlist : public LinkedListInterface {
public:
linkedlist();
~linkedlist();
node* head;
bool has_a(int value);
bool is_it_zero(int value);
void insertHead(int value);
void insertTail(int value);
void insertAfter(int value, int insertionNode);
void remove(int value);
void clear();
int at(int index);
int size();
friend ostream & operator<<(ostream & os, linkedlist & f);
};
#endif
+24
View File
@@ -0,0 +1,24 @@
#include <iostream>
#include <cassert>
#include "linkedlist.h"
#include "node.h"
using namespace std;
int main() {
node* head = new node(0, head);
node* tom = new node(1, NULL);
node* dick = new node(2, NULL);
head->next = tom;
tom->next = dick;
node* node_ptr = head;
while(node_ptr != NULL) {
cout << node_ptr->value;
if(node_ptr != NULL) {
cout << "====>";
}
node_ptr = node_ptr->next;
}
cout << endl;
cout << dick->next << endl;
}
+3
View File
@@ -0,0 +1,3 @@
#include "node.h"
node::node(const int value, node* next) : value(value), next(next) {}
+14
View File
@@ -0,0 +1,14 @@
#ifndef __NODE_H__
#define __NODE_H__
#include <iostream>
using namespace std;
class node {
public:
node(const int, node*);
int value;
node* next;
};
#endif
+5
View File
@@ -0,0 +1,5 @@
#include <unistd.h>
int usleep(useconds_t usec) {
return 0;
}
+37
View File
@@ -0,0 +1,37 @@
#include <iostream>
#include "linkedlist.h"
using namespace std;
int main() {
linkedlist l;
l.insertTail(69);
l.insertHead(28);
l.insertHead(1);
l.insertHead(2);
l.insertHead(4);
l.insertHead(30);
l.insertHead(15);
l.insertTail(68);
l.insertHead(9);
l.insertHead(0);
l.insertHead(7);
l.insertHead(42);
l.insertHead(3);
cout << l << endl;
l.insertAfter(13,30);
cout << l << endl;
l.remove(13);
cout << endl << l << endl << "removed 13" << endl;;
l.remove(4);
cout << endl << l << endl << "removed 4" << endl;;
l.remove(68);
cout << endl << l << endl << "removed 68" << endl;;
l.remove(3);
cout << endl << endl;
cout << endl << l << endl << "removed 3" << endl;;
l.remove(0);
cout << endl << l << endl << "removed 9" << endl;;
l.remove(69);
cout << endl << l << endl << "removed 69" << endl;;
}
+21
View File
@@ -0,0 +1,21 @@
#include "Factory.h"
#include "ll.h"
//You may add #include statements here
/*
You will MODIFY THIS DOCUMENT.
*/
//=======================================================================================
/*
getLinkedList()
Creates and returns an object whose class extends LinkedListInterface.
This should be an object of a class you have created.
Example: If you made a class called "LinkedList", you might say, "return new LinkedList();".
*/
LinkedListInterface * Factory::getLinkedList()
{
return new ll();//Modify this line
}
+23
View File
@@ -0,0 +1,23 @@
#pragma once
#include "LinkedListInterface.h"
using namespace std;
/*
WARNING: It is expressly forbidden to modify any part of this document, including its name
*/
//=======================================================================================
/*
getLinkedList()
Creates and returns an object whose class extends LinkedListInterface.
This should be an object of a class you have created.
Example: If you made a class called "LinkedList", you might say, "return new LinkedList();".
*/
class Factory
{
public:
static LinkedListInterface * getLinkedList();
};
//=======================================================================================
+80
View File
@@ -0,0 +1,80 @@
//YOU MAY NOT MODIFY THIS DOCUMENT
#pragma once
#include <string>
using namespace std;
class LinkedListInterface
{
public:
LinkedListInterface(void){};
virtual ~LinkedListInterface(void){};
/*
insertHead
A node with the given value should be inserted at the beginning of the list.
Only non-negative values should be added to the list. Do not allow
duplicate values in the list.
*/
virtual void insertHead(int value) = 0;
/*
insertTail
A node with the given value should be inserted at the end of the list.
Only non-negative values should be added to the list. Do not allow
duplicate values in the list.
*/
virtual void insertTail(int value) = 0;
/*
insertAfter
A node with the given value should be inserted immediately after the
node whose value is equal to insertionNode.
A node should only be added if the node whose value is equal to
insertionNode is in the list. Only non-negative values should be
added to the list. Do not allow duplicate values in the list.
*/
virtual void insertAfter(int value, int insertionNode) = 0;
/*
remove
The node with the given value should be removed from the list.
The list may or may not include a node with the given value.
*/
virtual void remove(int value) = 0;
/*
clear
Remove all nodes from the list.
*/
virtual void clear() = 0;
/*
at
Returns the value of the node at the given index. The list begins at
index 0.
If the given index is out of range of the list, return -1;
*/
virtual int at(int index) = 0;
/*
size
Returns the number of nodes in the list.
*/
virtual int size() = 0;
};
+27
View File
@@ -0,0 +1,27 @@
CXXFLAGS=-Wall -g
all: test main
test: test.cc Factory.o ll.o
main: pwnd.o Factory.o ../ignoreme.a ll.o
$(CXX) $(CXXFLAGS) -o $@ $^
# these deps need to be set up to allow for appropriate recompilation
Factory.o: Factory.h Factory.cpp
ll.o: ll.h ll.cc
pwnd.o: pwnd.c
clean:
@rm -vf *.o main test core libpwnd* vgcore.*
run: main
./main
gdb: test
gdb ./test
rtest: test
./test
valgrind: main
valgrind --tool=memcheck --leak-check=yes --max-stackframe=5000000 \
--show-reachable=yes --suppressions=../To\ Students/DONT_DELETE.supp ./main
+158
View File
@@ -0,0 +1,158 @@
#include "ll.h"
ll::ll(): _size(0), head(NULL), tail(NULL) {
}
ll::~ll() {
clear();
}
void ll::insertHead(int value) {
if(value < 0 or find(value)) {
return;
}
if(head == NULL) {
assert(tail == NULL);
assert(_size == 0);
head = new node(value);
tail = head;
}
else {
node * tmp = head;
head = new node(value);
head->next = tmp;
}
_size++;
}
void ll::insertTail(int value) {
if(value < 0 or find(value)) {
return;
}
if(tail == NULL) {
assert(head == NULL);
assert(_size == 0);
tail = new node(value);
head = tail;
}
else {
node * tmp = tail;
tmp->next = new node(value);
tail = tmp->next;
}
_size++;
}
void ll::insertAfter(int value, int insertionNode) {
if(value < 0 or find(value)) {
return;
}
node * inlist = find(insertionNode);
if(not inlist) {
return;
}
node * toinsert = new node(value);
if(inlist == tail) {
tail = toinsert;
}
toinsert->next = inlist->next;
inlist->next = toinsert;
_size++;
}
void ll::remove(int value) {
if(not find(value)) {
// should deal with empty list, and not found
return;
}
else if(head == tail) {
delete head;
head = tail = NULL;
_size--;
}
else {
node * cur = head;
if(head->value == value) {
head = head->next;
delete cur;
_size--;
}
else {
while(cur) {
if(cur->next == NULL) {
// removing end ...
break;
}
if(cur->next->value == value) {
node * to_remove = cur->next;
if(to_remove == tail) {
tail = cur;
}
cur->next = to_remove->next;
delete to_remove;
_size--;
}
cur = cur->next;
}
}
}
}
void ll::clear() {
node * tmp = head;
while(head) {
tmp = head;
head = head->next;
delete tmp;
_size--;
}
head = tail = NULL;
assert(_size == 0);
}
int ll::at(int index) {
if (index >= _size or index < 0) {
return -1;
}
node * tmp = head;
for(int i = 0; i < index; i++) {
tmp = tmp->next;
}
if(tmp == NULL) {
return -1;
}
else {
return tmp->value;
}
}
int ll::size() {
return _size;
}
node * ll::find(int value) {
node * tmp = head;
while(tmp) {
if(tmp->value == value) {
return tmp;
}
tmp = tmp->next;
}
return NULL;
}
ostream & operator<<(ostream & os, const node & n) {
os << n.value;
return os;
}
ostream & operator<<(ostream & os, const ll & l) {
os << "ll {(" << l._size << ") ";
node * cur = l.head;
while (cur) {
os << *cur << ", ";
cur = cur->next;
}
os << "}";
return os;
}
+42
View File
@@ -0,0 +1,42 @@
#ifndef __LL_H__
#define __LL_H__
#include <iostream>
#include <cassert>
#include "Factory.h"
using namespace std;
struct node {
int value;
node * next;
node(int value): value(value), next(NULL) {};
friend ostream & operator<<(ostream &, const node &);
};
class ll : public LinkedListInterface
{
private:
int _size;
public:
ll();
~ll();
node * head;
node * tail;
void insertHead(int value);
void insertTail(int value);
void insertAfter(int value, int insertionNode);
void remove(int value);
void clear();
int at(int index);
int size();
node * find(int value);
friend ostream & operator<<(ostream & os, const ll & i);
};
#endif
+5
View File
@@ -0,0 +1,5 @@
#include <unistd.h>
int usleep(useconds_t usec) {
return 0;
}
+174
View File
@@ -0,0 +1,174 @@
#include <iostream>
#include <cassert>
using namespace std;
#include "Factory.h"
#include "ll.h"
int main() {
LinkedListInterface * lli = Factory::getLinkedList();
ll * myll = (ll*)lli;
myll->insertHead(8);
myll->insertHead(5);
myll->insertHead(3);
myll->insertHead(2);
myll->insertHead(1);
// should be duplicate
myll->insertHead(1);
myll->insertHead(0);
assert(myll->size() == 6);
assert(myll->head->value == 0);
assert(myll->tail->value == 8);
assert(myll->at(-8) == -1);
assert(myll->at(3238) == -1);
assert(myll->at(3) == 3);
delete myll;
{
ll ll2 = ll();
ll2.insertTail(5);
ll2.insertTail(6);
assert(ll2.size() == 2);
assert(ll2.head->value == 5);
assert(ll2.tail->value == 6);
}
{
// test for negative insertion
ll ll4 = ll();
ll4.insertHead(-1);
ll4.insertTail(-1);
assert(ll4.size() == 0);
}
{
// test for duplicate insertion
ll ll3 = ll();
ll3.insertTail(1);
ll3.insertTail(2);
ll3.insertTail(3);
ll3.insertTail(4);
ll3.insertTail(4);
ll3.insertTail(4);
ll3.insertTail(5);
assert(ll3.size() == 5);
}
{
// test find
ll ll5 = ll();
ll5.insertHead(0);
ll5.insertTail(1);
ll5.insertTail(2);
assert(ll5.find(2));
assert(ll5.find(200) == NULL);
}
{
// test insertAfter
ll ll6 = ll();
ll6.insertHead(0);
ll6.insertTail(2);
ll6.insertTail(3);
assert(ll6.size() == 3);
ll6.insertAfter(1, 0);
assert(ll6.size() == 4);
ll6.insertAfter(1, 23);
assert(ll6.size() == 4);
}
{
ll ll7 = ll();
ll7.insertAfter(1, 0);
}
{
// test deletion
ll ll8 = ll();
ll8.insertTail(1);
ll8.insertTail(2);
ll8.insertTail(3);
ll8.insertTail(4);
ll8.insertTail(5);
ll8.remove(4);
assert(ll8.find(4) == NULL);
assert(ll8.size() == 4);
assert(ll8.at(0) == 1);
assert(ll8.at(1) == 2);
assert(ll8.at(2) == 3);
assert(ll8.at(3) == 5);
assert(ll8.at(4) == -1);
assert(ll8.at(5) == -1);
}
{
ll ll9 = ll();
ll9.remove(4);
assert(ll9.size() == 0);
assert(ll9.at(1) == -1);
}
{
ll ll10 = ll();
ll10.insertTail(4);
assert(ll10.size() == 1);
ll10.remove(4);
assert(ll10.size() == 0);
}
{
ll ll11 = ll();
ll11.insertHead(4);
assert(ll11.size() == 1);
assert(ll11.at(0) == 4);
ll11.remove(4);
assert(ll11.size() == 0);
}
{
ll ll12 = ll();
ll12.insertTail(1);
ll12.insertTail(9);
assert(ll12.size() == 2);
ll12.remove(1);
assert(ll12.size() == 1);
}
{
ll ll13 = ll();
ll13.insertTail(9);
ll13.insertTail(3);
assert(ll13.size() == 2);
ll13.insertTail(16);
assert(ll13.size() == 3);
}
{
ll ll_14 = ll();
ll_14.insertHead(9);
ll_14.insertHead(3);
assert(ll_14.size() == 2);
ll_14.insertTail(16);
assert(ll_14.size() == 3);
}
{
// test enforced by assert in clear
ll l = ll();
l.insertHead(16);
l.insertTail(32);
l.insertTail(38);
l.remove(38);
l.insertTail(9);
}
{
// test enforced by asserts in ll
ll l = ll();
l.insertHead(16);
l.insertAfter(14, 16);
l.insertTail(17);
}
cout << "You passed" << endl;
}