Exemple #1
0
 def _set_flag(self, flag):
     efd = eventfd.EventFD(flags=flag)
     tools.assert_equals(
         0, eventfd.EFD_CLOEXEC & fcntl.fcntl(efd, fcntl.F_GETFD))
     return efd
Exemple #2
0
 def test_close(self):
     efd = eventfd.EventFD()
     efd.close()
     tools.assert_equals(efd.fileno(), -1)
Exemple #3
0
 def test_write(self):
     value = 10
     efd = eventfd.EventFD()
     efd.write(value)
     tools.assert_equals(efd.read(), value)
Exemple #4
0
 def test_create(self):
     efd = eventfd.EventFD()
     tools.assert_not_equals(efd, None)