mipt-mips icon indicating copy to clipboard operation
mipt-mips copied to clipboard

Add tests to Operation methods

Open pavelkryukov opened this issue 6 years ago • 3 comments

Worth to start with #530!

MIPSInstr has a lot of methods like is_jump(), is_load(), is_conditional_move() etc. These methods may be easily tested in a following manner

TEST_CASE( "MIPS_instr: Test_Mul")
{
     const MIPSInstr instr(0x02290018)
     ASSERT_EQ(instr.Dump(), "mult $s1, $t1");
     ASSERT_EQ(instr.get_dst_num(), REG_NUM_HI_LO);
     ASSERT_EQ(instr.get_src_num(0), REG_NUM_T1);
     ASSERT_FALSE(instr.is_jump());
     ASSERT_TRUE(instr.is_divmult());
// ...
}

The task is quite dull, so some automation may be performed. Alternatively, it may be distributed per each student (so everyone may add two instructions)

pavelkryukov avatar Feb 27 '18 16:02 pavelkryukov

@alex19999 The issue has low value for project, I would like to keep for next year students for their ramp up. There are some more interesting things to do...

pavelkryukov avatar Mar 22 '18 21:03 pavelkryukov

Ok, I will take another one23.03.2018, 00:15, "Pavel I. Kryukov" [email protected]:@alex19999 The issue has a low value for project, I would like to keep for next year students for their ramp up. There are some more interesting things to do...

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.

alex19999 avatar Mar 22 '18 21:03 alex19999

@alex19999

I advise to choose something with enhancement label: https://github.com/MIPT-ILab/mipt-mips/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement. However, you have enough points to get highest result already.

pavelkryukov avatar Mar 23 '18 15:03 pavelkryukov