<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2014-04-21 17:18 GMT+08:00 Jacek Caban <span dir="ltr"><<a href="mailto:jacek@codeweavers.com" target="_blank">jacek@codeweavers.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi Shuai,<br>
<br>
On 04/21/14 03:45, Shuai Meng wrote:<br>
> -<br>
> -    return return_bool(res, val);<br>
> +    V_VT(res) = VT_EMPTY;<br>
> +    return VariantChangeType(res, arg, VARIANT_LOCALBOOL, VT_BOOL);<br>
<br>
You can't assume that res is not NULL. If result of the function is not<br>
used, it will be NULL. A simple test case is like this:<br>
<br>
call CBool(0)<br>
<br>
Also, are you sure we want VARIANT_LOCALBOOL here? Did you test it<br>
(probably by running tests on localized Windows with translated string<br>
"False")?<br>
<br>
Looking at CBool tests:<br>
<br>
+Call ok(CBool(Empty) = False, "CBool(Empty) = " & CBool(Empty))<br>
+Call ok(getVT(CBool(Empty)) = "VT_BOOL", "getVT(CBool(Empty)) = " & getVT(CBool(Empty)))<br>
+Call ok(CBool(1) = True, "CBool(1) = " & CBool(1))<br>
+Call ok(getVT(CBool(1)) = "VT_BOOL", "getVT(CBool(1)) = " & getVT(CBool(1)))<br>
+Call ok(CBool(CLng(0)) = False, "CBool(CLng(0)) = " & CBool(CLng(0)))<br>
+Call ok(getVT(CBool(CLng(0))) = "VT_BOOL", "getVT(CBool(CLng(0))) = " & getVT(CBool(CLng(0))))<br>
+Call ok(CBool(CSng(0.5)) = True, "CBool(CSng(0.5)) = " & CBool(CSng(0.5)))<br>
+Call ok(getVT(CBool(CSng(0.5))) = "VT_BOOL", "getVT(CBool(CSng(0.5))) = " & getVT(CBool(CSng(0.5))))<br>
+Call ok(CBool(-0.56) = True, "CBool(-0.56) = " & CBool(-0.56))<br>
+Call ok(getVT(CBool(-0.56)) = "VT_BOOL", "getVT(CBool(-0.56)) = " & getVT(CBool(-0.56)))<br>
+Call ok(CBool(CCur(8.55)) = True, "CBool(CCur(8.55)) = " & CBool(CCur(8.55)))<br>
+Call ok(getVT(CBool(CCur(8.55))) = "VT_BOOL", "getVT(CBool(CCur(8.55))) = " & getVT(CBool(CCur(8.55))))<br>
+Call ok(CBool(CDate(0)) = False, "CBool(CDate(0)) = " & CBool(CDate(0)))<br>
+Call ok(getVT(CBool(CDate(0))) = "VT_BOOL", "getVT(CBool(CDate(0))) = " & getVT(CBool(CDate(0))))<br>
+Call ok(CBool(CDate(3.33)) = True, "CBool(CDate(3.33)) = " & CBool(CDate(3.33)))<br>
+Call ok(getVT(CBool(CDate(3.33))) = "VT_BOOL", "getVT(CBool(CDate(3.33))) = " & getVT(CBool(CDate(3.33))))<br>
+Call ok(CBool("6666.78") = True, "CBool(""6666.78"") = " & CBool("6666.78"))<br>
+Call ok(getVT(CBool("6666.78")) = "VT_BOOL", "getVT(CBool(""6666.78"")) = " & getVT(CBool("6666.78")))<br>
+Call ok(CBool(CByte(-0.1)) = False, "CBool(CByte(-0.1)) = " & CBool(CByte(-0.1)))<br>
+Call ok(getVT(CBool(CByte(-0.1))) = "VT_BOOL", "getVT(CBool(CByte(-0.1))) = " & getVT(CBool(CByte(-0.1))))<br>
<br>
Those look mostly good. However I'd like to see some more tests.<br>
Interesting case is for example empty string and a "false", "False" and<br>
"#FALSE#" string.</blockquote><div> </div><div>These strings can't pass tests in testbot, I have tried. And I find a line in <a href="http://msdn.microsoft.com/en-us/library/2k9sfx3c(v=vs.84).aspx">http://msdn.microsoft.com/en-us/library/2k9sfx3c(v=vs.84).aspx</a>  says that "<span style="font-size:13px;color:rgb(42,42,42);font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif;line-height:18px">If </span><em style="font-size:13px;color:rgb(42,42,42);font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif;line-height:18px">expression</em><span style="font-size:13px;color:rgb(42,42,42);font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif;line-height:18px"> can't be interpreted as a numeric value, a run-time error occurs."</span></div>
<div><span style="font-size:13px;color:rgb(42,42,42);font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif;line-height:18px"><br></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Also I'd really like to see tests on object default<br>
values. See the attached patch for an example.<br></blockquote><div><br></div><div>I copied the example, and found that though tests on object default values passed in testbot, they can't pass in wine. I think this is because VariantChangeType function can't change an object into a VT_BOOL. So I delete them.</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Those comments apply also to other patches in the series. It may be<br>
easier to proceed if you resent just the first patch fixed and include<br>
tests that don't depending on other patches in the series in the patch<br>
itself.<br>
<br>
Cheers,<br>
Jacek<br>
<br><br>
<br></blockquote></div><br></div></div>