~raof/mir/xserver-spawner

« back to all changes in this revision

Viewing changes to tests/unit-tests/test_asio_main_loop.cpp

  • Committer: Christopher James Halse Rogers
  • Date: 2014-01-24 03:39:18 UTC
  • mfrom: (1337.1.12 subprocess-wrapper)
  • Revision ID: christopher.halse.rogers@canonical.com-20140124033918-yifjn8733fhv8soi
Merge process::Spawner work required to do Xserver startup properly

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 */
18
18
 
19
19
#include "mir/asio_main_loop.h"
20
 
#include "mir_test/pipe.h"
 
20
#include "mir/pipe.h"
21
21
 
22
22
#include <gtest/gtest.h>
23
23
 
27
27
#include <sys/types.h>
28
28
#include <unistd.h>
29
29
 
30
 
namespace mt = mir::test;
 
30
namespace mp = mir::pipe;
31
31
 
32
32
TEST(AsioMainLoopTest, signal_handled)
33
33
{
148
148
 
149
149
TEST(AsioMainLoopTest, fd_data_handled)
150
150
{
151
 
    mt::Pipe p;
 
151
    mp::Pipe p;
152
152
    char const data_to_write{'a'};
153
153
    int handled_fd{0};
154
154
    char data_read{0};
173
173
 
174
174
TEST(AsioMainLoopTest, multiple_fds_with_single_handler_handled)
175
175
{
176
 
    std::vector<mt::Pipe> const pipes(2);
 
176
    std::vector<mp::Pipe> const pipes(2);
177
177
    size_t const num_elems_to_send{10};
178
178
    std::vector<int> handled_fds;
179
179
    std::vector<size_t> elems_read;
223
223
 
224
224
TEST(AsioMainLoopTest, multiple_fd_handlers_are_called)
225
225
{
226
 
    std::vector<mt::Pipe> const pipes(3);
 
226
    std::vector<mp::Pipe> const pipes(3);
227
227
    std::vector<int> const elems_to_send{10,11,12};
228
228
    std::vector<int> handled_fds{0,0,0};
229
229
    std::vector<int> elems_read{0,0,0};