[Patch] DBI tests on Win32 dealing with /dev/null.

2004-09-08 Thread Jeff Urlwin
Tim,

Attached is a minor patch to fix skipping tests on Win32.

It would be nice if Cygwin users could validate this on their platform...

Regards,

Jeff



Index: t/01basics.t
===
--- t/01basics.t(revision 452)
+++ t/01basics.t(working copy)
@@ -147,10 +147,12 @@
 ## testing dbi_debug

 cmp_ok($DBI::dbi_debug, '==',  0, ... DBI::dbi_debug's initial state is
0);
+my $null = /dev/null;
+$null = nul if ($^O eq MSWin32);

 SKIP: {
-skip cannot find : /dev/null, 2 unless (-e /dev/null);
-DBI-trace(42,/dev/null);
+skip cannot find : $null, 2 unless ($^O eq MSWin32 || -e $null);

+DBI-trace(42,$null);
 cmp_ok($DBI::dbi_debug, '==', 42, ... DBI::dbi_debug is 42);
DBI-trace(0, undef);
 cmp_ok($DBI::dbi_debug, '==',  0, ... DBI::dbi_debug is 0);


win32.patch
Description: Binary data


Re: UTF-8 flags (again)

2004-09-08 Thread David Wheeler
On Sep 8, 2004, at 4:45 AM, Tim Bunce wrote:
I was thinking of doing at least 0 on that list for DBI 1.44.
I'd especially like to do
  $dbh-{SetUTF8} = 2;
And be done with it.
I'll take a look. Patches welcome, of course!
Hey, if I knew any C...I can paste these from Encode.xs, at least:
_utf8_on(sv)
SV *sv
CODE:
{
if (SvPOK(sv)) {
SV *rsv = newSViv(SvUTF8(sv));
RETVAL = rsv;
SvUTF8_on(sv);
} else {
RETVAL = PL_sv_undef;
}
}
OUTPUT:
RETVAL
SV *
_utf8_off(sv)
SV *sv
CODE:
{
if (SvPOK(sv)) {
SV *rsv = newSViv(SvUTF8(sv));
RETVAL = rsv;
SvUTF8_off(sv);
} else {
RETVAL = PL_sv_undef;
}
}
OUTPUT:
RETVAL
PS: I assume that if I do:
  my $data = $utf8_data;
where $utf8_data has SvUTF8_on that $data will also have SvUTF8_on. Is
that correct?
Yes.
Great, I figured as much. Thanks!
David


Re: Test cases on DBI-1.43

2004-09-08 Thread Tim Bunce
On Wed, Sep 08, 2004 at 03:49:57PM +0200, H.Merijn Brand wrote:
 I have this piece of test case in my DBD test code that succeeded in 1.42, but
 now fails in 1.43
 
 ok ($sth-execute, execute);
 ok ($sth-{NUM_OF_FIELDS}, NUM_OF_FIELDS);
 eval { my $typo = $sth-{NUM_OFFIELDS_typo} };
 like ($@, qr/attribute/, attr typo);
 
 Is that on purpose?

Yes. See DBI Changes file ( and similar reports from DBD::Oracle).
The test needs changing.

 /me has a lot of other problems on this AIX machine to care about right now ...

Often the way with AIX it seems ... :)

Tim.


Re: UTF-8 flags (again)

2004-09-08 Thread Tim Bunce
On Wed, Sep 08, 2004 at 09:15:36AM -0700, David Wheeler wrote:
 On Sep 8, 2004, at 4:45 AM, Tim Bunce wrote:
 
 I was thinking of doing at least 0 on that list for DBI 1.44.
 
 I'd especially like to do
 
   $dbh-{SetUTF8} = 2;
 
 And be done with it.
 
 I'll take a look. Patches welcome, of course!
 
 Hey, if I knew any C...I can paste these from Encode.xs, at least:

That's the trivial bit :) The fiddly bit is handling the SetUTF8 attribute
(and corresponding bit flags to make it fast enough).

But thanks anyway :)

Tim.


Re: UTF-8 flags (again)

2004-09-08 Thread David Wheeler
On Sep 8, 2004, at 12:58 PM, Tim Bunce wrote:
That's the trivial bit :) The fiddly bit is handling the SetUTF8 
attribute
(and corresponding bit flags to make it fast enough).

But thanks anyway :)
Ah well, sorry I can't be more help...
Regards,
David