2
void reset_undo_accounting()
4
last_undo_stack_height= um->get_undo_stack().size();
5
last_redo_stack_height= um->get_redo_stack().size();
9
void check_only_one_undo_added_(const std::string &loc)
11
++last_undo_stack_height;
12
if (um->get_undo_stack().size() != last_undo_stack_height)
14
ensure_equals(loc+": added 1 undo action", um->get_undo_stack().size(), last_undo_stack_height);
16
// adding new stuff to the undo stack will clear the redo stack
17
last_redo_stack_height= um->get_redo_stack().size();
19
#define check_only_one_undo_added() check_only_one_undo_added_(G_STRINGIFY(__LINE__))
22
// helper member functions
23
void check_undo_(const std::string &loc)
25
ensure_equals(loc+":undo stack size", um->get_undo_stack().size(), last_undo_stack_height);
26
ensure_equals(loc+":redo stack size", um->get_redo_stack().size(), last_redo_stack_height);
28
// check that the latest undo action has a description
29
ensure(loc+":undo action description is set", um->get_action_description() != "");
34
--last_undo_stack_height;
35
// redo stack should grow by 1 and undo shrink by 1
36
ensure_equals(loc+":redo stack size after undo", um->get_redo_stack().size(), last_redo_stack_height+1);
37
ensure_equals(loc+":undo stack size after undo", um->get_undo_stack().size(), last_undo_stack_height);
39
last_redo_stack_height= um->get_redo_stack().size();
41
#define check_undo() check_undo_(G_STRINGIFY(__LINE__))
45
void check_redo_(const std::string &loc)
47
// make sure that the undo/redo stack has the expected size
48
ensure_equals(loc+":undo stack size", um->get_undo_stack().size(), last_undo_stack_height);
49
ensure_equals(loc+":redo stack size", um->get_redo_stack().size(), last_redo_stack_height);
54
++last_undo_stack_height;
55
ensure_equals(loc+":redo stack size after redo", um->get_redo_stack().size(), last_redo_stack_height-1);
56
ensure_equals(loc+":undo stack size after redo", um->get_undo_stack().size(), last_undo_stack_height);
58
last_redo_stack_height= um->get_redo_stack().size();
60
#define check_redo() check_redo_(G_STRINGIFY(__LINE__))
65
wbui->get_history_tree()->dump(0);