Opened 15 years ago

Closed 15 years ago

Last modified 6 years ago

#8992 closed patch

GSOC09: A few unit tests for Common::Rect

Reported by: SF/vezoofae Owned by: fingolfin
Priority: normal Component: --Other--
Version: Keywords:
Cc: Game:


A bunch of tests.

A failing, but commented out assertion is included because of the the extend() function comment:

/** * Extend this rectangle so that it contains r * @param r the rectangle to extend by */

It suggests that r1.contain(r2) will be true after r1.extend(r2) is called, but this is not the case.

Ticket imported from: #2735283. Ticket imported from: patches/1097.

Attachments (1)

rect_unit.diff (1.5 KB ) - added by SF/vezoofae 15 years ago.
The patch.

Download all attachments as: .zip

Change History (6)

by SF/vezoofae, 15 years ago

Attachment: rect_unit.diff added

The patch.

comment:1 by fingolfin, 15 years ago

Thank you for your submission, we will soon review it in detail.

comment:2 by fingolfin, 15 years ago

Summary: A few unit tests for Common::RectGSOC09: A few unit tests for Common::Rect

comment:3 by fingolfin, 15 years ago

Patch looks good. Regarding your comment on the commented out test: The Rect::contains documentation says this:

Check if the given rect is _fully_ contained inside this rectangle

Which, I guess, is supposed to explain the problematic behavior your report. I.e. a rect is not fully contained in itself by this definition... Which is confusing, I think... Need to think about that.

comment:4 by fingolfin, 15 years ago

Owner: set to fingolfin
Status: newclosed

comment:5 by digitall, 6 years ago

Component: --Other--
Note: See TracTickets for help on using tickets.