octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #29490] Var wrongly declared undefined


From: anonymous
Subject: [Octave-bug-tracker] [bug #29490] Var wrongly declared undefined
Date: Fri, 09 Apr 2010 09:01:34 +0000
User-agent: Opera/9.64 (Windows NT 5.1; U; en) Presto/2.1.1

URL:
  <http://savannah.gnu.org/bugs/?29490>

                 Summary: Var wrongly declared undefined
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Fri 09 Apr 2010 09:01:33 AM UTC
                Category: None
                Severity: 3 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Philipp
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.2.4
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

When running the following (modified code from MUnit framework)
== file CollectTests.m ==
function ts = CollectTests(files,recursive,name)
  if isa(files,'char')
    ts = CollectTests({},recursive,name);
  else
    tests = cell(1,numel(files));
    disp(tests);
    ts = testset(name,name,tests); % fails when using this line
%     ts = makeTS(name,name,tests); % works when using this line
  end
end

function ts = makeTS(name,id,tests)
    ts = testset(name,id,tests);
end
=======

I get:
octave:3> CollectTests('hello',true,'hello')
{}(1x0)
error: `tests' undefined near line 7 column 28
error: evaluating argument list element number 3
error: called from:
error:   D:\tests\libs\MUnit\tools\CollectTests.m at line 7, column 8
error:   D:\tests\libs\MUnit\tools\CollectTests.m at line 3, column 8


Note that 'tests' is displayed a line above where it is used, it is not
undefined but {}(1x0) instead.

The call works correctly, when the construction of the testset class is
deferred to another function in the same file (uncomment line 8 and comment
line 7)

The recursion one CollectTests seems to be important: calling directly
works:

octave:3> CollectTests({},true,'hello')
{}(1x0)
Unit test "hello" of class "testset",
        hello

Both tests are made right after clean start of octave, while only the path
has been set. 
testset is the unmodified testset class from MUnit (full code attached) which
takes a vararg as input.




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Fri 09 Apr 2010 09:01:33 AM UTC  Name: MUnit.zip  Size: 35kB   By: None

<http://savannah.gnu.org/bugs/download.php?file_id=20171>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?29490>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]