void TestAttal::testMap() { GenericMap * map = new GenericMap(); map->newUnknownMap( 50, 60 ); QCOMPARE( (int)map->getHeight() , 50 ); QCOMPARE( (int)map->getWidth() , 60 ); GenericCell * cell = NULL; bool except = false; try { cell = map->at( 500, 650 ); } catch( const char * err ) { except = true; } QCOMPARE( except , true ); except = false; try { cell = map->at( -5, -6 ); } catch( const char * err ) { except = true; } QCOMPARE( except , true ); except = false; try { cell = map->at( 5, 6 ); } catch( const char * err ) { except = true; } QCOMPARE( except , false ); QCOMPARE( cell->getRow() , 5 ); map->newMapType( 50, 60,2 ); QCOMPARE( (int)map->getHeight() , 50 ); QCOMPARE( (int)map->getWidth() , 60 ); QCOMPARE( (int)map->at(1,1)->getType() ,2 ); delete map; }