LTP GCOV extension - code coverage report
Current view: | directory - ept/core/apt - action.test.h
Test: | lcov.info
Date: | 2008-08-14 |  | Instrumented lines: | 29
Code covered: | 100.0 % |  | Executed lines: | 29

           1                 : // -*- C++ -*-
           2                 : #include <ept/core/apt/action.h>
           3                 : #include <ept/test.h>
           4                 :
           5                 : using namespace ept::core;
           6                 :
           7                 : struct TestAptAction : AptTestEnvironment
           8               3 : {
           9                 :     package::Source pkgs;
          10               3 :     TestAptAction() : pkgs( db ) {}
          11                 :
          12               1 :     Test basic() {
          13               1 :         ept::Token t( "sp" );
          14               2 :         package::Action a( t, package::Action::Install );
          15               1 :         a.apply( pkgs );
          16               1 :         assert( pkgs.get< package::State >( t ).install() );
          17               1 :         a = package::Action( t, package::Action::Keep );
          18               1 :         a.apply( pkgs );
          19               1 :         assert( pkgs.get< package::State >( t ).keep() );
          20               1 :     }
          21                 :
          22               1 :     Test revert() {
          23               1 :         ept::Token t( "sp" );
          24               2 :         package::Action a( t, package::Action::Install );
          25               1 :         a.apply( pkgs );
          26               1 :         assert( pkgs.get< package::State >( t ).install() );
          27               1 :         pkgs.revertStates();
          28               1 :         assert( pkgs.get< package::State >( t ).keep() );
          29               1 :     }
          30                 :
          31               1 :     Test keep() {
          32               1 :         package::ActionList al;
          33               1 :         ept::Token t( "sp" );
          34               2 :         al.add( package::Action( t, package::Action::Install ) );
          35               1 :         assert( !al.empty() );
          36               2 :         al.add( package::Action( t, package::Action::Remove ) );
          37               1 :         al.add( package::Action( t, package::Action::Keep ) );
          38               1 :         al.replay( pkgs );
          39               1 :         assert( pkgs.get< package::State >( t ).keep() );
          40               1 :     }
          41                 : };

Generated by: LTP GCOV extension version 1.6