/bitfield/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/bitfield/trunk

« back to all changes in this revision

Viewing changes to src/main.vala

  • Committer: Gustav Hartvigsson
  • Date: 2020-11-03 19:35:25 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20201103193525-tewczqy146ln4spx
* Made it able to be compiled as a library
* Added C test
* Added more tests to main.vala

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
  uint16 t1 = 0;
20
20
  BitField.set (ref t1, "foo", TestFields.C, 137);
21
21
  print ("%i\n", t1);
22
 
  
 
22
 
 
23
  BitField.set (ref t1, "foo", TestFields.B, 3);
 
24
  print ("%i\n", t1);
 
25
 
 
26
  BitField.set (ref t1, "foo", TestFields.A, 7);
 
27
  print ("%i\n", t1);
 
28
 
23
29
  uint16 t2 = BitField.get (t1 ,"foo", TestFields.C);
24
 
  print ("%i\n", t2);
25
 
  
 
30
  print ("C: %i\n", t2);
 
31
  t2 = BitField.get (t1 ,"foo", TestFields.B);
 
32
  print ("B: %i\n", t2);
 
33
  t2 = BitField.get (t1 ,"foo", TestFields.A);
 
34
  print ("A: %i\n", t2);
26
35
 
27
36
  var my_var1 = BitField.FieldInfo.static_overlap (info[0], info[1]);
28
37