~mc-return/compiz/compiz.merge-src-header-files-cleanup

« back to all changes in this revision

Viewing changes to src/plugin/tests/test-plugin.cpp

  • Committer: MC Return
  • Date: 2013-06-20 05:56:13 UTC
  • mfrom: (3724.2.16 0.9.10)
  • Revision ID: mc.return@gmx.net-20130620055613-8dp00nmw2jpm3ptu
Merged latest lp:compiz and fixed conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <boost/shared_ptr.hpp>
 
2
#include <boost/foreach.hpp>
 
3
#define foreach BOOST_FOREACH
 
4
 
1
5
#include "core/plugin.h"
2
6
 
3
 
// This prevents an instantiation error - not sure why ATM
4
 
#include "core/screen.h"
5
 
 
6
7
// Get rid of stupid macro from X.h
7
8
// Why, oh why, are we including X.h?
8
9
#undef None
10
11
#include <gtest/gtest.h>
11
12
#include <gmock/gmock.h>
12
13
#include <gtest_shared_tmpenv.h>
13
 
 
14
 
namespace {
 
14
#include <gtest_shared_autodestroy.h>
 
15
 
 
16
/* This is a link-seam so that we don't have to include screen.h */
 
17
class CompAction
 
18
{
 
19
};
 
20
 
 
21
class CompMatch
 
22
{
 
23
};
 
24
 
 
25
namespace
 
26
{
15
27
 
16
28
class PluginFilesystem
17
29
{
18
 
public:
19
 
    virtual bool
20
 
    LoadPlugin(CompPlugin *p, const char *path, const char *name) const = 0;
21
 
 
22
 
    virtual void
23
 
    UnloadPlugin(CompPlugin *p) const = 0;
24
 
 
25
 
    static PluginFilesystem const* instance;
26
 
 
27
 
protected:
28
 
    PluginFilesystem();
29
 
    virtual ~PluginFilesystem() {}
 
30
    public:
 
31
 
 
32
        virtual bool
 
33
        LoadPlugin(CompPlugin *p, const char *path, const char *name) const = 0;
 
34
 
 
35
        virtual void
 
36
        UnloadPlugin(CompPlugin *p) const = 0;
 
37
 
 
38
        static PluginFilesystem const* instance;
 
39
 
 
40
    protected:
 
41
 
 
42
        PluginFilesystem();
 
43
        virtual ~PluginFilesystem() {}
30
44
};
31
45
 
32
46
class MockPluginFilesystem : public PluginFilesystem
33
47
{
34
 
public:
35
 
    MOCK_CONST_METHOD3(LoadPlugin, bool (CompPlugin *, const char *, const char *));
36
 
 
37
 
    MOCK_CONST_METHOD1(UnloadPlugin, void (CompPlugin *p));
 
48
    public:
 
49
 
 
50
        MOCK_CONST_METHOD3(LoadPlugin, bool (CompPlugin *, const char *, const char *));
 
51
 
 
52
        MOCK_CONST_METHOD1(UnloadPlugin, void (CompPlugin *p));
38
53
};
39
54
 
40
 
class MockVTable : public CompPlugin::VTable
 
55
class MockVTable :
 
56
    public CompPlugin::VTable
41
57
{
42
 
public:
43
 
    MOCK_METHOD0(init, bool ());
 
58
    public:
 
59
        MOCK_METHOD0(init, bool ());
 
60
        MOCK_METHOD0(markReadyToInstantiate, void ());
 
61
        MOCK_METHOD0(markNoFurtherInstantiation, void ());
44
62
};
45
63
 
46
64
 
59
77
 
60
78
PluginFilesystem::PluginFilesystem()
61
79
{
62
 
        ::loaderLoadPlugin = ::ThunkLoadPluginProc;
63
 
        ::loaderUnloadPlugin = ::ThunkUnloadPluginProc;
 
80
    ::loaderLoadPlugin = ::ThunkLoadPluginProc;
 
81
    ::loaderUnloadPlugin = ::ThunkUnloadPluginProc;
64
82
 
65
 
        instance = this;
 
83
    instance = this;
66
84
}
67
85
 
68
86
PluginFilesystem const* PluginFilesystem::instance = 0;
69
87
 
70
88
} // (abstract) namespace
71
89
 
72
 
 
73
 
 
74
 
TEST(PluginTest, load_non_existant_plugin_must_fail)
75
 
{
76
 
    MockPluginFilesystem mockfs;
77
 
 
 
90
class PluginTest :
 
91
    public ::testing::Test
 
92
{
 
93
    public:
 
94
 
 
95
        MockPluginFilesystem mockfs;
 
96
};
 
97
 
 
98
TEST_F (PluginTest, load_non_existant_plugin_must_fail)
 
99
{
78
100
    using namespace testing;
79
101
 
80
102
    EXPECT_CALL(mockfs, LoadPlugin(Ne((void*)0), EndsWith(HOME_PLUGINDIR), StrEq("dummy"))).
91
113
    ASSERT_EQ(0, CompPlugin::load("dummy"));
92
114
}
93
115
 
94
 
TEST(PluginTest, load_plugin_from_HOME_PLUGINDIR_succeeds)
 
116
TEST_F (PluginTest, load_plugin_from_HOME_PLUGINDIR_succeeds)
95
117
{
96
 
    MockPluginFilesystem mockfs;
97
 
 
98
118
    using namespace testing;
99
119
 
100
120
    EXPECT_CALL(mockfs, LoadPlugin(Ne((void*)0), EndsWith(HOME_PLUGINDIR), StrEq("dummy"))).
114
134
    CompPlugin::unload(cp);
115
135
}
116
136
 
117
 
TEST(PluginTest, load_plugin_from_PLUGINDIR_succeeds)
 
137
TEST_F (PluginTest, load_plugin_from_PLUGINDIR_succeeds)
118
138
{
119
 
    MockPluginFilesystem mockfs;
120
 
 
121
139
    using namespace testing;
122
140
 
123
141
    EXPECT_CALL(mockfs, LoadPlugin(Ne((void*)0), EndsWith(HOME_PLUGINDIR), StrEq("dummy"))).
137
155
    CompPlugin::unload(cp);
138
156
}
139
157
 
140
 
TEST(PluginTest, load_plugin_from_COMPIZ_PLUGIN_DIR_env_succeeds)
 
158
TEST_F (PluginTest, load_plugin_from_COMPIZ_PLUGIN_DIR_env_succeeds)
141
159
{
142
160
    const char *COMPIZ_PLUGIN_DIR_VALUE = "/path/to/plugin/dir";
143
161
    TmpEnv env ("COMPIZ_PLUGIN_DIR", COMPIZ_PLUGIN_DIR_VALUE);
144
 
    MockPluginFilesystem mockfs;
145
162
 
146
163
    using namespace testing;
147
164
 
165
182
    CompPlugin::unload(cp);
166
183
}
167
184
 
168
 
TEST(PluginTest, load_plugin_from_void_succeeds)
 
185
TEST_F (PluginTest, load_plugin_from_void_succeeds)
169
186
{
170
 
    MockPluginFilesystem mockfs;
171
 
 
172
187
    using namespace testing;
173
188
 
174
189
    EXPECT_CALL(mockfs, LoadPlugin(Ne((void*)0), EndsWith(HOME_PLUGINDIR), StrEq("dummy"))).
188
203
    CompPlugin::unload(cp);
189
204
}
190
205
 
191
 
TEST(PluginTest, when_we_push_plugin_init_is_called)
192
 
{
193
 
    MockPluginFilesystem mockfs;
194
 
 
195
 
    using namespace testing;
196
 
 
197
 
    EXPECT_CALL(mockfs, LoadPlugin(Ne((void*)0), EndsWith(HOME_PLUGINDIR), StrEq("dummy"))).
198
 
        WillOnce(Return(true));
199
 
 
200
 
    EXPECT_CALL(mockfs, LoadPlugin(Ne((void*)0), EndsWith(PLUGINDIR), StrEq("dummy"))).
201
 
        Times(AtMost(0));
202
 
 
203
 
    EXPECT_CALL(mockfs, LoadPlugin(Ne((void*)0), Eq((void*)0), StrEq("dummy"))).
204
 
        Times(AtMost(0));
205
 
 
206
 
    EXPECT_CALL(mockfs, UnloadPlugin(_)).Times(1);
207
 
 
208
 
    MockVTable mockVtable;
209
 
    EXPECT_CALL(mockVtable, init()).WillOnce(Return(true));
210
 
 
211
 
    CompPlugin* cp = CompPlugin::load("dummy");
212
 
 
213
 
    cp->vTable = &mockVtable;
214
 
 
215
 
    CompPlugin::push(cp);
216
 
    ASSERT_EQ(cp, CompPlugin::pop());
217
 
    CompPlugin::unload(cp);
 
206
TEST_F (PluginTest, when_we_load_plugin_init_load_is_called_without_null_pointer)
 
207
{
 
208
    using namespace testing;
 
209
 
 
210
    EXPECT_CALL (mockfs, LoadPlugin (NotNull (),
 
211
                                     EndsWith(HOME_PLUGINDIR),
 
212
                                     StrEq("dummy")))
 
213
        .Times (1)
 
214
        .WillOnce (Return (true));
 
215
 
 
216
    EXPECT_CALL(mockfs, UnloadPlugin(_)).Times(AtLeast (0));
 
217
 
 
218
    CompPlugin* cp = CompPlugin::load("dummy");
 
219
    CompPlugin::unload(cp);
 
220
}
 
221
 
 
222
TEST_F (PluginTest, when_we_push_plugin_init_is_called)
 
223
{
 
224
    using namespace testing;
 
225
 
 
226
    EXPECT_CALL (mockfs, LoadPlugin (_, _, _)).Times (AtLeast (0));
 
227
    EXPECT_CALL (mockfs, UnloadPlugin(_)).Times (AtLeast (0));
 
228
 
 
229
    ON_CALL(mockfs, LoadPlugin (_, _, _)).
 
230
        WillByDefault (Return (true));
 
231
 
 
232
    MockVTable mockVtable;
 
233
    EXPECT_CALL (mockVtable, markReadyToInstantiate ()).Times (AtLeast (0));
 
234
    EXPECT_CALL (mockVtable, markNoFurtherInstantiation ())
 
235
        .Times (AtLeast (0));
 
236
    EXPECT_CALL (mockVtable, init ()).WillOnce (Return (true));
 
237
 
 
238
    CompPlugin* cp = CompPlugin::load("dummy");
 
239
 
 
240
    cp->vTable = &mockVtable;
 
241
 
 
242
    CompPlugin::push(cp);
 
243
    CompPlugin::pop ();
 
244
    CompPlugin::unload(cp);
 
245
}
 
246
 
 
247
TEST_F (PluginTest, when_we_push_plugin_mark_ready_to_instantiate_is_called)
 
248
{
 
249
    using namespace testing;
 
250
 
 
251
    EXPECT_CALL (mockfs, LoadPlugin (_, _, _)).Times (AtLeast (0));
 
252
    EXPECT_CALL (mockfs, UnloadPlugin(_)).Times (AtLeast (0));
 
253
 
 
254
    ON_CALL(mockfs, LoadPlugin (_, _, _)).
 
255
        WillByDefault (Return (true));
 
256
 
 
257
    MockVTable mockVtable;
 
258
    EXPECT_CALL (mockVtable, init ())
 
259
        .Times (AtLeast (0))
 
260
        .WillOnce (Return (true));
 
261
    EXPECT_CALL (mockVtable, markReadyToInstantiate ()).Times (1);
 
262
    EXPECT_CALL (mockVtable, markNoFurtherInstantiation ())
 
263
        .Times (AtLeast (0));
 
264
 
 
265
    CompPlugin* cp = CompPlugin::load("dummy");
 
266
 
 
267
    cp->vTable = &mockVtable;
 
268
 
 
269
    CompPlugin::push(cp);
 
270
    CompPlugin::pop ();
 
271
    CompPlugin::unload(cp);
 
272
}
 
273
 
 
274
TEST_F (PluginTest, when_we_pop_plugin_mark_no_further_instantiation_is_called)
 
275
{
 
276
    using namespace testing;
 
277
 
 
278
    EXPECT_CALL (mockfs, LoadPlugin (_, _, _)).Times (AtLeast (0));
 
279
    EXPECT_CALL (mockfs, UnloadPlugin(_)).Times (AtLeast (0));
 
280
 
 
281
    ON_CALL(mockfs, LoadPlugin (_, _, _)).
 
282
        WillByDefault (Return (true));
 
283
 
 
284
    MockVTable mockVtable;
 
285
    EXPECT_CALL (mockVtable, init ())
 
286
        .Times (AtLeast (0))
 
287
        .WillOnce (Return (true));
 
288
    EXPECT_CALL (mockVtable, markReadyToInstantiate ()).Times (AtLeast (0));
 
289
 
 
290
    CompPlugin* cp = CompPlugin::load("dummy");
 
291
 
 
292
    cp->vTable = &mockVtable;
 
293
 
 
294
    CompPlugin::push(cp);
 
295
 
 
296
    EXPECT_CALL (mockVtable, markNoFurtherInstantiation ())
 
297
        .Times (1);
 
298
 
 
299
    CompPlugin::pop ();
 
300
    CompPlugin::unload(cp);
 
301
}
 
302
 
 
303
TEST_F (PluginTest, pop_returns_plugin_pointer)
 
304
{
 
305
    using namespace testing;
 
306
 
 
307
    EXPECT_CALL (mockfs, LoadPlugin (_, _, _)).Times (AtLeast (0));
 
308
    EXPECT_CALL (mockfs, UnloadPlugin(_)).Times (AtLeast (0));
 
309
 
 
310
    ON_CALL(mockfs, LoadPlugin (_, _, _)).
 
311
        WillByDefault (Return (true));
 
312
 
 
313
    MockVTable mockVtable;
 
314
    EXPECT_CALL (mockVtable, init ())
 
315
        .Times (AtLeast (0))
 
316
        .WillOnce (Return (true));
 
317
    EXPECT_CALL (mockVtable, markReadyToInstantiate ())
 
318
        .Times (AtLeast (0));
 
319
    EXPECT_CALL (mockVtable, markNoFurtherInstantiation ())
 
320
        .Times (AtLeast (0));
 
321
 
 
322
    CompPlugin* cp = CompPlugin::load("dummy");
 
323
 
 
324
    cp->vTable = &mockVtable;
 
325
 
 
326
    CompPlugin::push(cp);
 
327
    EXPECT_EQ (cp, CompPlugin::pop ());
 
328
    CompPlugin::unload(cp);
 
329
}
 
330
 
 
331
TEST_F (PluginTest, unload_calls_unload_on_fs)
 
332
{
 
333
    using namespace testing;
 
334
 
 
335
    EXPECT_CALL (mockfs, LoadPlugin (_, _, _)).Times (AtLeast (0));
 
336
 
 
337
    ON_CALL(mockfs, LoadPlugin (_, _, _)).
 
338
        WillByDefault (Return (true));
 
339
 
 
340
    CompPlugin* cp = CompPlugin::load("dummy");
 
341
 
 
342
    EXPECT_CALL (mockfs, UnloadPlugin (cp)).Times (1);
 
343
 
 
344
    CompPlugin::unload(cp);
 
345
}
 
346
 
 
347
namespace
 
348
{
 
349
 
 
350
/* TODO (cleanup): Extract this into a separate library because it
 
351
 * duplicates what's in test-pluginclasshandler */
 
352
template <typename BaseType>
 
353
class Base :
 
354
    public PluginClassStorage
 
355
{
 
356
    public:
 
357
 
 
358
        typedef BaseType Type;
 
359
 
 
360
        Base ();
 
361
        ~Base ();
 
362
 
 
363
        static unsigned int allocPluginClassIndex ();
 
364
        static void freePluginClassIndex (unsigned int index);
 
365
 
 
366
    private:
 
367
 
 
368
        static PluginClassStorage::Indices indices;
 
369
        static std::list <Base *>        bases;
 
370
};
 
371
 
 
372
template <typename BaseType>
 
373
PluginClassStorage::Indices Base <BaseType>::indices;
 
374
 
 
375
template <typename BaseType>
 
376
std::list <Base <BaseType> * > Base <BaseType>::bases;
 
377
 
 
378
template <typename BaseType>
 
379
Base <BaseType>::Base () :
 
380
    PluginClassStorage (indices)
 
381
{
 
382
    bases.push_back (this);
 
383
}
 
384
 
 
385
template <typename BaseType>
 
386
Base <BaseType>::~Base ()
 
387
{
 
388
    bases.remove (this);
 
389
}
 
390
 
 
391
template <typename BaseType>
 
392
unsigned int
 
393
Base <BaseType>::allocPluginClassIndex ()
 
394
{
 
395
    unsigned int i = PluginClassStorage::allocatePluginClassIndex (indices);
 
396
 
 
397
    foreach (Base *b, bases)
 
398
    {
 
399
        if (indices.size () != b->pluginClasses.size ())
 
400
            b->pluginClasses.resize (indices.size ());
 
401
    }
 
402
 
 
403
    return i;
 
404
}
 
405
 
 
406
template <typename BaseType>
 
407
void
 
408
Base <BaseType>::freePluginClassIndex (unsigned int index)
 
409
{
 
410
    PluginClassStorage::freePluginClassIndex (indices, index);
 
411
 
 
412
    foreach (Base *b, bases)
 
413
    {
 
414
        if (indices.size () != b->pluginClasses.size ())
 
415
            b->pluginClasses.resize (indices.size ());
 
416
    }
 
417
}
 
418
 
 
419
class BaseScreen :
 
420
    public Base <BaseScreen>
 
421
{
 
422
};
 
423
 
 
424
class BaseWindow :
 
425
    public Base <BaseWindow>
 
426
{
 
427
};
 
428
 
 
429
class DestructionVerifier
 
430
{
 
431
    public:
 
432
 
 
433
        DestructionVerifier ();
 
434
 
 
435
        virtual ~DestructionVerifier ();
 
436
        MOCK_METHOD0 (destroy, void ());
 
437
};
 
438
 
 
439
DestructionVerifier::DestructionVerifier ()
 
440
{
 
441
    using namespace testing;
 
442
 
 
443
    /* By default we don't care */
 
444
    EXPECT_CALL (*this, destroy ()).Times (AtLeast (0));
 
445
}
 
446
 
 
447
DestructionVerifier::~DestructionVerifier ()
 
448
{
 
449
    destroy ();
 
450
}
 
451
 
 
452
class PluginScreen :
 
453
    public PluginClassHandler <PluginScreen, BaseScreen>,
 
454
    public DestructionVerifier
 
455
{
 
456
    public:
 
457
 
 
458
        PluginScreen (BaseScreen *s);
 
459
};
 
460
 
 
461
class PluginWindow :
 
462
    public PluginClassHandler <PluginWindow, BaseWindow>,
 
463
    public DestructionVerifier
 
464
{
 
465
    public:
 
466
 
 
467
        virtual ~PluginWindow () {}
 
468
        PluginWindow (BaseWindow *s);
 
469
};
 
470
 
 
471
PluginScreen::PluginScreen (BaseScreen *s) :
 
472
    PluginClassHandler (s)
 
473
{
 
474
}
 
475
 
 
476
PluginWindow::PluginWindow (BaseWindow *w) :
 
477
    PluginClassHandler (w)
 
478
{
 
479
}
 
480
 
 
481
class MockScreenAndWindowVTable :
 
482
    public CompPlugin::VTableForScreenAndWindow <PluginScreen, PluginWindow>
 
483
{
 
484
    public:
 
485
 
 
486
        MOCK_METHOD0 (init, bool ());
 
487
};
 
488
 
 
489
template <class BasePluginType>
 
490
class PluginClassIntegrationTest :
 
491
    public PluginTest
 
492
{
 
493
    public:
 
494
 
 
495
        PluginClassIntegrationTest ();
 
496
        ~PluginClassIntegrationTest ();
 
497
 
 
498
        boost::shared_ptr <CompPlugin>
 
499
        LoadPlugin (MockScreenAndWindowVTable &);
 
500
 
 
501
        MockPluginFilesystem      mockfs;
 
502
        ValueHolder               *valueHolder;
 
503
};
 
504
 
 
505
void
 
506
PopAndUnloadPlugin (CompPlugin *p)
 
507
{
 
508
    ASSERT_EQ (p, CompPlugin::pop ());
 
509
    CompPlugin::unload (p);
 
510
}
 
511
 
 
512
template <class BasePluginType>
 
513
boost::shared_ptr <CompPlugin>
 
514
PluginClassIntegrationTest <BasePluginType>::LoadPlugin (MockScreenAndWindowVTable &v)
 
515
{
 
516
    typedef PluginClassIntegrationTest <BasePluginType> TestParam;
 
517
 
 
518
    using namespace testing;
 
519
 
 
520
    EXPECT_CALL (TestParam::mockfs, LoadPlugin (_, _, _))
 
521
        .Times (AtLeast (0))
 
522
        .WillOnce (Return (true));
 
523
    EXPECT_CALL (TestParam::mockfs, UnloadPlugin(_))
 
524
        .Times (AtLeast (0));
 
525
 
 
526
    /* Load a plugin, we'll assign the vtable later */
 
527
    CompPlugin *cp = CompPlugin::load("dummy");
 
528
    cp->vTable = &v;
 
529
 
 
530
    EXPECT_CALL (v, init ())
 
531
        .Times (AtLeast (0))
 
532
        .WillOnce (Return (true));
 
533
 
 
534
    CompPlugin::push(cp);
 
535
 
 
536
    return AutoDestroy (cp,
 
537
                        PopAndUnloadPlugin);
 
538
}
 
539
 
 
540
template <class BasePluginType>
 
541
PluginClassIntegrationTest <BasePluginType>::PluginClassIntegrationTest ()
 
542
{
 
543
    valueHolder = new ValueHolder ();
 
544
    ValueHolder::SetDefault (valueHolder);
 
545
}
 
546
 
 
547
template <class BasePluginType>
 
548
PluginClassIntegrationTest <BasePluginType>::~PluginClassIntegrationTest ()
 
549
{
 
550
    delete valueHolder;
 
551
    ValueHolder::SetDefault (NULL);
 
552
}
 
553
 
 
554
template <typename BaseType, typename PluginType>
 
555
class BasePluginTemplate
 
556
{
 
557
    public:
 
558
 
 
559
        typedef BaseType Base;
 
560
        typedef PluginType Plugin;
 
561
};
 
562
 
 
563
typedef BasePluginTemplate <BaseScreen, PluginScreen> BasePluginScreen;
 
564
typedef BasePluginTemplate <BaseWindow, PluginWindow> BasePluginWindow;
 
565
 
 
566
}
 
567
 
 
568
/* TODO: Extract actual interfaces out of CompScreen
 
569
 * and CompWindow that can be passed to the vTables without
 
570
 * using a link-seam like this one */
 
571
class CompScreen :
 
572
    public BaseScreen
 
573
{
 
574
};
 
575
 
 
576
class CompWindow :
 
577
    public BaseWindow
 
578
{
 
579
};
 
580
 
 
581
typedef ::testing::Types <BasePluginScreen, BasePluginWindow> PluginTypes;
 
582
TYPED_TEST_CASE (PluginClassIntegrationTest, PluginTypes);
 
583
 
 
584
TYPED_TEST (PluginClassIntegrationTest, get_plugin_structure_null_on_not_loaded)
 
585
{
 
586
    using namespace testing;
 
587
 
 
588
    /* Can't figure out how to get this out of TestParam::base at the moment */
 
589
    typename TypeParam::Base base;
 
590
    typename TypeParam::Plugin *p = TypeParam::Plugin::get (&base);
 
591
 
 
592
    EXPECT_THAT (p, IsNull ());
 
593
}
 
594
 
 
595
TYPED_TEST (PluginClassIntegrationTest, get_plugin_structure_nonnull_on_loaded)
 
596
{
 
597
    using namespace testing;
 
598
 
 
599
    typedef PluginClassIntegrationTest <TypeParam> TestParam;
 
600
 
 
601
    MockScreenAndWindowVTable vTable;
 
602
    boost::shared_ptr <CompPlugin> cp (TestParam::LoadPlugin (vTable));
 
603
 
 
604
    typename TypeParam::Base base;
 
605
    typedef boost::shared_ptr <typename TypeParam::Plugin> PluginPtr;
 
606
 
 
607
    /* Because CompScreen is not available, we just need to delete
 
608
     * the plugin structure ourselves */
 
609
    PluginPtr p (TypeParam::Plugin::get (&base));
 
610
 
 
611
    EXPECT_THAT (p.get (), NotNull ());
 
612
}
 
613
 
 
614
TYPED_TEST (PluginClassIntegrationTest, plugin_class_destroyed_when_vtable_is)
 
615
{
 
616
    using namespace testing;
 
617
 
 
618
    typedef PluginClassIntegrationTest <TypeParam> TestParam;
 
619
 
 
620
    MockScreenAndWindowVTable vTable;
 
621
    boost::shared_ptr <CompPlugin> cp (TestParam::LoadPlugin (vTable));
 
622
 
 
623
    typename TypeParam::Base base;
 
624
    typedef boost::shared_ptr <typename TypeParam::Plugin> PluginPtr;
 
625
 
 
626
    /* Because CompScreen is not available, we just need to delete
 
627
     * the plugin structure ourselves */
 
628
    PluginPtr p (TypeParam::Plugin::get (&base));
 
629
 
 
630
    EXPECT_CALL (*p, destroy ()).Times (1);
218
631
}