]> git.llucax.com Git - z.facultad/75.52/treemulator.git/blobdiff - viewer/main.cpp
Bugfix del test.sh para que no 'oculte' errores por SIGSEGV.
[z.facultad/75.52/treemulator.git] / viewer / main.cpp
index 1cee643a97ebada2d2264d802615a13f2d0c9896..f7e4d5d0b2458803a6b7fef5b6ef2f3d5c81c397 100644 (file)
@@ -68,7 +68,8 @@ int main(int argc, char *argv[])
        area.add (canvas);
 
        hbox.pack_start (area);
        area.add (canvas);
 
        hbox.pack_start (area);
-       hbox.pack_end (frame, true, true, 10);
+       hbox.pack_start (frame, false, false, 10);
+       frame.set_size_request (200, 200);
 
        Glib::RefPtr<Gtk::ActionGroup> actiongroup = Gtk::ActionGroup::create();
 
 
        Glib::RefPtr<Gtk::ActionGroup> actiongroup = Gtk::ActionGroup::create();
 
@@ -133,7 +134,11 @@ void nuevo_arbol ()
                                double l = Random::Double (0.0f, 1.0f);
                                std::cout << l << " >= " << paltas << std::endl;
                                if (l >= paltas) {
                                double l = Random::Double (0.0f, 1.0f);
                                std::cout << l << " >= " << paltas << std::endl;
                                if (l >= paltas) {
-                                       tree->AddKey (c);
+                                       try {
+                                               tree->AddKey (c);
+                                       } catch (Exception *e) {
+                                               std::cout << "====== " << (std::string)c << e->Message () << std::endl;
+                                       }
                                        i++;
                                } else {
                                        /* Tengo que borrar una clave entre 0 e "i" de la lista
                                        i++;
                                } else {
                                        /* Tengo que borrar una clave entre 0 e "i" de la lista
@@ -164,7 +169,11 @@ void nuevo_arbol ()
                        while (it != lst.end ()) {
                                ClaveVariable c(*it);
 
                        while (it != lst.end ()) {
                                ClaveVariable c(*it);
 
-                               tree->AddKey (c);
+                               try {
+                                       tree->AddKey (c);
+                               } catch (Exception *e) {
+                                       std::cout << "====== " << (std::string)c << e->Message () << std::endl;
+                               }
                                it++;
                        }
                }
                                it++;
                        }
                }