void Project2Test::test_MGFramework_markMO() { // Setup MGFrameworkStub mgf; mgf.init(16, 16, 32, 32); mgf.runConsoleCommand("add mo 1", &mgf, NULL); ASSERT_EQ(mgf._getNumberOfMO(), 1, "MGF failed to create MO"); ASSERT_EQ(mgf._m_MO().size(), 1, "MGF failed to create MO"); ASSERT_EQ(mgf._getNumberOfMarkedMO(), 0, "MGF created marked MO"); // Trigger mgf.runConsoleCommand("mo 0 mark", &mgf, NULL); // Verify ASSERT_EQ(mgf._getNumberOfMarkedMO(), 1, "MGF failed to mark MO"); }
void Project2Test::test_MGFramework_markMOIndexInSymbolTable() { // Setup MGFrameworkStub mgf; mgf.init(16, 16, 32, 32); mgf.runConsoleCommand("add mo 2", &mgf, NULL); ASSERT_EQ(mgf._getNumberOfMO(), 2, "MGF failed to create MO"); ASSERT_EQ(mgf._m_MO().size(), 2, "MGF failed to create MO"); ASSERT_EQ(mgf._getNumberOfMarkedMO(), 0, "MGF created marked MO"); MGSymbolTable s; s.addSymbol("moIndex", 1); ASSERT_EQ(s.hasValue("moIndex"), true, "MGF failed to create symbol"); ASSERT_EQ(s.getValue("moIndex"), 1, "MGF failed to create symbol"); // Trigger mgf.runConsoleCommand("mo moIndex mark", &mgf, &s); // Verify ASSERT_EQ(mgf._getNumberOfMarkedMO(), 1, "MGF failed to mark MO"); }