Skip to content

Commit

Permalink
Item11466: fixes for borked unit tests; looks like 'someone' is runni…
Browse files Browse the repository at this point in the history
…ng unit tests with ASSERT disabled. Tsk tsk.

git-svn-id: http://svn.foswiki.org/trunk@13795 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
CrawfordCurrie authored and CrawfordCurrie committed Jan 23, 2012
1 parent cd0b806 commit c57b606
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 4 additions & 2 deletions UnitTestContrib/test/unit/FoswikiTestCase.pm
Expand Up @@ -740,8 +740,10 @@ sub createNewFoswikiSession {
$this->{session} = Foswiki->new( $user, $query, @args );
$this->{request} = $this->{session}{request};
ASSERT( defined $Foswiki::Plugins::SESSION ) if SINGLE_SINGLETONS;
( $this->{test_topicObject} ) =
Foswiki::Func::readTopic( $this->{test_web}, $this->{test_topic} );
if ($this->{test_web} && $this->{test_topic}) {
( $this->{test_topicObject} ) =
Foswiki::Func::readTopic( $this->{test_web}, $this->{test_topic} );
}

return $this->{session};
}
Expand Down
7 changes: 3 additions & 4 deletions core/lib/Foswiki/Meta.pm
Expand Up @@ -1246,10 +1246,9 @@ sub get {
if ($data) {
if ( defined $name ) {

#this code presumes the _indices are there (Sven would like it to re-create when needed..)
# Paul.H notes that we trip over this one when meta obj is unloaded (I think, see Item10927)
ASSERT( defined( $this->{_indices} ) ) if DEBUG;
my $indices = $this->{_indices}->{$type};
my $indices = $this->{_indices};
return undef unless defined $indices;
$indices = $indices->{$type};
return undef unless defined $indices;
return undef unless defined $indices->{$name};
return $data->[ $indices->{$name} ];
Expand Down

0 comments on commit c57b606

Please sign in to comment.