summaryrefslogtreecommitdiff
path: root/test/v4l2_videodevice
ModeNameSize
-rw-r--r--buffer_cache.cpp5571logplain
-rw-r--r--buffer_sharing.cpp4726logplain
-rw-r--r--capture_async.cpp1972logplain
-rw-r--r--controls.cpp4391logplain
-rw-r--r--dequeue_watchdog.cpp2242logplain
-rw-r--r--double_open.cpp685logplain
-rw-r--r--formats.cpp1751logplain
-rw-r--r--meson.build1163logplain
-rw-r--r--request_buffers.cpp531logplain
-rw-r--r--stream_on_off.cpp653logplain
-rw-r--r--v4l2_m2mdevice.cpp4841logplain
-rw-r--r--v4l2_videodevice_test.cpp2042logplain
-rw-r--r--v4l2_videodevice_test.h1067logplain
>(data_, 0, sizeof(data_)); size_ = 0; ret = write(pipefd_[1], data.data(), data.size()); if (ret < 0) { cout << "Pipe write failed" << endl; return TestFail; } timeout.start(100); dispatcher->processEvents(); timeout.stop(); if (static_cast<size_t>(size_) != data.size()) { cout << "Event notifier read ready test failed" << endl; return TestFail; } /* Test read notification without data. */ notified_ = false; timeout.start(100); dispatcher->processEvents(); timeout.stop(); if (notified_) { cout << "Event notifier read no ready test failed" << endl; return TestFail; } /* Test read notifier disabling. */ notified_ = false; notifier_->setEnabled(false); ret = write(pipefd_[1], data.data(), data.size()); if (ret < 0) { cout << "Pipe write failed" << endl; return TestFail; } timeout.start(100); dispatcher->processEvents(); timeout.stop(); if (notified_) { cout << "Event notifier read disabling failed" << endl; return TestFail; } /* Test read notifier enabling. */ notified_ = false; notifier_->setEnabled(true); timeout.start(100); dispatcher->processEvents(); timeout.stop(); if (!notified_) { cout << "Event notifier read enabling test failed" << endl; return TestFail; } return TestPass; } void cleanup() { delete notifier_; close(pipefd_[0]); close(pipefd_[1]); } private: int pipefd_[2]; EventNotifier *notifier_; bool notified_; char data_[16]; ssize_t size_; }; TEST_REGISTER(EventTest)