Author: kkaempf Date: Wed Jan 9 10:45:26 2008 New Revision: 8232 URL: http://svn.opensuse.org/viewcvs/zypp?rev=8232&view=rev Log: define 'REL_NONE' and add test case Modified: trunk/sat-solver/bindings/ruby/tests/relation.rb trunk/sat-solver/bindings/satsolver.i Modified: trunk/sat-solver/bindings/ruby/tests/relation.rb URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/bindings/ruby/tests/relation.rb?rev=8232&r1=8231&r2=8232&view=diff ============================================================================== --- trunk/sat-solver/bindings/ruby/tests/relation.rb (original) +++ trunk/sat-solver/bindings/ruby/tests/relation.rb Wed Jan 9 10:45:26 2008 @@ -32,14 +32,24 @@ @repo = @pool.add_solv( "../../../testsuite/data.libzypp/basic-exercises/exercise-1-packages.solv" ) assert @repo.size > 0 end + def test_relation_accessors + rel1 = SatSolver::Relation.new( @pool, "A" ) + assert rel1 + assert rel1.name == "A" + assert rel1.op == 0 + assert rel1.evr == nil + rel2 = SatSolver::Relation.new( @pool, "A", SatSolver::REL_EQ, "1.0-0" ) + assert rel2 + assert rel2.name == "A" + assert rel2.op == SatSolver::REL_EQ + assert rel2.evr == "1.0-0" + end + def test_relation rel = SatSolver::Relation.new( @pool, "A", SatSolver::REL_EQ, "1.0-0" ) # equivalent: @pool.create_relation( "A", SatSolver::REL_EQ, "1.0-0" ) assert rel puts "Relation: #{rel}" - assert rel.name == "A" - assert rel.op == SatSolver::REL_EQ - assert rel.evr == "1.0-0" @repo.each { |s| unless (s.provides.empty?) puts s.provides[0] Modified: trunk/sat-solver/bindings/satsolver.i URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/bindings/satsolver.i?rev=8232&r1=8231&r2=8232&view=diff ============================================================================== --- trunk/sat-solver/bindings/satsolver.i (original) +++ trunk/sat-solver/bindings/satsolver.i Wed Jan 9 10:45:26 2008 @@ -804,6 +804,7 @@ %extend Relation { /* operation */ +#define REL_NONE 0 #define REL_GT 1 #define REL_EQ 2 #define REL_GE 3 -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org