summaryrefslogtreecommitdiff
path: root/utils/gen-header.sh
AgeCommit message (Collapse)Author
2021-11-24utils: Convert to pragma onceKieran Bingham
Remove the verbose #ifndef/#define/#endif pattern for maintaining header idempotency, and replace it with a simple #pragma once. This simplifies the headers, and prevents redundant changes when header files get moved. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
2020-09-24libcamera: Move Header generation utilities to utilsKieran Bingham
Move the GPL2 utilities which handle generation of controls, formats and the top level libcamera header to the utils subtree. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
lass="hl opt">) { } protected: void run() { for (unsigned int i = 0; i < iterations_; ++i) { this_thread::sleep_for(chrono::milliseconds(50)); } } private: unsigned int iterations_; }; class ThreadTest : public Test { protected: int init() { return 0; } int run() { /* Test Thread() retrieval for the main thread. */ Thread *thread = Thread::current(); if (!thread) { cout << "Thread::current() failed to main thread" << endl; return TestFail; } if (!thread->isRunning()) { cout << "Main thread is not running" << endl; return TestFail; } /* Test starting the main thread, the test shall not crash. */ thread->start(); /* Test the running state of a custom thread. */ thread = new Thread(); thread->start(); if (!thread->isRunning()) { cout << "Thread is not running after being started" << endl; return TestFail; } thread->exit(0); thread->wait(); if (thread->isRunning()) { cout << "Thread is still running after finishing" << endl; return TestFail; } delete thread; return TestPass; } void cleanup() { } }; TEST_REGISTER(ThreadTest)