unity::scopes::testing::TypedScopeFixture<> usage always fails

Bug #1542906 reported by Stephen M. Webb
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
Medium
Alejandro J. Cura
unity-scopes-api (Ubuntu)
Fix Released
Undecided
Michi Henning

Bug Description

Following the official documentation at the Ubuntu developer gateway https://developer.ubuntu.com/api/scopes/cpp/sdk-15.04.1 I tried to create a scope fixture to use in my test cases using the unity::scopes::testing::TypedScopeFixture<> template to wrap my Scope class.

The unit tests always fail at runtime with an error similar to the following.
  [ RUN ] ScopeFixture.surfacing_query
  /usr/include/unity-scopes-1.0/unity/scopes/testing/TypedScopeFixture.h:90: Failure
  Expected: scope->start(ScopeTraits<Scope>::name()) doesn't throw an exception.

Turns out the problem is that the TypedScopeFixture template class does not call the required initialization functions in its constructor. It's not possible to work around this by driving from TypedScopeFixture because the required initialization functions (for example, TypedScopeFixtureHelper::set_scope_directory()) are private static member functions in another class. The only workaround is to include a modified copy of TypedScopeFixture.h in my own project.

Tags: patch

Related branches

Revision history for this message
Stephen M. Webb (bregma) wrote :
tags: added: patch
Changed in unity-scopes-api (Ubuntu):
assignee: nobody → Michi Henning (michihenning)
status: New → Confirmed
Changed in unity-scopes-api (Ubuntu):
status: Confirmed → In Progress
Changed in unity-scopes-api (Ubuntu):
status: In Progress → Fix Committed
Changed in canonical-devices-system-image:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Alejandro J. Cura (alecu)
milestone: none → 11
Changed in unity-scopes-api (Ubuntu):
status: Fix Committed → Fix Released
status: Fix Released → Fix Committed
status: Fix Committed → Fix Released
Changed in unity-scopes-api (Ubuntu):
status: Fix Released → Fix Committed
Changed in canonical-devices-system-image:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity-scopes-api - 1.0.4+16.04.20160402.4-0ubuntu1

---------------
unity-scopes-api (1.0.4+16.04.20160402.4-0ubuntu1) xenial; urgency=medium

  [ Marcus Tomlinson ]
  * Simplify debian/control munging. Look for clang-format as opposed to
    clang-format-3.x. Added missing initializations to TypedScopeFixture
    (Bug #1542906). Allow clients to specify authentication parameters
    (Bug #1554040). (LP: #1554040, #1542906)

  [ Michi Henning ]
  * Fixed incorrect generation of Replaces: and Conflicts: entries in
    debian/control for xenial. Fixed incorrect library soname for vivid.

 -- Marcus Tomlinson <email address hidden> Sat, 02 Apr 2016 03:24:17 +0000

Changed in unity-scopes-api (Ubuntu):
status: Fix Committed → Fix Released
Changed in canonical-devices-system-image:
status: Fix Committed → Fix Released
Changed in canonical-devices-system-image:
status: Fix Released → Fix Committed
Changed in canonical-devices-system-image:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.