Patch for lib/test/unit/ui/gtk/testrunner.rb

M

Michael Neumann

Hi,

In Ruby-1.8.1 and before, lib/test/unit/ui/gtk/testrunner.rb contains
some errors. The set_font resuce-clause is because this font may not be
available on some platforms, in which case the program would abort.

Here's the patch:

--- /tmp/ruby-1.8.1/lib/test/unit/ui/gtk/testrunner.rb Wed Feb 12 05:22:35 2003
+++ testrunner.rb Tue Nov 11 12:50:46 2003
@@ -100,12 +100,12 @@
end

def show_fault(fault) # :nodoc:
- raw_show_fault(fault.longDisplay)
+ raw_show_fault(fault.long_display)
end

def raw_show_fault(string) # :nodoc:
- faultDetailLabel.set_text(string)
- outerDetailSubPanel.queue_resize
+ fault_detail_label.set_text(string)
+ outer_detail_sub_panel.queue_resize
end

def clear_fault # :nodoc:
@@ -328,7 +328,9 @@
@fault_detail_label = EnhancedLabel.new("")
style = Gtk::Style.new
font = Gdk::Font.font_load("-*-Courier New-medium-r-normal--*-120-*-*-*-*-*-*")
- style.set_font(font)
+ begin
+ style.set_font(font)
+ rescue ArgumentError; end
@fault_detail_label.set_style(style)
@fault_detail_label.set_justify(Gtk::JUSTIFY_LEFT)
@fault_detail_label.set_line_wrap(false)
 
M

Michael Neumann

Thankfully Nobu had already fixed the errors. Thanks Nobu!



OK, I've committed this patch. Can someone with GTK test it out to make sure
it works OK?

I've tested it on FreeBSD. It works. But sure, others should test it, too.

Regards,

Michael
 
M

Michael Neumann

Sorry, didn't mean to imply you hadn't tested it... I just like verification
that it works as I've applied it in the Ruby CVS tree, as I could have
goofed something up when adding it. Can you grab the latest CVS and check to
make sure everything's hunky-dory?

Done. It works with Ruby 1.8 (not tested under 1.8.1).

Regards,

Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top