File tree Expand file tree Collapse file tree 3 files changed +54
-3
lines changed Expand file tree Collapse file tree 3 files changed +54
-3
lines changed Original file line number Diff line number Diff line change @@ -262,6 +262,10 @@ def visit_variable(self ):
262
262
self .writer ( ' ' * curr_level * self .INDENT_SIZE + 'type: %s' % self .__inst .type .decl_string + os .linesep )
263
263
self .writer ( ' ' * curr_level * self .INDENT_SIZE + 'value: %s' % self .__inst .value + os .linesep )
264
264
if self .__print_details :
265
+ if self .__inst .bits :
266
+ bits = 'bits: %d' % (self .__inst .bits )
267
+ self .writer ( ' ' * curr_level * self .INDENT_SIZE + bits .ljust ( self .JUSTIFY ) + os .linesep )
268
+
265
269
byte_size = 'size: %d' % (self .__inst .type .byte_size )
266
270
self .writer ( ' ' * curr_level * self .INDENT_SIZE + byte_size .ljust ( self .JUSTIFY ) + os .linesep )
267
271
try :
Original file line number Diff line number Diff line change
1
+ # Copyright 2004-2008 Roman Yakovenko.
2
+ # Distributed under the Boost Software License, Version 1.0. (See
3
+ # accompanying file LICENSE_1_0.txt or copy at
4
+ # http://www.boost.org/LICENSE_1_0.txt)
5
+
6
+ import os
7
+ import sys
8
+ import unittest
9
+ import autoconfig
10
+ import parser_test_case
11
+
12
+ from pygccxml import utils
13
+ from pygccxml import parser
14
+ from pygccxml import declarations
15
+
16
+ code = \
17
+ """
18
+ class A {
19
+ public:
20
+ virtual ~A() = 0;
21
+ unsigned int a : 1;
22
+ unsigned int unused : 31;
23
+ };
24
+ """
25
+
26
+ class tester_t ( parser_test_case .parser_test_case_t ):
27
+ def __init__ (self , * args ):
28
+ parser_test_case .parser_test_case_t .__init__ (self , * args )
29
+
30
+ def test (self ):
31
+ src_reader = parser .source_reader_t ( self .config )
32
+ global_ns = declarations .get_global_namespace ( src_reader .read_string ( code ) )
33
+ self .failUnless ( global_ns .var ( 'a' ).bits == 1 )
34
+ self .failUnless ( global_ns .var ( 'unused' ).bits == 31 )
35
+
36
+ def create_suite ():
37
+ suite = unittest .TestSuite ()
38
+ suite .addTest ( unittest .makeSuite (tester_t ))
39
+ return suite
40
+
41
+ def run_suite ():
42
+ unittest .TextTestRunner (verbosity = 2 ).run ( create_suite () )
43
+
44
+ if __name__ == "__main__" :
45
+ run_suite ()
Original file line number Diff line number Diff line change 55
55
import calling_convention_tester
56
56
import const_volatile_arg_tester
57
57
import array_bug_tester
58
- import gccxml10185_tester
59
58
import gccxml10183_tester
59
+ import gccxml10184_tester
60
+ import gccxml10185_tester
60
61
61
62
testers = [
62
63
decl_string_tester
108
109
, calling_convention_tester
109
110
, const_volatile_arg_tester
110
111
, array_bug_tester
111
- , gccxml10185_tester
112
- , gccxml10183_tester
112
+ , gccxml10183_tester
113
+ , gccxml10184_tester
114
+ , gccxml10185_tester
113
115
]
114
116
115
117
def create_suite ():
You can’t perform that action at this time.
0 commit comments