Changeset 780bfa
- Timestamp:
- Aug 13, 2025, 9:46:30 PM (5 months ago)
- Branches:
- Candidate_v1.7.0, Candidate_v1.7.1, stable
- Children:
- 463bfb
- Parents:
- bcc29ca
- git-author:
- Frederik Heber <frederik.heber@…> (08/13/25 08:41:09)
- git-committer:
- Frederik Heber <frederik.heber@…> (08/13/25 21:46:30)
- Files:
-
- 3 edited
-
src/Actions/ActionHistory.cpp (modified) (1 diff)
-
src/Parser/FormatParserStorage.cpp (modified) (1 diff)
-
tests/regression/Options/UndoMark/testsuite-options-undo-mark.at (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/ActionHistory.cpp
rbcc29ca r780bfa 100 100 void ActionHistory::setMark() { 101 101 HistoryElement * const mark = &(history.back()); 102 ASSERT( mark != NULL, 103 "ActionHistory::setMark() - must not push NULL as element"); 102 if (mark == NULL) { 103 ELOG(2, "setMark - must not push NULL as element"); 104 return; 105 } 104 106 marked.push(mark); 105 107 } 106 108 107 109 void ActionHistory::unsetMark() { 108 marked.pop(); 110 if (!marked.empty()) { 111 marked.pop(); 112 } else { 113 ELOG(2, "unsetMark - stack is already empty."); 114 } 109 115 } 110 116 111 117 void ActionHistory::undoTillMark() { 112 118 if (marked.empty()) { 113 undoLast();119 ELOG(2, "There is no undo mark, not undoing anything."); 114 120 } else { 115 121 const HistoryElement * const mark = marked.top(); -
src/Parser/FormatParserStorage.cpp
rbcc29ca r780bfa 181 181 LOG(0, "STATUS: Adding " << ParserNames[type] << " type to output."); 182 182 ParserDesiredOutputFormat[type] = true; 183 add(type); 183 184 } 184 185 -
tests/regression/Options/UndoMark/testsuite-options-undo-mark.at
rbcc29ca r780bfa 26 26 # add an atom prior to undo-mark 27 27 AT_CHECK([../../molecuilder -i test-simple-prior.conf --add-atom 1 --domain-position "5,5,5" --set-undo-mark 1 --undo-till-mark], 0, [stdout], [ignore]) 28 AT_CHECK([grep - c "ATOM" test-simple-prior.conf], 1, [ignore], [ignore])28 AT_CHECK([grep -q "^Ion_Type" test-simple-prior.conf], 0, [ignore], [ignore]) 29 29 30 30 # add an atom after to undo-mark 31 31 AT_CHECK([../../molecuilder -i test-simple-after.conf --set-undo-mark 1 --add-atom 1 --domain-position "5,5,5" --undo-till-mark], 0, [stdout], [ignore]) 32 AT_CHECK([grep - c "ATOM" test-simple-after.conf], 1, [ignore], [ignore])32 AT_CHECK([grep -q "^Ion_Type" test-simple-after.conf], 1, [ignore], [ignore]) 33 33 34 # add an atom prior to undo-mark reset35 AT_CHECK([../../molecuilder -i test-simple- prior-reset.conf --set-undo-mark 0--add-atom 1 --domain-position "5,5,5" --select-all-atoms --undo-till-mark], 0, [stdout], [ignore])36 AT_CHECK([grep - c "ATOM" test-simple-prior-reset.conf], 1, [ignore], [ignore])34 # add an atom and select after undo-mark: both undone 35 AT_CHECK([../../molecuilder -i test-simple-two-undo.conf --set-undo-mark 1 --add-atom 1 --domain-position "5,5,5" --select-all-atoms --undo-till-mark], 0, [stdout], [ignore]) 36 AT_CHECK([grep -q "^Ion_Type" test-simple-two-undo.conf], 1, [ignore], [ignore]) 37 37 38 # input file with added atom 38 # input file with added atom: undo all (input has no undo) 39 39 AT_CHECK([../../molecuilder --set-undo-mark 1 --input hydrogen.xyz --add-atom 1 --domain-position "5,5,5" --undo-till-mark --select-all-atoms], 0, [stdout], [ignore]) 40 40 AT_CHECK([grep "0 atoms selected" stdout], 0, [ignore], [ignore]) 41 41 42 # input file with added atom 43 AT_CHECK([../../molecuilder --input hydrogen.xyz --add-atom 1 --domain-position "5,5,5" --set-undo-mark 0--undo-till-mark], 0, [stdout], [ignore])44 AT_CHECK([grep "Resetting mark" stdout], 0, [ignore], [ignore])42 # input file with added atom, then undo-mark: nothing undone 43 AT_CHECK([../../molecuilder --input hydrogen.xyz --add-atom 1 --domain-position "5,5,5" --set-undo-mark 1 --undo-till-mark], 0, [stdout], [ignore]) 44 AT_CHECK([grep -q "H" hydrogen.xyz], 0, [ignore], [ignore]) 45 45 46 46 AT_CLEANUP
Note:
See TracChangeset
for help on using the changeset viewer.
