bugGNU Octave - Bugs: bug #31751, Tests don't work for object member...

 
 

bug #31751: Tests don't work for object member functions

Submitter:  None
Submitted:  Thu 02 Dec 2010 02:43:01 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Alexander Klein Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.2.3
Operating System:  * Mac OS Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 12 Dec 2010 05:43:30 AM UTC, comment #2: 

With the current development version of Octave, you can run tests that are defined in class constructors or methods using

  test @classname/methodname

so I consider this bug to be fixed and am closing this report.

John W. Eaton <jwe>
Group administrator
Fri 03 Dec 2010 04:09:32 PM UTC, comment #1: 

Hello,
everything under a directory whose name starts with '@' is private, and only allowed to be used inside class members. So, if you want to define a test case the directory layout has to be

@testclass/testclass.m <= the class constructor
@testclass/subsref.m   <= an overloaded method for the object
testclass              <= a script with the tests

the script defining the test must be put one layer above the class definition.

Regards

Pascal Dupuis <cdemills>
Group Member
Thu 02 Dec 2010 02:43:01 PM UTC, original submission:  

Hi,

while writing some classes, I noticed that testcases for class member functions can't be run, because test() can't find them via file_in_loadpath().

See below for details.

Kind regards,

Alex


octave:2> addpath ("~/Desktop/Objects_fail_tests")
octave:3> Testfunc
warning: I can be tested with the below test
octave:4> test ("Testfunc" )
warning: The test works
PASSES 1 out of 1 tests
octave:5> Testclass
warning: I cannot be tested with the below test
octave:6> test ("Testclass")
????? Testclass does not exist in path
octave:7> cd ("~/Desktop/Objects_fail_tests")
octave:8> cd @Testclass
octave:9> test ("Testclass")
warning: The test works
PASSES 1 out of 1 tests
octave:10> cd
octave:11> file_in_loadpath ("Testfunc.m")
ans = /prog/Desktop/Objects_fail_tests/Testfunc.m
octave:12> file_in_loadpath ("Testclass.m")
ans = [](0x0)


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #22092:  Objects_fail_tests.tbz added by None (358B - application/octet-stream - Small testcase for the above transcript)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by cdemills (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-12-12 jwe StatusNone Fixed
        Open/ClosedOpen Closed
    2010-12-02 None Attached File- Added Objects_fail_tests.tbz, #22092

    Back to the top

    Powered by Savane 3.13-bb6a.
    Corresponding source code