* fichier : operad.dgibi opti echo 0; ************************************************************************ * Section : Langage Objets ************************************************************************ ************************************************************************ * Cas test pour la deuxième syntaxe de l'operateur + * ************************************************************************ opti dime 2 elem seg2; opti assi 10; pta = 0 0; ptb = 0 1; lab = droi ((3 * (vale assi) ) - 1 ) pta ptb; mod1 = mode lab mecanique elastique; 'MESS' 'Test chpoint'; chp = table esclave; 'REPE' idom (vale assi); chp. &idom = manu chpo lab scal 1; fin idom; chpr = + chp; *list chpr; chpv = manu chpo lab scal (vale assi); 'SI' ('>' ('MAXI' 'ABS' (chpr - chpv)) 1e-5); erreur 'Erreur avec les CHPOINTs'; 'FINSI'; 'MESS' 'Test evolutio'; chevo = table esclave; repe idom (vale assi); chevo. &idom = evol chpo chp. &idom lab; fin idom; chevor = + chevo; *list chevor; chevov = evol chpo chpv lab; 'SI' ('>' ('MAXI' 'ABS' (extr (chevor - chevov )ordo)) 1e-5); erreur 'Erreur avec les EVOLUTIOs'; 'FINSI'; 'MESS' 'Test mchaml'; chm = table esclave; repe idom (vale assi); chm. &idom = chan cham chp . &idom mod1; fin idom; chmr = + chm; *list chmr; chmv = chan cham chpv mod1; 'SI' ('>' ('MAXI' 'ABS' (chmr - chmv)) 1e-5); erreur 'Erreur avec les MCHAMLs'; 'FINSI'; 'MESS' 'Test entier'; chen = table esclave; 'REPE' idom (vale assi); chen. &idom = 1; fin idom; chenr = + chen; *list chenr; chenv = vale assi; 'SI' ('>' ('ABS' (chenr - chenv)) 1e-5); erreur 'Erreur avec les ENTIERs'; 'FINSI'; 'MESS' 'Test flottant'; chflo = table esclave; 'REPE' idom (vale assi); chflo. &idom = 1.0; fin idom; chflor = + chflo; *list chflor; chflov = vale assi; 'SI' ('>' ('ABS' (chflor - chflov)) 1e-5); erreur 'Erreur avec les FLOTTANTs'; 'FINSI'; 'MESS' 'Test listenti'; chlien = table esclave; 'REPE' idom (vale assi); chlien. &idom = LECT 1 1 1; chlienr = + chlien; fin idom; *list chlienr; chlienv = lect 3 * (vale assi); 'SI' ('>' ('MAXI' 'ABS' (chlienr - chlienv)) 1e-5); erreur 'Erreur avec les LISTENTIs'; 'FINSI'; 'MESS' 'Test listreel'; chlire = table esclave; 'REPE' idom (vale assi); chlire. &idom = PROG 1.0 1.0 1.0; fin idom; chlirer = + chlire; *list chlirer; chlirev = prog 3 * (vale assi); 'SI' ('>' ('MAXI' 'ABS' (chlirer - chlirev)) 1e-5); erreur 'Erreur avec les LISTREELs'; 'FINSI'; 'MESS' 'Tous test OK'; fin;