Commit 26173d7
new test case for reverse path
Changed files (3)
Diff
@@ -350,7 +350,6 @@ class MergeTool : Tool { test_triangle (p (65, 100), p (168, 100), p (196, 177), "Second"); test_triangle (p (132, 68), p (195, 283), p (195, 222), "Third"); test_triangle (p (144, 267), p (147, 27), p (296, 267), "Fourth");- test_triangle (p (65, 28), p (247, 24), p (187, 28), "Fith"); } public bool test_reverse_path () {@@ -382,31 +381,6 @@ class MergeTool : Tool { pen_tool.test_click_action (3, 0, 0); test_last_is_clockwise ("Clockwise triangle 1.2"); - y_offset += 30;- pen_tool.test_click_action (1, 0 + x_offset, 10 + y_offset);- pen_tool.test_click_action (1, 20 + x_offset, 10 + y_offset);- pen_tool.test_click_action (1, 20 + x_offset, 0 + y_offset);- pen_tool.test_click_action (1, 0 + x_offset, 0 + y_offset);- pen_tool.test_click_action (3, 0, 0);- test_last_is_counter_clockwise ("Rectangle 1");- - y_offset += 30;- pen_tool.test_click_action (1, 0 + x_offset, 10 + y_offset);- pen_tool.test_click_action (1, 20 + x_offset, 10 + y_offset);- pen_tool.test_click_action (1, 20 + x_offset, 0 + y_offset);- pen_tool.test_click_action (1, 0 + x_offset, 0 + y_offset);- pen_tool.test_click_action (3, 0, 0);- test_last_is_counter_clockwise ("Rectangle 2");-- pen_tool.test_click_action (1, 100, -1000 + y_offset);- pen_tool.test_click_action (1, 115, -1000 + y_offset);- pen_tool.test_click_action (1, 115, -2000 + y_offset);- pen_tool.test_click_action (1, 120, -2000 + y_offset);- pen_tool.test_click_action (1, 120, 1000 + y_offset);- pen_tool.test_click_action (1, 100, 1000 + y_offset);- pen_tool.test_click_action (3, 0, 0);- test_last_is_clockwise ("Hight 3000");- // draw paths clockwise / counter clockwise and reverse them pen_tool.test_click_action (1, 115, 137);@@ -447,14 +421,6 @@ class MergeTool : Tool { pen_tool.test_click_action (3, 0, 0); test_reverse_last ("Triangle reverse 1"); - // triangle 2- y_offset += 70;- pen_tool.test_click_action (1, 40 + x_offset, -50 + y_offset);- pen_tool.test_click_action (1, 10 + x_offset, -20 + y_offset);- pen_tool.test_click_action (1, 25 + x_offset, -20 + y_offset); - pen_tool.test_click_action (3, 0, 0);- test_reverse_last ("Triangle reverse 2");- // box y_offset += 20; pen_tool.test_click_action (1, 100 + x_offset, 150 + y_offset);@@ -500,10 +466,7 @@ class MergeTool : Tool { pen.test_click_action (1, bx, by); pen.test_click_action (1, cx, cy); pen.test_click_action (3, 0, 0);-- // FIXME- //print (@"TESTING Random triangle ($ax, $by), ($bx, $by), ($cx, $cy)\n");- + r = test_reverse_last (@"Random triangle № $(i + 1) ($ax, $ay), ($bx, $by), ($cx, $cy)"); if (!r) { test_open_next_glyph ();@@ -512,8 +475,7 @@ class MergeTool : Tool { pen.test_click_action (1, ax, ay); pen.test_click_action (1, bx, by); pen.test_click_action (1, cx, cy);- // pen.test_click_action (3, 0, 0);- + return false; } @@ -35,17 +35,12 @@ class TestCases { public TestCases () { add (test_active_edit_point, "Active edit point"); add (test_hex, "Unicode hex values"); - add (test_coordinates, "Coordinates"); - // add (test_merge_tool, "Merge paths"); add (test_reverse_path, "Reverse path"); add (test_reverse_random_paths, "Reverse random paths"); + add (test_coordinates, "Coordinates"); add (test_drawing, "Pen tool"); - add (test_resize, "Resize tool"); - //add (test_export_tool, "Export tool"); add (test_view_result, "View result in web browser"); add (test_save_backup, "Save backup"); - - //add (test_tool_box, "Select all tools in Toolbox"); } public static void test_active_edit_point () { @@ -82,16 +77,6 @@ class TestCases { ExportTool tool = (ExportTool) MainWindow.get_toolbox ().get_tool ("export"); tool.test_view_result (); } - - public static void test_export_tool () { - Tool tool = MainWindow.get_toolbox ().get_tool ("export"); - tool.test (); - } - - public static void test_merge_tool () { - Tool tool = MainWindow.get_toolbox ().get_tool ("union_paths"); - tool.test (); - } public static void test_reverse_random_paths () { MergeTool tool = (MergeTool) MainWindow.get_toolbox ().get_tool ("union_paths"); @@ -107,11 +92,6 @@ class TestCases { Tool tool = MainWindow.get_toolbox ().get_tool ("pen_tool"); tool.test (); } - - public static void test_resize () { - Tool tool = MainWindow.get_toolbox ().get_tool ("resize"); - tool.test (); - } private void add (Callback callback, string name) { test_cases.append (new Test (callback, name)); @@ -195,7 +195,7 @@ class Toolbox : DrawingArea { // path tools Tool union_paths_tool = new MergeTool ("union_paths");- // path_tool_modifiers.add_tool (union_paths_tool);+ path_tool_modifiers.add_tool (union_paths_tool); // Fixa: write merge tool Tool reverse_path_tool = new Tool ("reverse_path", "Create counter from outline", 'r');