RandomUndoRedo Test fails

Assertion error in RandomUndoRedo test . both the files (expected and file generated after undo redo operations) have some differences. I am unable to figure out what is wrong in my logic.
I have already referred this faq RandomUndoRedo test fails? .

I have implemented this functionality using two stacks . For undo I pop from stack1 and push into stack2 and for redo I pop from stack 2 and push into stack1. Please guide me If I am wrong. @Rahul-Crio.do @Sakshat-Crio.Do @gouravsardana

Hey,

Can you please go to test file and check the assertion line and go that that particular function and see what our test is expecting ? Compare both output(Your’s and our test) :slight_smile:

actually the error is that my output is not matching with expected output.
I have implemented this functionality using two stacks . For undo I pop from stack1 and push into stack2 and for redo I pop from stack 2 and push into stack1.
It seems that something is wrong with my logic for redo function .

Please check the below FAQ, let me know if it was helpful or not.

I checked that already … but still not able to figure out what is mistake in my logic.
used two stacks. one for storing version and another for undo redo. problem might be in redo implementation that’s why getting assertion error but can’t figure out what is mistake…???

Hey,

For the redo stack just first check if it is empty ot not. If it is not then pop it from redo stak and save it as SourceFileVersion object and push it to undostack and then use cloneobj

Closing this topic as there is no response since last 12 hours. Please feel free to create a new topic and post this question as a reference link in the description of the new topic.