void test_commands(void**) { Commands_init(); g_intValue = 0; assert_int_equal(g_intValue, 0); doAdd(1); assert_int_equal(g_intValue, 1); doAdd(1); doAdd(1); assert_int_equal(g_intValue, 3); Commands_undo(); assert_int_equal(g_intValue, 2); Commands_undo(); Commands_undo(); assert_int_equal(g_intValue, 0); Commands_redo(); assert_int_equal(g_intValue, 1); Commands_redo(); Commands_clear(); }
static void onUndo() { Commands_undo(); updateNeedsSaving(); }