On 04/29/14 15:06, Shuai Meng wrote:
- if(!res)
return S_OK;
You can't return early if res is NULL. You still need to do the conversion and return error if it fails.
+Call ok(CBool(Empty) = False, "CBool(Empty) = " & CBool(Empty)) +Call ok(getVT(CBool(Empty)) = "VT_BOOL", "getVT(CBool(Empty)) = " & getVT(CBool(Empty))) +Call ok(CBool(1) = True, "CBool(1) = " & CBool(1)) +Call ok(getVT(CBool(1)) = "VT_BOOL", "getVT(CBool(1)) = " & getVT(CBool(1))) +Call ok(CBool(0) = False, "CBool(0) = " & CBool(0)) +Call ok(getVT(CBool(0)) = "VT_BOOL", "getVT(CBool(0)) = " & getVT(CBool(0))) +Call ok(CBool(-0.56) = True, "CBool(-0.56) = " & CBool(-0.56)) +Call ok(getVT(CBool(-0.56)) = "VT_BOOL", "getVT(CBool(-0.56)) = " & getVT(CBool(-0.56))) +Call ok(CBool("-1") = True, "CBool(""-1"") = " & CBool("-1")) +Call ok(getVT(CBool("-1")) = "VT_BOOL", "getVT(CBool(""-1"")) = " & getVT(CBool("-1")))
It would be nice to add following tests (these are the tests Jacek was asking for): Call ok(CBool("True") = true, "CBool(""True"") = " & CBool("True")) Call ok(CBool("fAlSe") = false, "CBool(""fAlSe"") = " & CBool("fAlSe")) sub testCBoolError on error resume next
call Err.clear() call CBool("#FALSE#") call ok(Err.number = 458, "Err.number = " & Err.number) end sub Call testCBoolError