コード例 #1
0
ファイル: core_tests.cpp プロジェクト: HardlyHaki/ProDBG
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();
}
コード例 #2
0
ファイル: Editor.c プロジェクト: pixelmager/rocket
static void onUndo()
{
	Commands_undo();
	updateNeedsSaving();
}