summaryrefslogtreecommitdiff
path: root/test/file.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-07-18 09:15:57 +0100
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-07-28 13:47:49 +0300
commit0c84c67e39e40db43605af0ee0a65b91114f6315 (patch)
tree3224d03582398373e2076c6e6d75b5ade3e4e300 /test/file.cpp
parent38987e165c2835d3d172be8a39c64c50903c86d6 (diff)
ipa: raspberrypi: Replace tabs with spaces in tuning data files
Tuning data files mostly use spaces for indentation, with occasional stray tabs. Use spaces consistently. This allows parsing the tuning files with libyaml, preparing to replace the dependency on boost. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Tested-by: Naushir Patuck <naush@raspberrypi.com>
Diffstat (limited to 'test/file.cpp')
0 files changed, 0 insertions, 0 deletions
opt">{ NoSignal, InvalidThread, SignalReceived, }; SignalReceiver() : status_(NoSignal) { } Status status() const { return status_; } int value() const { return value_; } void reset() { status_ = NoSignal; value_ = 0; } void slot(int value) { if (Thread::current() != thread()) status_ = InvalidThread; else status_ = SignalReceived; value_ = value; } private: Status status_; int value_; }; class SignalThreadsTest : public Test { protected: int run() { SignalReceiver receiver; signal_.connect(&receiver, &SignalReceiver::slot); /* Test that a signal is received in the main thread. */ signal_.emit(0); switch (receiver.status()) { case SignalReceiver::NoSignal: cout << "No signal received for direct connection" << endl; return TestFail; case SignalReceiver::InvalidThread: cout << "Signal received in incorrect thread " "for direct connection" << endl; return TestFail; default: break; } /* * Move the object to a thread and verify that the signal is * correctly delivered, with the correct data. */ receiver.reset(); receiver.moveToThread(&thread_); thread_.start(); signal_.emit(42); this_thread::sleep_for(chrono::milliseconds(100)); switch (receiver.status()) { case SignalReceiver::NoSignal: cout << "No signal received for message connection" << endl; return TestFail; case SignalReceiver::InvalidThread: cout << "Signal received in incorrect thread " "for message connection" << endl; return TestFail; default: break; } if (receiver.value() != 42) { cout << "Signal received with incorrect value" << endl; return TestFail; } return TestPass; } void cleanup() { thread_.exit(0); thread_.wait(); } private: Thread thread_; Signal<int> signal_; }; TEST_REGISTER(SignalThreadsTest)