Index: uspace/lib/gfx/test/coord.c
===================================================================
--- uspace/lib/gfx/test/coord.c	(revision 1388f7f08c41cba76c34b0f31d86da64f7e07c6f)
+++ uspace/lib/gfx/test/coord.c	(revision 0e6e77f09b348a14b2b1fa8165b25000755a93f1)
@@ -239,5 +239,5 @@
 
 /** Sorting span with hight start and lower end point results in transposed span. */
-PCUT_TEST(span_points_sort_decs)
+PCUT_TEST(span_points_sort_desc)
 {
 	gfx_coord_t a, b;
@@ -580,4 +580,38 @@
 }
 
+/** Rectangle dimensions for straight rectangle are computed correctly */
+PCUT_TEST(rect_dims_straight)
+{
+	gfx_rect_t rect;
+	gfx_coord2_t dims;
+
+	rect.p0.x = 1;
+	rect.p0.y = 10;
+	rect.p1.x = 100;
+	rect.p1.y = 1000;
+
+	gfx_rect_dims(&rect, &dims);
+
+	PCUT_ASSERT_INT_EQUALS(99, dims.x);
+	PCUT_ASSERT_INT_EQUALS(990, dims.y);
+}
+
+/** Rectangle dimensions for reversed rectangle are computed correctly */
+PCUT_TEST(rect_dims_straight)
+{
+	gfx_rect_t rect;
+	gfx_coord2_t dims;
+
+	rect.p0.x = 1000;
+	rect.p0.y = 100;
+	rect.p1.x = 10;
+	rect.p1.y = 1;
+
+	gfx_rect_dims(&rect, &dims);
+
+	PCUT_ASSERT_INT_EQUALS(990, dims.x);
+	PCUT_ASSERT_INT_EQUALS(99, dims.y);
+}
+
 /** gfx_rect_is_empty for straight rectangle with zero columns returns true */
 PCUT_TEST(rect_is_empty_pos_x)
