Index: test/Makefile =================================================================== --- test/Makefile (nonexistent) +++ test/Makefile (revision 31759) @@ -0,0 +1,6 @@ +CFLAGS = -Wall -I. +LDFLAGS = -lm +main: main.o + +main.o: main.c ../impedance.c config.h + Index: test/config.h =================================================================== --- test/config.h (nonexistent) +++ test/config.h (revision 31759) @@ -0,0 +1,4 @@ +typedef int rnd_coord_t; + +#define RND_COORD_TO_MM(x) ((x)/1000000) +#define RND_MM_TO_COORD(x) ((x)*1000000) Index: test/main.c =================================================================== --- test/main.c (nonexistent) +++ test/main.c (revision 31759) @@ -0,0 +1,15 @@ +#include +#include "../impedance.c" +int main() +{ + double tt, th, sh, d, res; + + if (scanf("%lf %lf %lf %lf", &tt, &th, &sh, &d) != 4) { + fprintf(stderr, "need: trace_width, trace_height, subst_height, dielect\n"); + return 1; + } + + res = pcb_impedance_microstrip(RND_MM_TO_COORD(tt), RND_MM_TO_COORD(th), RND_MM_TO_COORD(sh), d); + printf("res=%f\n", res); + return 0; +}