On 07/03/14 03:57, Shuai Meng wrote:
2014-07-03 1:31 GMT+08:00 Piotr Caban <piotr.caban@gmail.com mailto:piotr.caban@gmail.com>:
Hi, +Sub testSgnError(strings, error_num) + on error resume next + + Call Err.clear() + Call Sgn(strings) + Call ok(Err.number = error_num, "Err.number = " & Err.number) +End Sub + +Call testSgnError(Null, 445) This test fails on windows. Tests needs to pass both on windows and on wine.
Yeah, it should fail. Sgn(Null) always returns error number 94 on windows. If we want Sgn(Null) to return the same error number on wine, we should use the right error const which is defined in include/winerror.h when V_VT(arg) == VT_NULL. That means, E_NOTIMPL is not the best one, we should find a replacement.
This is an internal vbscript error, it's not defined in any public header. You can define it in vbscript/vbscript.h file (see e.g. VBSE_ILLEGAL_FUNC_CALL definition).
While returning the error in function implementation you will need to do something like this: if(V_VT(arg) == VT_NULL) return MAKE_VBSERROR(VBSE_ILLEAGAL_NULL_USE);
Cheers, Piotr