~ken-vandine/indicator-transfer/ual_api_change

« back to all changes in this revision

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

  • Committer: CI Train Bot
  • Author(s): Renato Araujo Oliveira Filho
  • Date: 2015-08-19 19:17:06 UTC
  • mfrom: (29.6.11 add-plugins-fix-model-clear)
  • Revision ID: ci-train-bot@canonical.com-20150819191706-k1jnor3lh4n26zax
Added 'clear' function into the Source interface.
Call 'Source.clear' in the 'Controller.clear_all' function.
Does not keep a separated copy of source model inside of the Controller class.
Changed the return of 'Source.get_model()' to const.
Update unit tests.
Approved by: Charles Kerr, PS Jenkins bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
 
35
35
  GTestDBus* bus = nullptr;
36
36
 
37
 
  std::shared_ptr<MutableModel> m_model;
38
37
  std::shared_ptr<Source> m_source;
39
38
  std::shared_ptr<Controller> m_controller;
40
39
 
44
43
 
45
44
    auto plugin_dir = g_get_current_dir();
46
45
    m_source.reset(new PluginSource(plugin_dir));
47
 
    m_model = m_source->get_model();
48
 
    m_controller.reset(new Controller(m_model, m_source));
 
46
    m_controller.reset(new Controller(m_source));
49
47
    g_clear_pointer(&plugin_dir, g_free);
50
48
  }
51
49
 
52
50
  void TearDown()
53
51
  {
54
52
    m_controller.reset();
55
 
    m_model.reset();
56
53
    m_source.reset();
57
54
 
58
55
    super::TearDown();