Class: TdlSimTest::TdlSimpleTestUnit

Inherits:
TdlBaseTestUnit show all
Defined in:
lib/tdl/exlib/sdlmodule_sim.bak.rb

Instance Attribute Summary

Attributes inherited from TdlBaseTestUnit

#active, #value_default

Instance Method Summary collapse

Methods inherited from TdlBaseTestUnit

check_same_test_name, echo_prj_test_list, load_test_unit_hash, test_unit_hash, test_unit_hash=, top_sim_list, top_sim_list=, #use_default?

Constructor Details

#initialize(name: 'TdlSimpleTestUnit-0', value_default: nil, sim_target_hash: {}) ⇒ TdlSimpleTestUnit

Returns a new instance of TdlSimpleTestUnit.



125
126
127
128
129
130
131
132
133
# File 'lib/tdl/exlib/sdlmodule_sim.bak.rb', line 125

def initialize(name: 'TdlSimpleTestUnit-0',value_default: nil, sim_target_hash: {})
    super name
    @name = name 
    @value_default = value_default
    @sim_target = sim_target_hash[name]
    if @sim_target 
        @active = true 
    end
end

Instance Method Details

#echo_infoObject



148
149
150
# File 'lib/tdl/exlib/sdlmodule_sim.bak.rb', line 148

def echo_info 
    echo_info_array.join(" ## ")
end

#echo_info_arrayObject



143
144
145
146
# File 'lib/tdl/exlib/sdlmodule_sim.bak.rb', line 143

def echo_info_array
    # test type :: test name :: test value :: test default ? :: tset others
    ['SIMPLE-UNIT',@name,active_symb,value().to_s, use_default?().to_s, "default(#{@value_default})" ] 
end

#valueObject



135
136
137
138
139
140
141
# File 'lib/tdl/exlib/sdlmodule_sim.bak.rb', line 135

def value
    if @sim_target != true 
        return @sim_target || @value_default
    else 
        return @value_default
    end
end