~kgunn72/mir/dont-crash-when-shooting-invalid-surface

« back to all changes in this revision

Viewing changes to tests/unit-tests/compositor/test_switching_bundle.cpp

  • Committer: Tarmac
  • Author(s): Alan Griffiths, Alexandros Frantzis, Daniel van Vugt, Kevin DuBois, Christopher James Halse Rogers, chris.gagnon, Mathieu Trudel-Lapierre, Robert Carr, Automatic PS uploader, Kevin Gunn, Daniel d'Andrada, Christopher James Halse Rogers, Michael Terry, Brandon Schaefer, Timo Jyrinki, Mir Team, Andreas Pokorny
  • Date: 2013-12-20 11:11:22 UTC
  • mfrom: (1169.1.1 version-0.1.3)
  • Revision ID: tarmac-20131220111122-h503fd1fnq7pn9za
Latest upstream release: Mir 0.1.3 (r1298).

Approved by Alan Griffiths, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
        basic_properties =
43
43
        {
44
44
            geom::Size{3, 4},
45
 
            geom::PixelFormat::abgr_8888,
 
45
            mir_pixel_format_abgr_8888,
46
46
            mg::BufferUsage::hardware
47
47
        };
48
48
    }
55
55
TEST_F(SwitchingBundleTest, sync_swapper_by_default)
56
56
{
57
57
    mg::BufferProperties properties{geom::Size{7, 8},
58
 
                                    geom::PixelFormat::argb_8888,
 
58
                                    mir_pixel_format_argb_8888,
59
59
                                    mg::BufferUsage::software};
60
60
 
61
61
    for (int nbuffers = mc::SwitchingBundle::min_buffers;
200
200
    auto client1 = bundle.client_acquire();
201
201
    auto client1_id = client1->id();
202
202
    bundle.client_release(client1);
203
 
    client1.reset();
204
203
 
205
204
    auto client2 = bundle.client_acquire();
206
205
    bundle.client_release(client2);
207
 
    client2.reset();
208
206
 
209
207
    auto compositor = bundle.compositor_acquire(1);
210
208
    EXPECT_EQ(client1_id, compositor->id());
320
318
        unsigned long frameno = 0;
321
319
 
322
320
        auto client = bundle.client_acquire();
323
 
 
324
 
        EXPECT_THROW(
325
 
            bundle.compositor_release(client),
326
 
            std::logic_error
327
 
        );
328
321
        bundle.client_release(client);
329
322
 
330
323
        auto compositor1 = bundle.compositor_acquire(++frameno);
429
422
 
430
423
        EXPECT_NE(client->id(), snapshot->id());
431
424
 
432
 
        EXPECT_THROW(
433
 
            bundle.snapshot_release(client),
434
 
            std::logic_error
435
 
        );
436
 
 
437
425
        bundle.snapshot_release(snapshot);
438
426
 
439
427
        EXPECT_THROW(
626
614
 
627
615
        const int nframes = 100;
628
616
        mg::BufferID expect[mc::SwitchingBundle::max_buffers];
629
 
        std::shared_ptr<mg::Buffer> buf[mc::SwitchingBundle::max_buffers];
 
617
        mg::Buffer* buf[mc::SwitchingBundle::max_buffers];
630
618
 
631
619
        for (int b = 0; b < nbuffers; b++)
632
620
        {
810
798
                auto client = bundle.client_acquire();
811
799
                ASSERT_EQ(expect_size, client->size());
812
800
                bundle.client_release(client);
813
 
    
 
801
 
814
802
                auto compositor = bundle.compositor_acquire(frameno++);
815
803
                ASSERT_EQ(expect_size, compositor->size());
816
804
                bundle.compositor_release(compositor);
851
839
 
852
840
        width = width0;
853
841
        height = height0;
854
 
    
 
842
 
855
843
        for (int consume = 0; consume < nbuffers; ++consume)
856
844
        {
857
845
            geom::Size expect_size{width, height};