Python ctypes.wintypes.VARIANT_BOOL Examples
The following are 10
code examples of ctypes.wintypes.VARIANT_BOOL().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
ctypes.wintypes
, or try the search function
.
Example #1
Source File: test_wintypes.py From ironpython2 with Apache License 2.0 | 5 votes |
def test_variant_bool(self): from ctypes import wintypes # reads 16-bits from memory, anything non-zero is True for true_value in (1, 32767, 32768, 65535, 65537): true = POINTER(c_int16)(c_int16(true_value)) value = cast(true, POINTER(wintypes.VARIANT_BOOL)) self.assertEqual(repr(value.contents), 'VARIANT_BOOL(True)') vb = wintypes.VARIANT_BOOL() self.assertIs(vb.value, False) vb.value = True self.assertIs(vb.value, True) vb.value = true_value self.assertIs(vb.value, True) for false_value in (0, 65536, 262144, 2**33): false = POINTER(c_int16)(c_int16(false_value)) value = cast(false, POINTER(wintypes.VARIANT_BOOL)) self.assertEqual(repr(value.contents), 'VARIANT_BOOL(False)') # allow any bool conversion on assignment to value for set_value in (65536, 262144, 2**33): vb = wintypes.VARIANT_BOOL() vb.value = set_value self.assertIs(vb.value, True) vb = wintypes.VARIANT_BOOL() vb.value = [2, 3] self.assertIs(vb.value, True) vb.value = [] self.assertIs(vb.value, False)
Example #2
Source File: test_wintypes.py From BinderFilter with MIT License | 5 votes |
def test_variant_bool(self): # reads 16-bits from memory, anything non-zero is True for true_value in (1, 32767, 32768, 65535, 65537): true = POINTER(c_int16)(c_int16(true_value)) value = cast(true, POINTER(wintypes.VARIANT_BOOL)) self.assertEqual(repr(value.contents), 'VARIANT_BOOL(True)') vb = wintypes.VARIANT_BOOL() self.assertIs(vb.value, False) vb.value = True self.assertIs(vb.value, True) vb.value = true_value self.assertIs(vb.value, True) for false_value in (0, 65536, 262144, 2**33): false = POINTER(c_int16)(c_int16(false_value)) value = cast(false, POINTER(wintypes.VARIANT_BOOL)) self.assertEqual(repr(value.contents), 'VARIANT_BOOL(False)') # allow any bool conversion on assignment to value for set_value in (65536, 262144, 2**33): vb = wintypes.VARIANT_BOOL() vb.value = set_value self.assertIs(vb.value, True) vb = wintypes.VARIANT_BOOL() vb.value = [2, 3] self.assertIs(vb.value, True) vb.value = [] self.assertIs(vb.value, False)
Example #3
Source File: test_wintypes.py From oss-ftp with MIT License | 5 votes |
def test_variant_bool(self): from ctypes import wintypes # reads 16-bits from memory, anything non-zero is True for true_value in (1, 32767, 32768, 65535, 65537): true = POINTER(c_int16)(c_int16(true_value)) value = cast(true, POINTER(wintypes.VARIANT_BOOL)) self.assertEqual(repr(value.contents), 'VARIANT_BOOL(True)') vb = wintypes.VARIANT_BOOL() self.assertIs(vb.value, False) vb.value = True self.assertIs(vb.value, True) vb.value = true_value self.assertIs(vb.value, True) for false_value in (0, 65536, 262144, 2**33): false = POINTER(c_int16)(c_int16(false_value)) value = cast(false, POINTER(wintypes.VARIANT_BOOL)) self.assertEqual(repr(value.contents), 'VARIANT_BOOL(False)') # allow any bool conversion on assignment to value for set_value in (65536, 262144, 2**33): vb = wintypes.VARIANT_BOOL() vb.value = set_value self.assertIs(vb.value, True) vb = wintypes.VARIANT_BOOL() vb.value = [2, 3] self.assertIs(vb.value, True) vb.value = [] self.assertIs(vb.value, False)
Example #4
Source File: test_wintypes.py From Fluid-Designer with GNU General Public License v3.0 | 5 votes |
def test_variant_bool(self): from ctypes import wintypes # reads 16-bits from memory, anything non-zero is True for true_value in (1, 32767, 32768, 65535, 65537): true = POINTER(c_int16)(c_int16(true_value)) value = cast(true, POINTER(wintypes.VARIANT_BOOL)) self.assertEqual(repr(value.contents), 'VARIANT_BOOL(True)') vb = wintypes.VARIANT_BOOL() self.assertIs(vb.value, False) vb.value = True self.assertIs(vb.value, True) vb.value = true_value self.assertIs(vb.value, True) for false_value in (0, 65536, 262144, 2**33): false = POINTER(c_int16)(c_int16(false_value)) value = cast(false, POINTER(wintypes.VARIANT_BOOL)) self.assertEqual(repr(value.contents), 'VARIANT_BOOL(False)') # allow any bool conversion on assignment to value for set_value in (65536, 262144, 2**33): vb = wintypes.VARIANT_BOOL() vb.value = set_value self.assertIs(vb.value, True) vb = wintypes.VARIANT_BOOL() vb.value = [2, 3] self.assertIs(vb.value, True) vb.value = [] self.assertIs(vb.value, False)
Example #5
Source File: test_wintypes.py From Imogen with MIT License | 5 votes |
def test_variant_bool(self): from ctypes import wintypes # reads 16-bits from memory, anything non-zero is True for true_value in (1, 32767, 32768, 65535, 65537): true = POINTER(c_int16)(c_int16(true_value)) value = cast(true, POINTER(wintypes.VARIANT_BOOL)) self.assertEqual(repr(value.contents), 'VARIANT_BOOL(True)') vb = wintypes.VARIANT_BOOL() self.assertIs(vb.value, False) vb.value = True self.assertIs(vb.value, True) vb.value = true_value self.assertIs(vb.value, True) for false_value in (0, 65536, 262144, 2**33): false = POINTER(c_int16)(c_int16(false_value)) value = cast(false, POINTER(wintypes.VARIANT_BOOL)) self.assertEqual(repr(value.contents), 'VARIANT_BOOL(False)') # allow any bool conversion on assignment to value for set_value in (65536, 262144, 2**33): vb = wintypes.VARIANT_BOOL() vb.value = set_value self.assertIs(vb.value, True) vb = wintypes.VARIANT_BOOL() vb.value = [2, 3] self.assertIs(vb.value, True) vb.value = [] self.assertIs(vb.value, False)
Example #6
Source File: test_wintypes.py From ironpython3 with Apache License 2.0 | 5 votes |
def test_variant_bool(self): from ctypes import wintypes # reads 16-bits from memory, anything non-zero is True for true_value in (1, 32767, 32768, 65535, 65537): true = POINTER(c_int16)(c_int16(true_value)) value = cast(true, POINTER(wintypes.VARIANT_BOOL)) self.assertEqual(repr(value.contents), 'VARIANT_BOOL(True)') vb = wintypes.VARIANT_BOOL() self.assertIs(vb.value, False) vb.value = True self.assertIs(vb.value, True) vb.value = true_value self.assertIs(vb.value, True) for false_value in (0, 65536, 262144, 2**33): false = POINTER(c_int16)(c_int16(false_value)) value = cast(false, POINTER(wintypes.VARIANT_BOOL)) self.assertEqual(repr(value.contents), 'VARIANT_BOOL(False)') # allow any bool conversion on assignment to value for set_value in (65536, 262144, 2**33): vb = wintypes.VARIANT_BOOL() vb.value = set_value self.assertIs(vb.value, True) vb = wintypes.VARIANT_BOOL() vb.value = [2, 3] self.assertIs(vb.value, True) vb.value = [] self.assertIs(vb.value, False)
Example #7
Source File: test_wintypes.py From datafari with Apache License 2.0 | 5 votes |
def test_variant_bool(self): from ctypes import wintypes # reads 16-bits from memory, anything non-zero is True for true_value in (1, 32767, 32768, 65535, 65537): true = POINTER(c_int16)(c_int16(true_value)) value = cast(true, POINTER(wintypes.VARIANT_BOOL)) self.assertEqual(repr(value.contents), 'VARIANT_BOOL(True)') vb = wintypes.VARIANT_BOOL() self.assertIs(vb.value, False) vb.value = True self.assertIs(vb.value, True) vb.value = true_value self.assertIs(vb.value, True) for false_value in (0, 65536, 262144, 2**33): false = POINTER(c_int16)(c_int16(false_value)) value = cast(false, POINTER(wintypes.VARIANT_BOOL)) self.assertEqual(repr(value.contents), 'VARIANT_BOOL(False)') # allow any bool conversion on assignment to value for set_value in (65536, 262144, 2**33): vb = wintypes.VARIANT_BOOL() vb.value = set_value self.assertIs(vb.value, True) vb = wintypes.VARIANT_BOOL() vb.value = [2, 3] self.assertIs(vb.value, True) vb.value = [] self.assertIs(vb.value, False)
Example #8
Source File: test_wintypes.py From Project-New-Reign---Nemesis-Main with GNU General Public License v3.0 | 5 votes |
def test_variant_bool(self): from ctypes import wintypes # reads 16-bits from memory, anything non-zero is True for true_value in (1, 32767, 32768, 65535, 65537): true = POINTER(c_int16)(c_int16(true_value)) value = cast(true, POINTER(wintypes.VARIANT_BOOL)) self.assertEqual(repr(value.contents), 'VARIANT_BOOL(True)') vb = wintypes.VARIANT_BOOL() self.assertIs(vb.value, False) vb.value = True self.assertIs(vb.value, True) vb.value = true_value self.assertIs(vb.value, True) for false_value in (0, 65536, 262144, 2**33): false = POINTER(c_int16)(c_int16(false_value)) value = cast(false, POINTER(wintypes.VARIANT_BOOL)) self.assertEqual(repr(value.contents), 'VARIANT_BOOL(False)') # allow any bool conversion on assignment to value for set_value in (65536, 262144, 2**33): vb = wintypes.VARIANT_BOOL() vb.value = set_value self.assertIs(vb.value, True) vb = wintypes.VARIANT_BOOL() vb.value = [2, 3] self.assertIs(vb.value, True) vb.value = [] self.assertIs(vb.value, False)
Example #9
Source File: test_wintypes.py From odoo13-x64 with GNU General Public License v3.0 | 5 votes |
def test_variant_bool(self): from ctypes import wintypes # reads 16-bits from memory, anything non-zero is True for true_value in (1, 32767, 32768, 65535, 65537): true = POINTER(c_int16)(c_int16(true_value)) value = cast(true, POINTER(wintypes.VARIANT_BOOL)) self.assertEqual(repr(value.contents), 'VARIANT_BOOL(True)') vb = wintypes.VARIANT_BOOL() self.assertIs(vb.value, False) vb.value = True self.assertIs(vb.value, True) vb.value = true_value self.assertIs(vb.value, True) for false_value in (0, 65536, 262144, 2**33): false = POINTER(c_int16)(c_int16(false_value)) value = cast(false, POINTER(wintypes.VARIANT_BOOL)) self.assertEqual(repr(value.contents), 'VARIANT_BOOL(False)') # allow any bool conversion on assignment to value for set_value in (65536, 262144, 2**33): vb = wintypes.VARIANT_BOOL() vb.value = set_value self.assertIs(vb.value, True) vb = wintypes.VARIANT_BOOL() vb.value = [2, 3] self.assertIs(vb.value, True) vb.value = [] self.assertIs(vb.value, False)
Example #10
Source File: test_wintypes.py From android_universal with MIT License | 5 votes |
def test_variant_bool(self): from ctypes import wintypes # reads 16-bits from memory, anything non-zero is True for true_value in (1, 32767, 32768, 65535, 65537): true = POINTER(c_int16)(c_int16(true_value)) value = cast(true, POINTER(wintypes.VARIANT_BOOL)) self.assertEqual(repr(value.contents), 'VARIANT_BOOL(True)') vb = wintypes.VARIANT_BOOL() self.assertIs(vb.value, False) vb.value = True self.assertIs(vb.value, True) vb.value = true_value self.assertIs(vb.value, True) for false_value in (0, 65536, 262144, 2**33): false = POINTER(c_int16)(c_int16(false_value)) value = cast(false, POINTER(wintypes.VARIANT_BOOL)) self.assertEqual(repr(value.contents), 'VARIANT_BOOL(False)') # allow any bool conversion on assignment to value for set_value in (65536, 262144, 2**33): vb = wintypes.VARIANT_BOOL() vb.value = set_value self.assertIs(vb.value, True) vb = wintypes.VARIANT_BOOL() vb.value = [2, 3] self.assertIs(vb.value, True) vb.value = [] self.assertIs(vb.value, False)