Subject: [sup-talk] [PATCH] explicitly load messages in testcase

From: [email-masked] (Rich Lane)
Date: Mon, 27 Jul 2009 22:02:29 -0700

---
 test/test_message.rb |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/test/test_message.rb b/test/test_message.rb
index 0a7db45..675b81d 100644
--- a/test/test_message.rb
+++ b/test/test_message.rb
@@ -73,6 +73,7 @@ EOS
     source_info = 0
 
     sup_message = Message.new( {:source => source, :source_info => source_info } )
+    sup_message.load_from_source!
 
     # see how well parsing the header went
 
@@ -222,6 +223,7 @@ EOS
     source_info = 0
 
     sup_message = Message.new( {:source => source, :source_info => source_info } )
+    sup_message.load_from_source!
     
     # read the message body chunks
 
@@ -271,6 +273,7 @@ EOS
     source_info = 0
 
     sup_message = Message.new( {:source => source, :source_info => source_info } )
+    sup_message.load_from_source!
     
     to = sup_message.to
 
@@ -316,6 +319,7 @@ EOS
     source_info = 0
 
     sup_message = Message.new( {:source => source, :source_info => source_info } )
+    sup_message.load_from_source!
     
     # read the message body chunks: no errors should reach this level
 
@@ -414,6 +418,7 @@ EOS
     source_info = 0
 
     sup_message = Message.new( {:source => source, :source_info => source_info } )
+    sup_message.load_from_source!
     
     # read the message body chunks
 
@@ -504,6 +509,7 @@ EOS
     source_info = 0
 
     sup_message = Message.new( {:source => source, :source_info => source_info } )
+    sup_message.load_from_source!
 
     # See how well parsing the message ID went.
     id = sup_message.id
-- 
1.6.0.4

---

From: [email-masked] (William Morgan)
Date: Tue, 28 Jul 2009 08:12:51 -0700

Hi Rich,

Not to be a pain, but can you give a little more context for this patch
(and the other two you sent recently)? I'm just trying to understand
what this fixes.
-- 
William <wmorgan-sup at masanjin.net>

---

From: [email-masked] (Rich Lane)
Date: Tue, 28 Jul 2009 11:39:16 -0400

> (and the other two you sent recently)? I'm just trying to understand

Sure. The commit "don't automatically parse header on Message#new" broke
test_message because the message id/etc fields are nil until
load_from_source! is called. This patch just calls load_from_source!
whenever we create a message in the testcase.

The other two are fixes for problems reported by Guillaume Quintard.
Ferret sup-dump was failing because the query passed to each_id didn't
have any positive terms. The date-ceiling code was broken on 32 bit
machines because the maximum signed long is 2**31-1, not 2**31.

---

From: [email-masked] (William Morgan)
Date: Tue, 28 Jul 2009 09:04:20 -0700

> whenever we create a message in the testcase.

Got it. Applied, thanks!

> have any positive terms.

Hah.

> The date-ceiling code was broken on 32 bit machines because the
> maximum signed long is 2**31-1, not 2**31.

Ok, both applied. Thanks!
-- 
William <wmorgan-sup at masanjin.net>