2 ' Copyright 2011 Jacek Caban for CodeWeavers
4 ' This library is free software; you can redistribute it and/or
5 ' modify it under the terms of the GNU Lesser General Public
6 ' License as published by the Free Software Foundation; either
7 ' version 2.1 of the License, or (at your option) any later version.
9 ' This library is distributed in the hope that it will be useful,
10 ' but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 ' Lesser General Public License for more details.
14 ' You should have received a copy of the GNU Lesser General Public
15 ' License along with this library; if not, write to the Free Software
16 ' Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
26 Call ok(vbSunday = 1, "vbSunday = " & vbSunday)
27 Call ok(getVT(vbSunday) = "VT_I2", "getVT(vbSunday) = " & getVT(vbSunday))
28 Call ok(vbMonday = 2, "vbMonday = " & vbMonday)
29 Call ok(getVT(vbMonday) = "VT_I2", "getVT(vbMonday) = " & getVT(vbMonday))
30 Call ok(vbTuesday = 3, "vbTuesday = " & vbTuesday)
31 Call ok(getVT(vbTuesday) = "VT_I2", "getVT(vbTuesday) = " & getVT(vbTuesday))
32 Call ok(vbWednesday = 4, "vbWednesday = " & vbWednesday)
33 Call ok(getVT(vbWednesday) = "VT_I2", "getVT(vbWednesday) = " & getVT(vbWednesday))
34 Call ok(vbThursday = 5, "vbThursday = " & vbThursday)
35 Call ok(getVT(vbThursday) = "VT_I2", "getVT(vbThursday) = " & getVT(vbThursday))
36 Call ok(vbFriday = 6, "vbFriday = " & vbFriday)
37 Call ok(getVT(vbFriday) = "VT_I2", "getVT(vbFriday) = " & getVT(vbFriday))
38 Call ok(vbSaturday = 7, "vbSaturday = " & vbSaturday)
39 Call ok(getVT(vbSaturday) = "VT_I2", "getVT(vbSaturday) = " & getVT(vbSaturday))
41 Call ok(isObject(new EmptyClass), "isObject(new EmptyClass) is not true?")
42 Set x = new EmptyClass
43 Call ok(isObject(x), "isObject(x) is not true?")
44 Call ok(isObject(Nothing), "isObject(Nothing) is not true?")
45 Call ok(not isObject(true), "isObject(true) is true?")
46 Call ok(not isObject(4), "isObject(4) is true?")
47 Call ok(not isObject("x"), "isObject(""x"") is true?")
48 Call ok(not isObject(Null), "isObject(Null) is true?")
50 Call ok(not isEmpty(new EmptyClass), "isEmpty(new EmptyClass) is true?")
51 Set x = new EmptyClass
52 Call ok(not isEmpty(x), "isEmpty(x) is true?")
54 Call ok(isEmpty(x), "isEmpty(x) is not true?")
55 Call ok(isEmpty(empty), "isEmpty(empty) is not true?")
56 Call ok(not isEmpty(Nothing), "isEmpty(Nothing) is not true?")
57 Call ok(not isEmpty(true), "isEmpty(true) is true?")
58 Call ok(not isEmpty(4), "isEmpty(4) is true?")
59 Call ok(not isEmpty("x"), "isEmpty(""x"") is true?")
60 Call ok(not isEmpty(Null), "isEmpty(Null) is true?")
62 Call ok(not isNull(new EmptyClass), "isNull(new EmptyClass) is true?")
63 Set x = new EmptyClass
64 Call ok(not isNull(x), "isNull(x) is true?")
66 Call ok(isNull(x), "isNull(x) is not true?")
67 Call ok(not isNull(empty), "isNull(empty) is true?")
68 Call ok(not isNull(Nothing), "isNull(Nothing) is true?")
69 Call ok(not isNull(true), "isNull(true) is true?")
70 Call ok(not isNull(4), "isNull(4) is true?")
71 Call ok(not isNull("x"), "isNull(""x"") is true?")
72 Call ok(isNull(Null), "isNull(Null) is not true?")
74 Call ok(getVT(err) = "VT_DISPATCH", "getVT(err) = " & getVT(err))
77 Call ok(hex(x) = ex, "hex(" & x & ") = " & hex(x) & " expected " & ex)
83 TestHex &hdeadbeef&, "DEADBEEF"
86 TestHex -934859845, "C8472BBB"
89 Call ok(getVT(hex(null)) = "VT_NULL", "getVT(hex(null)) = " & getVT(hex(null)))
90 Call ok(getVT(hex(empty)) = "VT_BSTR", "getVT(hex(empty)) = " & getVT(hex(empty)))
92 x = InStr(1, "abcd", "bc")
93 Call ok(x = 2, "InStr returned " & x)
95 x = InStr("abcd", "bc")
96 Call ok(x = 2, "InStr returned " & x)
98 x = InStr("abc", "bc")
99 Call ok(x = 2, "InStr returned " & x)
101 x = InStr("abcbc", "bc")
102 Call ok(x = 2, "InStr returned " & x)
104 x = InStr("bcabc", "bc")
105 Call ok(x = 1, "InStr returned " & x)
107 x = InStr(3, "abcd", "bc")
108 Call ok(x = 0, "InStr returned " & x)
110 x = InStr("abcd", "bcx")
111 Call ok(x = 0, "InStr returned " & x)
113 x = InStr(5, "abcd", "bc")
114 Call ok(x = 0, "InStr returned " & x)
118 Call ok(x = 2, "InStr returned " & x)
120 x = InStr("abcd", null)
121 Call ok(isNull(x), "InStr returned " & x)
122 x = InStr(null, "abcd")
123 Call ok(isNull(x), "InStr returned " & x)
124 x = InStr(2, null, "abcd")
125 Call ok(isNull(x), "InStr returned " & x)