frontend/device.c, com_alter_common(), #11/11 regression test
This commit is contained in:
parent
c1b9f746a3
commit
9fbafbfd1e
|
|
@ -1,7 +1,7 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
|
||||
TESTS = bugs-1.cir bugs-2.cir dollar-1.cir empty-1.cir resume-1.cir log-functions-1.cir
|
||||
TESTS = bugs-1.cir bugs-2.cir dollar-1.cir empty-1.cir resume-1.cir log-functions-1.cir alter-vec.cir
|
||||
|
||||
TESTS_ENVIRONMENT = ngspice_vpath=$(srcdir) $(SHELL) $(top_srcdir)/tests/bin/check.sh $(top_builddir)/src/ngspice
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,47 @@
|
|||
* check alter @v1[pulse] = [ 1 2 3 4 5 6 ]
|
||||
*
|
||||
* (exec-spice "ngspice -b %s" t)
|
||||
*
|
||||
* see com_alter_common() in frontend/device.c
|
||||
|
||||
v1 1 0 dc 0.25 pulse( -1 2 3m 4u 5u 6m 7m)
|
||||
|
||||
.control
|
||||
|
||||
op
|
||||
|
||||
let vec1 = @v1[pulse]
|
||||
compose gold1 values -1 2 3m 4u 5u 6m 7m
|
||||
let err1 = vecmax(abs(vec1/gold1 - 1))
|
||||
|
||||
alter @v1[pulse] = [ 2 5 11n 12n 13n 54n 105n ]
|
||||
|
||||
let vec2 = @v1[pulse]
|
||||
compose gold2 values 2 5 11n 12n 13n 54n 105n
|
||||
let err2 = vecmax(abs(vec2/gold2 - 1))
|
||||
|
||||
echo "Note: err1 = " $&err1
|
||||
echo "Note: err2 = " $&err2
|
||||
|
||||
let success = 0
|
||||
|
||||
if err1 > 1e-15
|
||||
echo "ERROR: test1 failed, excessive error"
|
||||
else
|
||||
let success = success + 1
|
||||
end
|
||||
|
||||
if err2 > 1e-15
|
||||
echo "ERROR: test2 failed, excessive error"
|
||||
else
|
||||
let success = success + 1
|
||||
end
|
||||
|
||||
if success eq 2
|
||||
echo "INFO: success"
|
||||
quit 0
|
||||
else
|
||||
quit 1
|
||||
end
|
||||
|
||||
.endc
|
||||
|
|
@ -0,0 +1 @@
|
|||
INFO: success
|
||||
Loading…
Reference in New Issue