summaryrefslogtreecommitdiff
path: root/.gitignore
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-03-04 23:51:30 +0100
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-03-06 17:45:48 +0100
commit353851b773a6f2a381e5b4e93598c44bbd42903a (patch)
treee78f81b3268c023e2ab639259c89f2cddf0431d3 /.gitignore
parent257df552a454d7afdc339ef88040e986400d2d89 (diff)
libcamera: V4L2BufferCache: Mark Entry::operator==() as const
The comparison operator does not change any state, mark it as const. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to '.gitignore')
0 files changed, 0 insertions, 0 deletions
="hl kwb">int run(int status) { usleep(50000); return status; } }; class ProcessTest : public Test { public: ProcessTest() : exitStatus_(Process::NotExited), exitCode_(-1) { } protected: int run() { EventDispatcher *dispatcher = Thread::current()->eventDispatcher(); Timer timeout; int exitCode = 42; vector<std::string> args; args.push_back(to_string(exitCode)); proc_.finished.connect(this, &ProcessTest::procFinished); /* Test that kill() on an unstarted process is safe. */ proc_.kill(); /* Test starting the process and retrieving the exit code. */ int ret = proc_.start("/proc/self/exe", args); if (ret) { cerr << "failed to start process" << endl; return TestFail; } timeout.start(2000); while (timeout.isRunning() && exitStatus_ == Process::NotExited) dispatcher->processEvents(); if (exitStatus_ != Process::NormalExit) { cerr << "process did not exit normally" << endl; return TestFail; } if (exitCode != exitCode_) { cerr << "exit code should be " << exitCode << ", actual is " << exitCode_ << endl; return TestFail; } return TestPass; } private: void procFinished([[maybe_unused]] Process *proc, enum Process::ExitStatus exitStatus, int exitCode) { exitStatus_ = exitStatus; exitCode_ = exitCode; } ProcessManager processManager_; Process proc_; enum Process::ExitStatus exitStatus_; int exitCode_; }; /* * Can't use TEST_REGISTER() as single binary needs to act as both * parent and child processes. */ int main(int argc, char **argv) { if (argc == 2) { int status = std::stoi(argv[1]); ProcessTestChild child; return child.run(status); } return ProcessTest().execute(); }