WIP: fixed RBA unit tests.

This commit is contained in:
Matthias Koefferlein 2019-06-15 00:01:40 +02:00
parent 0b5db06ca8
commit c717eb1efa
2 changed files with 12 additions and 8 deletions

View File

@ -134,14 +134,16 @@ Class<db::DeviceClassDiode> decl_dbDeviceClassDiode (decl_dbDeviceClass, "db", "
) +
gsi::constant ("PARAM_A", db::DeviceClassDiode::param_id_A,
"@brief A constant giving the parameter ID for parameter A"
) +
gsi::constant ("PARAM_P", db::DeviceClassDiode::param_id_P,
"@brief A constant giving the parameter ID for parameter P"
),
"@brief A device class for a diode.\n"
"This class descibes a diode. Diodes are defined by their combination behavior and "
"the basic parameter 'A' which is their area in square micrometers.\n"
"This class descibes a diode.\n"
"A diode has two terminals, A (anode) and C (cathode).\n"
"It has two parameters: The diode area in square micrometers (A) and the diode area perimeter in micrometers (P).\n"
"\n"
"Diodes only combine when parallel and in the same direction. In this case, their areas are added."
"\n"
"An inductor has two terminals, A (anode) and C (cathode).\n"
"Diodes only combine when parallel and in the same direction. In this case, their areas and perimeters are added."
"\n"
"This class has been introduced in version 0.26."
);

View File

@ -181,8 +181,10 @@ END
d1 = circuit.create_device(cls, "d1")
d1.set_parameter(RBA::DeviceClassDiode::PARAM_A, 1.0)
d1.set_parameter(RBA::DeviceClassDiode::PARAM_P, 2.0)
d2 = circuit.create_device(cls, "d2")
d2.set_parameter("A", 3.0)
d2.set_parameter("P", 4.0)
pin_a = circuit.create_pin ("A")
pin_b = circuit.create_pin ("B")
@ -199,8 +201,8 @@ END
assert_equal(nl.to_s, <<END)
circuit '' (A=n1,B=n2);
device '' d1 (A=n1,C=n2) (A=1);
device '' d2 (A=n1,C=n2) (A=3);
device '' d1 (A=n1,C=n2) (A=1,P=2);
device '' d2 (A=n1,C=n2) (A=3,P=4);
end;
END
@ -209,7 +211,7 @@ END
assert_equal(nl.to_s, <<END)
circuit '' (A=n1,B=n2);
device '' d1 (A=n1,C=n2) (A=4);
device '' d1 (A=n1,C=n2) (A=4,P=6);
end;
END