~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

Viewing changes to daemon/src/video/test/test_shm.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2015-01-07 14:51:16 UTC
  • mfrom: (4.3.5 sid)
  • Revision ID: package-import@ubuntu.com-20150107145116-yxnafinf4lrdvrmx
Tags: 1.4.1-0.1ubuntu1
* Merge with Debian, remaining changes:
 - Drop soprano, nepomuk build-dep
* Drop ubuntu patches, now upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
#include <cstring>
40
40
#include <cassert>
41
41
 
42
 
namespace {
43
 
 
44
 
std::atomic<bool> done(false);
45
 
 
46
 
void signal_handler(int /*sig*/)
 
42
static std::atomic<bool> done(false);
 
43
 
 
44
static void
 
45
signal_handler(int /*sig*/)
47
46
{
48
47
    done = true;
49
48
}
50
49
 
51
 
const char test_data[] = "abcdefghijklmnopqrstuvwxyz";
 
50
static const char test_data[] = "abcdefghijklmnopqrstuvwxyz";
52
51
 
53
 
void sink_thread()
 
52
static void
 
53
sink_thread()
54
54
{
55
55
    sfl_video::SHMSink sink("bob");;
56
56
    if (!sink.start())
66
66
    std::cerr << "Exitting sink thread" << std::endl;
67
67
}
68
68
 
69
 
void run_client()
 
69
static void
 
70
run_client()
70
71
{
71
72
    SHMSrc src("bob");;
72
73
    bool started = false;
92
93
    std::cerr << "Got characters, exitting client process" << std::endl;
93
94
}
94
95
 
95
 
void run_daemon()
 
96
static void
 
97
run_daemon()
96
98
{
97
99
    std::thread bob(sink_thread);
98
100
    /* Wait for child process. */
116
118
    // wait for thread
117
119
    bob.join();
118
120
}
119
 
 
120
 
} // end anonymous namespace
121
 
 
122
121
int main()
123
122
{
124
123
    signal(SIGINT, signal_handler);