From c927b6e154faf77e6d7dfd06f110aa37b23ff2a2 Mon Sep 17 00:00:00 2001 From: Chip Barnaby Date: Mon, 21 Aug 2023 11:38:19 -0400 Subject: [PATCH 01/13] Expression testing initial version --- test/CMakeLists.txt | 3 +- test/expressions.cse | 21 +++++++++++ test/ref/expressions.rep | 79 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 test/expressions.cse create mode 100644 test/ref/expressions.rep diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 72e13301d..b5164970b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -20,8 +20,9 @@ macro(make_cse_test case) endmacro() make_cse_test(minimum_running_file.cse) -make_cse_test(wthr01.cse) make_cse_test(commands.cse) +make_cse_test(expressions.cse) +make_cse_test(wthr01.cse) make_cse_test(600.cse) make_cse_test(930.cse) make_cse_test(960.cse) diff --git a/test/expressions.cse b/test/expressions.cse new file mode 100644 index 000000000..90fb4b087 --- /dev/null +++ b/test/expressions.cse @@ -0,0 +1,21 @@ +nSubSteps=20 + +#define PI 3.1415927 + +wfName = "CA_SACRAMENTO-EXECUTIVE-AP_724830S_STYP20.epw" + +DELETE REPORT EB + +REPORT rpType=UDT rpFreq=Hour rpDayBeg=jul 1 rpTitle="Basic expressions and functions" +REPORTCOL colHead = "Day" colVal=$dayOfYear colWid=3 +REPORTCOL colHead = "Hr" colVal=$hour colWid=2 +REPORTCOL colHead = "HrAng" colVal = ($hour-12)*PI/12 colWid=6 colDec=4 // hour angle: radians relative to solar noon (+ afternoon) +REPORTCOL colHead = "SinHA" colVal = sin( ($hour-12)*PI/12) colWid=7 colDec=4 +REPORTCOL colHead = "HrAngD" colVal = ($hour-12)*15 colWid=6 colDec=4 // hour angle: degrees relative to solar noon (+ afternoon) +REPORTCOL colHead = "SinHAD" colVal = sind( ($hour-12)*15) colWid=7 colDec=4 + + +RUN + +$EOF + diff --git a/test/ref/expressions.rep b/test/ref/expressions.rep new file mode 100644 index 000000000..fcb8d38e3 --- /dev/null +++ b/test/ref/expressions.rep @@ -0,0 +1,79 @@ + + +Basic expressions and functions for Wed 01-Jul + + Day Hr HrAng SinHA HrAngD SinHAD + --- -- ------ ------- ------ ------- + 182 1 -2.880 -0.2588 -165.0 -0.2588 + 182 2 -2.618 -0.5000 -150.0 -0.5000 + 182 3 -2.356 -0.7071 -135.0 -0.7071 + 182 4 -2.094 -0.8660 -120.0 -0.8660 + 182 5 -1.833 -0.9659 -105.0 -0.9659 + 182 6 -1.571 -1.0000 -90.00 -1.0000 + 182 7 -1.309 -0.9659 -75.00 -0.9659 + 182 8 -1.047 -0.8660 -60.00 -0.8660 + 182 9 -.7854 -0.7071 -45.00 -0.7071 + 182 10 -.5236 -0.5000 -30.00 -0.5000 + 182 11 -.2618 -0.2588 -15.00 -0.2588 + 182 12 0 0 0 0 + 182 13 0.2618 0.2588 15.000 0.2588 + 182 14 0.5236 0.5000 30.000 0.5000 + 182 15 0.7854 0.7071 45.000 0.7071 + 182 16 1.0472 0.8660 60.000 0.8660 + 182 17 1.3090 0.9659 75.000 0.9659 + 182 18 1.5708 1.0000 90.000 1.0000 + 182 19 1.8326 0.9659 105.00 0.9659 + 182 20 2.0944 0.8660 120.00 0.8660 + 182 21 2.3562 0.7071 135.00 0.7071 + 182 22 2.6180 0.5000 150.00 0.5000 + 182 23 2.8798 0.2588 165.00 0.2588 + 182 24 3.1416 -0.0000 180.00 -0.0000 + + + +! Log for Run 001: + +! CSE 0.918.0+expression-coverage.e4f1481c.79.dirty for Win32 console + + + +Input for Run 001: + + nSubSteps=20 + +# #define PI 3.1415927 + + wfName = "CA_SACRAMENTO-EXECUTIVE-AP_724830S_STYP20.epw" + + DELETE REPORT EB + + REPORT rpType=UDT rpFreq=Hour rpDayBeg=jul 1 rpTitle="Basic expressions and functions" + REPORTCOL colHead = "Day" colVal=$dayOfYear colWid=3 + REPORTCOL colHead = "Hr" colVal=$hour colWid=2 + REPORTCOL colHead = "HrAng" colVal = ($hour-12)*PI/12 colWid=6 colDec=4 // hour angle: radians relative to solar noon (+ afternoon) + REPORTCOL colHead = "SinHA" colVal = sin( ($hour-12)*PI/12) colWid=7 colDec=4 + REPORTCOL colHead = "HrAngD" colVal = ($hour-12)*15 colWid=6 colDec=4 // hour angle: degrees relative to solar noon (+ afternoon) + REPORTCOL colHead = "SinHAD" colVal = sind( ($hour-12)*15) colWid=7 colDec=4 + + + RUN + + $EOF + + + +! CSE 0.918.0+expression-coverage.e4f1481c.79.dirty for Win32 console run(s) done: Mon 21-Aug-23 11:32:46 am + +! Executable: d:\cse\msvc\cse.exe +! 21-Aug-23 11:32 am (VS 14.29 2775552 bytes) (HPWH 1.22.0) +! Command line: -x! -t1 expressions +! Input file: D:\cse\test\expressions.cse +! Report file: D:\CSE\TEST\EXPRESSIONS.REP + +! Timing info -- + +! Input: Time = 0.05 Calls = 1 T/C = 0.0480 +! AutoSizing: Time = 0.00 Calls = 0 T/C = 0.0000 +! Simulation: Time = 0.22 Calls = 1 T/C = 0.2240 +! Reports: Time = 0.00 Calls = 1 T/C = 0.0010 +! Total: Time = 0.28 Calls = 1 T/C = 0.2750 From 095116775740cf75485d80c7a4bd81c1f827a4cc Mon Sep 17 00:00:00 2001 From: Chip Barnaby Date: Mon, 16 Oct 2023 16:13:45 -0400 Subject: [PATCH 02/13] Coverage WIP --- src/cse.cpp | 3 +++ src/cueval.cpp | 20 ++++++++++++++++++-- src/cueval.h | 8 ++++++-- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/cse.cpp b/src/cse.cpp index d798477e9..dddb13684 100644 --- a/src/cse.cpp +++ b/src/cse.cpp @@ -1198,6 +1198,9 @@ LOCAL int cse3( int argc, const char* argv[]) cul( 4, NULL, NULL, NULL, NULL); // cul.cpp extClr(); // clear expression tbl (to free DM), exman.cpp. cannot be done before RUN! + extern void CoverageAnalysis(); + CoverageAnalysis(); + // Format overall timing info and other final notes to virtual report. Includes date, time, program name, version. tmrStop(TMR_TOTAL); diff --git a/src/cueval.cpp b/src/cueval.cpp index 7b700d65d..6b38afc87 100644 --- a/src/cueval.cpp +++ b/src/cueval.cpp @@ -17,7 +17,7 @@ #include "messages.h" // msgIsHan #include "cvpak.h" // cvS2Choi -#include "psychro.h" // functions in lib\psychro1/2.cpp. psyEnthalpy psyHumRat1. +#include "psychro.h" #include "impf.h" // impFldNrN #include "cueval.h" // PS defines, RCUNSET; decls for fcns in this file @@ -82,6 +82,12 @@ static _MTP _evIp = { NULL }; // display debugging info flag SI runtrace = 0; // settable as sys var $runtrace (cuparse.cpp) +#define COVERAGE_TRACKING +#if defined( COVERAGE_TRACKING) + static int coverageCounts[ PSOPE_COUNT] = { 0 }; +#endif + + /*----------------------- LOCAL FUNCTION DECLARATIONS ---------------------*/ LOCAL RC FC cuEval( void *ip, const char** pmsg, USI *pBadH); LOCAL RC FC cuEvalI( const char** pmsg, USI *pBadH); @@ -131,7 +137,14 @@ w return *SPF++; w /* 2 additional returns above */ w} /* cuEvalF */ #endif +//----------------------------------------------------------------------------- +void CoverageAnalysis() +{ +#if defined( COVERAGE_TRACKING) && defined( _DEBUG) + printf("\nCoverage!"); +#endif +} // ::CoverageAnalysis //=========================================================================== RC FC cuEvalR( // evaluate pseudocode & return ptr to value @@ -226,6 +239,7 @@ LOCAL RC FC cuEvalI( static_assert(sizeof(LI) == sizeof(char*)); // code assumes LI and pointers same size static_assert( sizeof(SI)==sizeof(PSOP)); // assumed in (SI *) cast used in PSPKONN case + for ( ; ; ) { // eval stack over/underflow checks. NB builds down, top is < base. @@ -246,7 +260,9 @@ LOCAL RC FC cuEvalI( evIp, evSp, op); void* p = 0; - +#if defined( COVERAGE_TRACKING) + ++coverageCounts[op]; +#endif //--- execute pseudo-code --- switch (op) { diff --git a/src/cueval.h b/src/cueval.h index 62030d2e7..31eee98d3 100644 --- a/src/cueval.h +++ b/src/cueval.h @@ -215,7 +215,7 @@ PSIMPLODSNM, // load string from named field. file index (ImpfiB subscr), f // daylighting controls simulation functions PSCONTIN, // simulate "continuous" light control. 4 float args, 1 float result. -PSSTEPPED // simulate "stepped" light control. 1 SI and 2 float args, 1 float result. +PSSTEPPED, // simulate "stepped" light control. 1 SI and 2 float args, 1 float result. /* to do (8-90) (turns out not to be important in actual use,,1) * PSCALL <<<<<<<<< need PS addressing mechanism @@ -223,7 +223,9 @@ PSSTEPPED // simulate "stepped" light control. 1 SI and 2 float args, 1 float re * load and store variables. by variable # or assign abs locations? * many specials for built-in fcns? */ -}; // enum EPSOP +PSOPE_COUNT // count of PSOPE operation codes + +}; // enum PSOPE /*----------------------------- OTHER DEFINES -----------------------------*/ @@ -245,4 +247,6 @@ void cupFixAfterCopy(CULSTR& culStr); int CDEC printif( int flag, const char* fmt, ... ); +void CoverageAnalysis(); + // end of cueval.h From aa489ada3051893c4f879cc6f4c4211c478e138d Mon Sep 17 00:00:00 2001 From: Chip Barnaby Date: Mon, 13 Nov 2023 14:51:42 -0500 Subject: [PATCH 03/13] Coverage tracking; trig tests --- src/cueval.cpp | 196 ++++++++++++++++++++++++++++++++++----- src/cuparse.cpp | 2 +- test/expressions.cse | 46 +++++++-- test/ref/expressions.rep | 122 +++++++++++++++--------- 4 files changed, 290 insertions(+), 76 deletions(-) diff --git a/src/cueval.cpp b/src/cueval.cpp index 6b38afc87..aadbf0367 100644 --- a/src/cueval.cpp +++ b/src/cueval.cpp @@ -82,10 +82,6 @@ static _MTP _evIp = { NULL }; // display debugging info flag SI runtrace = 0; // settable as sys var $runtrace (cuparse.cpp) -#define COVERAGE_TRACKING -#if defined( COVERAGE_TRACKING) - static int coverageCounts[ PSOPE_COUNT] = { 0 }; -#endif /*----------------------- LOCAL FUNCTION DECLARATIONS ---------------------*/ @@ -137,11 +133,161 @@ w return *SPF++; w /* 2 additional returns above */ w} /* cuEvalF */ #endif + +/////////////////////////////////////////////////////////////////////////////// +// Coveerage: counts use of opcodes to verify testing coverage + +#define COVERAGE_TRACKING +#if defined( COVERAGE_TRACKING) +static int coverageCounts[ PSOPE_COUNT] = { 0 }; +static const char* GetPseudocodeName(int op) +{ +#define OPNAMECASE( op) case op: opName = #op; break + const char* opName = "?"; + switch (op) + { + + OPNAMECASE(PSNUL); + OPNAMECASE(PSEND); + OPNAMECASE(PSKON2); + OPNAMECASE(PSKON4); +#if defined( USE_PSPKONN) + OPNAMECASE(PSPKONN); +#endif + OPNAMECASE(PSLOD2); + OPNAMECASE(PSLOD4); + OPNAMECASE(PSRLOD2); + OPNAMECASE(PSRLOD4); + OPNAMECASE(PSSTO2); + OPNAMECASE(PSSTO4); + OPNAMECASE(PSPUT2); + OPNAMECASE(PSPUT4); + OPNAMECASE(PSRSTO2); + OPNAMECASE(PSRSTO4); + OPNAMECASE(PSDUP2); + OPNAMECASE(PSDUP4); + OPNAMECASE(PSPOP2); + OPNAMECASE(PSPOP4); + OPNAMECASE(PSFIX2); + OPNAMECASE(PSFIX4); + OPNAMECASE(PSFLOAT2); + OPNAMECASE(PSFLOAT4); + OPNAMECASE(PSSIINT); + OPNAMECASE(PSINTSI); + OPNAMECASE(PSIBOO); + OPNAMECASE(PSSCH); + OPNAMECASE(PSNCN); + OPNAMECASE(PSFINCHES); + OPNAMECASE(PSIDOY); + OPNAMECASE(PSIABS); + OPNAMECASE(PSINEG); + OPNAMECASE(PSIADD); + OPNAMECASE(PSISUB); + OPNAMECASE(PSIMUL); + OPNAMECASE(PSIDIV); + OPNAMECASE(PSIMOD); + OPNAMECASE(PSIDEC); + OPNAMECASE(PSIINC); + OPNAMECASE(PSINOT); + OPNAMECASE(PSIONC); + OPNAMECASE(PSILSH); + OPNAMECASE(PSIRSH); + OPNAMECASE(PSIEQ); + OPNAMECASE(PSINE); + OPNAMECASE(PSILT); + OPNAMECASE(PSILE); + OPNAMECASE(PSIGE); + OPNAMECASE(PSIGT); + OPNAMECASE(PSIBOR); + OPNAMECASE(PSIXOR); + OPNAMECASE(PSIBAN); + OPNAMECASE(PSIBRKT); + OPNAMECASE(PSIMIN); + OPNAMECASE(PSIMAX); + OPNAMECASE(PSFABS); + OPNAMECASE(PSFNEG); + OPNAMECASE(PSFADD); + OPNAMECASE(PSFSUB); + OPNAMECASE(PSFMUL); + OPNAMECASE(PSFDIV); + OPNAMECASE(PSFDEC); + OPNAMECASE(PSFINC); + OPNAMECASE(PSFEQ); + OPNAMECASE(PSFNE); + OPNAMECASE(PSFLT); + OPNAMECASE(PSFLE); + OPNAMECASE(PSFGE); + OPNAMECASE(PSFGT); + OPNAMECASE(PSFBRKT); + OPNAMECASE(PSFMIN); + OPNAMECASE(PSFMAX); + OPNAMECASE(PSFSQRT); + OPNAMECASE(PSFEXP); + OPNAMECASE(PSFPOW); + OPNAMECASE(PSFLOGE); + OPNAMECASE(PSFLOG10); + OPNAMECASE(PSFSIN); + OPNAMECASE(PSFCOS); + OPNAMECASE(PSFTAN); + OPNAMECASE(PSFASIN); + OPNAMECASE(PSFACOS); + OPNAMECASE(PSFATAN); + OPNAMECASE(PSFATAN2); + OPNAMECASE(PSFSIND); + OPNAMECASE(PSFCOSD); + OPNAMECASE(PSFTAND); + OPNAMECASE(PSFASIND); + OPNAMECASE(PSFACOSD); + OPNAMECASE(PSFATAND); + OPNAMECASE(PSFATAN2D); + OPNAMECASE(PSDBWB2W); + OPNAMECASE(PSDBRH2W); + OPNAMECASE(PSDBW2RH); + OPNAMECASE(PSDBW2H); + OPNAMECASE(PSFILEINFO); + OPNAMECASE(PSNOP); + OPNAMECASE(PSJMP); + OPNAMECASE(PSPJZ); + OPNAMECASE(PSJZP); + OPNAMECASE(PSJNZP); + OPNAMECASE(PSDISP); + OPNAMECASE(PSDISP1); + OPNAMECASE(PSCALA); + OPNAMECASE(PSRETA); + OPNAMECASE(PSCHUFAI); + OPNAMECASE(PSSELFAI); + OPNAMECASE(PSIPRN); + OPNAMECASE(PSFPRN); + OPNAMECASE(PSSPRN); + OPNAMECASE(PSRATRN); + OPNAMECASE(PSRATROS); + OPNAMECASE(PSRATLOD2); + OPNAMECASE(PSRATLOD4); + OPNAMECASE(PSRATLODD); + OPNAMECASE(PSRATLODL); + OPNAMECASE(PSRATLODA); + OPNAMECASE(PSRATLODS); + OPNAMECASE(PSEXPLOD4); + OPNAMECASE(PSEXPLODS); + OPNAMECASE(PSIMPLODNNR); + OPNAMECASE(PSIMPLODSNR); + OPNAMECASE(PSIMPLODNNM); + OPNAMECASE(PSIMPLODSNM); + OPNAMECASE(PSCONTIN); + OPNAMECASE(PSSTEPPED); + default: break; + } + return opName; +} // ::GetPseudocodeName +#endif + //----------------------------------------------------------------------------- void CoverageAnalysis() { #if defined( COVERAGE_TRACKING) && defined( _DEBUG) - printf("\nCoverage!"); + printf("\nCoverage!\n"); + for (int op = 0; op 1.) @@ -790,9 +936,9 @@ LOCAL RC FC cuEvalI( evSp --> return value at PSRETA -- must be moved ... stuff here unexpected at ... return but handle it - evFp --> saved evFp (frame ptr) 2 words - ret addr 2 words - arg values pushed by caller, discarded by PSRETA + evFp --> saved evFp (frame ptr) 2 words + ret addr 2 words + arg values pushed by caller, discarded by PSRETA */ // control flow: absolute pseudo-code call/return for user fcns 12-90 // related ops: PSRLOD2,4,PSRSTO2,4 above for args/retval. @@ -833,7 +979,7 @@ LOCAL RC FC cuEvalI( case PSSELFAI: // issue "no true condition" message: default default for select() ms = (char *)MH_R0216; /* "in select() or similar function, \n" - " all conditions false and no default given." */ + " all conditions false and no default given." */ goto breakbreak; //--- prints (development aids) @@ -869,7 +1015,7 @@ LOCAL RC FC cuEvalI( const char* pName = strTrim( (char *)p); // trim in place if (defO // if defO given (owning input record subscript) && b->ownB ) // if owning-basAnc pointer set in probed basAnc (should be set in run rat - // only if subscripts in owning run rat match input subscripts) + // only if subscripts in owning run rat match input subscripts) trc = b->findRecByNmDefO( pName, defO, SPPR, NULL); // seek rcd by name & defO, repl ptr in stk. else trc = b->findRecByNmU( pName, NULL, SPPR); // seek unique record by name, replace ptr in stk. @@ -1118,7 +1264,7 @@ LOCAL RC FC cuRmGet( // access 4-byte record member, for cuEvalI, with unset che fir->fi_evf >= EVFSUBHR ? C_IVLCH_S // get ivl corresponding to leftmost evf bit : fir->fi_evf >= EVFHR ? C_IVLCH_H // (shortest interval at which ok to probe this field) : fir->fi_evf >= EVFDAY ? C_IVLCH_D - : fir->fi_evf >= EVFMON ? C_IVLCH_M + : fir->fi_evf >= EVFMON ? C_IVLCH_M : C_IVLCH_Y; // EVFRUN, EVFFAZ, EVFEOI if (Top.isEndOf > minIvl) // if end of too short an interval (C_IVLCH_ increases for shorter times) @@ -1165,8 +1311,8 @@ LOCAL RC FC cuRmGet( // access 4-byte record member, for cuEvalI, with unset che *pms = strtprintf( (char *)MH_R0228, // "%s has not been evaluated yet." Also used below. whatEx(h) ); /* whatEx: describes expression origin per exTab, exman.cpp. - whatNio produces similar text in cases tried but - suspect whatEx may be better in obscure cases. */ + whatNio produces similar text in cases tried but + suspect whatEx may be better in obscure cases. */ if (pBadH) // if caller gave info return pointer *pBadH = h; // return expression number of uneval'd expr (0 if UNSET) return RCUNSET; // specific "uneval'd expr" error code, callers may test. @@ -1198,7 +1344,7 @@ LOCAL RC FC cuRm2Get( SI *pi, const char** pms, USI *pBadH) UCH fs = *((UCH *)e + e->b->sOff + fn); if ((fs & (FsSET | FsVAL))==FsSET) /* if "set", but not "value stored", assume is input field with uneval'd - expression (if neither flag on, assume is run field -- bits not set.) */ + expression (if neither flag on, assume is run field -- bits not set.) */ { *pms = strtprintf( (char *)MH_R0228, // "%s has not been evaluated yet." Also used above. whatNio( e->b->ancN, e->ss, fir->fi_off) ); // describe probed mbr. exman.cpp diff --git a/src/cuparse.cpp b/src/cuparse.cpp index c610d183f..f04810ca8 100644 --- a/src/cuparse.cpp +++ b/src/cuparse.cpp @@ -321,7 +321,7 @@ struct SFST : public STBK // symbol table for each function #define FCIMPORT 303 // import( , abs( -5) ? "Yes" : "No" colWid=4 +REPORTCOL colHead = "LT" colVal = 4.01+.5 < min( 6, abs( -5)) ? "Yes" : "No" colWid=4 +REPORTCOL colHead = "LE" colVal = sqrt( 16) <= max( 4.1, -2) ? "Yes" : "No" colWid=4 + + + +// Trig fuctions. No test for tan( PI/2) -- HA calc is a little inaccurate, so no overflow +#define HA (($hour-12)*PI/12) +#define HAD (($hour-12)*15) +REPORT rpType=UDT rpFreq=Hour rpDayBeg=jul 1 rpTitle="Trig functions" + REPORTCOL colHead = "Day" colVal=$dayOfYear colWid=3 + REPORTCOL colHead = "Hr" colVal=$hour colWid=2 + REPORTCOL colHead = "HrAng" colVal = HA colWid=6 colDec=4 // hour angle: radians relative to solar noon (+ afternoon) + + REPORTCOL colHead = "SinHA" colVal = sin( HA) colWid=7 colDec=4 + REPORTCOL colHead = "CosHA" colVal = cos( HA) colWid=7 colDec=4 + REPORTCOL colHead = "C+SHA" colVal = pow( sin( HA),2)+pow( cos( HA),2) colWid=7 colDec=4 + REPORTCOL colHead = "TanHA" colVal = tan( HA) colWid=7 colDec=4 + REPORTCOL colHead = "S/C HA" colVal = sin( HA) / cos( HA) colWid=7 colDec=4 + REPORTCOL colHead = "asinHA" colVal = asin( sin( HA)) colWid=7 colDec=4 + REPORTCOL colHead = "acosHA" colVal = acos( cos( HA)) colWid=7 colDec=4 + REPORTCOL colHead = "atanHA" colVal = atan( tan( HA)) colWid=7 colDec=4 + REPORTCOL colHead = "atan2HA" colVal = atan2( sin( HA),cos( HA)) colWid=7 colDec=4 + + + REPORTCOL colHead = "HrAngD" colVal = HAD colWid=6 colDec=4 // hour angle: degrees relative to solar noon (+ afternoon) + REPORTCOL colHead = "SinHAD" colVal = sind( HAD) colWid=7 colDec=4 + REPORTCOL colHead = "CosHAD" colVal = cosd( HAD) colWid=7 colDec=4 + REPORTCOL colHead = "C+SHAD" colVal = pow( sind( HAD),2)+pow( cosd( HAD),2) colWid=7 colDec=4 + REPORTCOL colHead = "TanHAD" colVal = tand( HAD) colWid=7 colDec=4 + REPORTCOL colHead = "S/C HAD" colVal = sind( HAD) / cosd( HAD) colWid=7 colDec=4 + REPORTCOL colHead = "asinHAD" colVal = asind( sind( HAD)) colWid=7 colDec=4 + REPORTCOL colHead = "acosHAD" colVal = acosd( cosd( HAD)) colWid=7 colDec=4 + REPORTCOL colHead = "atanHAD" colVal = atand( tan( HA)) colWid=7 colDec=4 + REPORTCOL colHead = "atan2HAD" colVal = atan2d( sind( HAD),cosd( HAD)) colWid=8 colDec=4 +ENDREPORT RUN diff --git a/test/ref/expressions.rep b/test/ref/expressions.rep index fcb8d38e3..4f0c6b834 100644 --- a/test/ref/expressions.rep +++ b/test/ref/expressions.rep @@ -1,39 +1,47 @@ -Basic expressions and functions for Wed 01-Jul - - Day Hr HrAng SinHA HrAngD SinHAD - --- -- ------ ------- ------ ------- - 182 1 -2.880 -0.2588 -165.0 -0.2588 - 182 2 -2.618 -0.5000 -150.0 -0.5000 - 182 3 -2.356 -0.7071 -135.0 -0.7071 - 182 4 -2.094 -0.8660 -120.0 -0.8660 - 182 5 -1.833 -0.9659 -105.0 -0.9659 - 182 6 -1.571 -1.0000 -90.00 -1.0000 - 182 7 -1.309 -0.9659 -75.00 -0.9659 - 182 8 -1.047 -0.8660 -60.00 -0.8660 - 182 9 -.7854 -0.7071 -45.00 -0.7071 - 182 10 -.5236 -0.5000 -30.00 -0.5000 - 182 11 -.2618 -0.2588 -15.00 -0.2588 - 182 12 0 0 0 0 - 182 13 0.2618 0.2588 15.000 0.2588 - 182 14 0.5236 0.5000 30.000 0.5000 - 182 15 0.7854 0.7071 45.000 0.7071 - 182 16 1.0472 0.8660 60.000 0.8660 - 182 17 1.3090 0.9659 75.000 0.9659 - 182 18 1.5708 1.0000 90.000 1.0000 - 182 19 1.8326 0.9659 105.00 0.9659 - 182 20 2.0944 0.8660 120.00 0.8660 - 182 21 2.3562 0.7071 135.00 0.7071 - 182 22 2.6180 0.5000 150.00 0.5000 - 182 23 2.8798 0.2588 165.00 0.2588 - 182 24 3.1416 -0.0000 180.00 -0.0000 +Some one-off tests + + FtIn GT LT LE + ---- ---- ---- ---- + Yes Yes Yes Yes + + + +Trig functions for Wed 01-Jul + + Day Hr HrAng SinHA CosHA C+SHA TanHA S/C HA asinHA acosHA atanHA atan2HA HrAngD SinHAD CosHAD C+SHAD TanHAD S/C HAD asinHAD acosHAD atanHAD atan2HAD + --- -- ------ ------- ------- ------- ------- ------- ------- ------- ------- ------- ------ ------- ------- ------- ------- ------- ------- ------- ------- -------- + 182 1 -2.880 -0.2588 -0.9659 1.0000 0.2679 0.2679 -0.2618 2.8798 0.2618 -2.8798 -165.0 -0.2588 -0.9659 1.0000 0.2679 0.2679 -15.000 165.000 15.0000 -165.000 + 182 2 -2.618 -0.5000 -0.8660 1.0000 0.5774 0.5774 -0.5236 2.6180 0.5236 -2.6180 -150.0 -0.5000 -0.8660 1.0000 0.5774 0.5774 -30.000 150.000 30.0000 -150.000 + 182 3 -2.356 -0.7071 -0.7071 1.0000 1.0000 1.0000 -0.7854 2.3562 0.7854 -2.3562 -135.0 -0.7071 -0.7071 1.0000 1.0000 1.0000 -45.000 135.000 45.0000 -135.000 + 182 4 -2.094 -0.8660 -0.5000 1.0000 1.7321 1.7321 -1.0472 2.0944 1.0472 -2.0944 -120.0 -0.8660 -0.5000 1.0000 1.7321 1.7321 -60.000 120.000 60.0000 -120.000 + 182 5 -1.833 -0.9659 -0.2588 1.0000 3.7320 3.7320 -1.3090 1.8326 1.3090 -1.8326 -105.0 -0.9659 -0.2588 1.0000 3.7321 3.7321 -75.000 105.000 75.0000 -105.000 + 182 6 -1.571 -1.0000 -0.0000 1.0000 22877k 22877k -1.5708 1.5708 1.5708 -1.5708 -90.00 -1.0000 -0.0000 1.0000 22877k 22877k -90.000 90.0000 90.0000 -90.0000 + 182 7 -1.309 -0.9659 0.2588 1.0000 -3.7321 -3.7321 -1.3090 1.3090 -1.3090 -1.3090 -75.00 -0.9659 0.2588 1.0000 -3.7321 -3.7321 -75.000 75.0000 -75.000 -75.0000 + 182 8 -1.047 -0.8660 0.5000 1.0000 -1.7321 -1.7321 -1.0472 1.0472 -1.0472 -1.0472 -60.00 -0.8660 0.5000 1.0000 -1.7321 -1.7321 -60.000 60.0000 -60.000 -60.0000 + 182 9 -.7854 -0.7071 0.7071 1.0000 -1.0000 -1.0000 -0.7854 0.7854 -0.7854 -0.7854 -45.00 -0.7071 0.7071 1.0000 -1.0000 -1.0000 -45.000 45.0000 -45.000 -45.0000 + 182 10 -.5236 -0.5000 0.8660 1.0000 -0.5774 -0.5774 -0.5236 0.5236 -0.5236 -0.5236 -30.00 -0.5000 0.8660 1.0000 -0.5774 -0.5774 -30.000 30.0000 -30.000 -30.0000 + 182 11 -.2618 -0.2588 0.9659 1.0000 -0.2679 -0.2679 -0.2618 0.2618 -0.2618 -0.2618 -15.00 -0.2588 0.9659 1.0000 -0.2679 -0.2679 -15.000 15.0000 -15.000 -15.0000 + 182 12 0 0 1.0000 1.0000 0 0 0 0 0 0 0 0 1.0000 1.0000 0 0 0 0 0 0 + 182 13 0.2618 0.2588 0.9659 1.0000 0.2679 0.2679 0.2618 0.2618 0.2618 0.2618 15.000 0.2588 0.9659 1.0000 0.2679 0.2679 15.0000 15.0000 15.0000 15.0000 + 182 14 0.5236 0.5000 0.8660 1.0000 0.5774 0.5774 0.5236 0.5236 0.5236 0.5236 30.000 0.5000 0.8660 1.0000 0.5774 0.5774 30.0000 30.0000 30.0000 30.0000 + 182 15 0.7854 0.7071 0.7071 1.0000 1.0000 1.0000 0.7854 0.7854 0.7854 0.7854 45.000 0.7071 0.7071 1.0000 1.0000 1.0000 45.0000 45.0000 45.0000 45.0000 + 182 16 1.0472 0.8660 0.5000 1.0000 1.7321 1.7321 1.0472 1.0472 1.0472 1.0472 60.000 0.8660 0.5000 1.0000 1.7321 1.7321 60.0000 60.0000 60.0000 60.0000 + 182 17 1.3090 0.9659 0.2588 1.0000 3.7321 3.7321 1.3090 1.3090 1.3090 1.3090 75.000 0.9659 0.2588 1.0000 3.7321 3.7321 75.0000 75.0000 75.0000 75.0000 + 182 18 1.5708 1.0000 -0.0000 1.0000 -22877k -22877k 1.5708 1.5708 -1.5708 1.5708 90.000 1.0000 -0.0000 1.0000 -22877k -22877k 90.0000 90.0000 -90.000 90.0000 + 182 19 1.8326 0.9659 -0.2588 1.0000 -3.7320 -3.7320 1.3090 1.8326 -1.3090 1.8326 105.00 0.9659 -0.2588 1.0000 -3.7321 -3.7321 75.0000 105.000 -75.000 105.0000 + 182 20 2.0944 0.8660 -0.5000 1.0000 -1.7321 -1.7321 1.0472 2.0944 -1.0472 2.0944 120.00 0.8660 -0.5000 1.0000 -1.7321 -1.7321 60.0000 120.000 -60.000 120.0000 + 182 21 2.3562 0.7071 -0.7071 1.0000 -1.0000 -1.0000 0.7854 2.3562 -0.7854 2.3562 135.00 0.7071 -0.7071 1.0000 -1.0000 -1.0000 45.0000 135.000 -45.000 135.0000 + 182 22 2.6180 0.5000 -0.8660 1.0000 -0.5774 -0.5774 0.5236 2.6180 -0.5236 2.6180 150.00 0.5000 -0.8660 1.0000 -0.5774 -0.5774 30.0000 150.000 -30.000 150.0000 + 182 23 2.8798 0.2588 -0.9659 1.0000 -0.2679 -0.2679 0.2618 2.8798 -0.2618 2.8798 165.00 0.2588 -0.9659 1.0000 -0.2679 -0.2679 15.0000 165.000 -15.000 165.0000 + 182 24 3.1416 -0.0000 -1.0000 1.0000 0.0000 0.0000 -0.0000 3.1416 0.0000 -3.1416 180.00 -0.0000 -1.0000 1.0000 0.0000 0.0000 -.00001 180.000 .000005 -180.000 ! Log for Run 001: -! CSE 0.918.0+expression-coverage.e4f1481c.79.dirty for Win32 console +! CSE 0.919.0+expression-coverage.09511677.3.dirty for Win32 console @@ -47,33 +55,63 @@ Input for Run 001: DELETE REPORT EB - REPORT rpType=UDT rpFreq=Hour rpDayBeg=jul 1 rpTitle="Basic expressions and functions" - REPORTCOL colHead = "Day" colVal=$dayOfYear colWid=3 - REPORTCOL colHead = "Hr" colVal=$hour colWid=2 - REPORTCOL colHead = "HrAng" colVal = ($hour-12)*PI/12 colWid=6 colDec=4 // hour angle: radians relative to solar noon (+ afternoon) - REPORTCOL colHead = "SinHA" colVal = sin( ($hour-12)*PI/12) colWid=7 colDec=4 - REPORTCOL colHead = "HrAngD" colVal = ($hour-12)*15 colWid=6 colDec=4 // hour angle: degrees relative to solar noon (+ afternoon) - REPORTCOL colHead = "SinHAD" colVal = sind( ($hour-12)*15) colWid=7 colDec=4 + REPORT rpType=UDT rpFreq=Year rpTitle="Some one-off tests" + REPORTCOL colHead = "FtIn" colVal = 1' 6 == 1.5 ? "Yes" : "No" colWid=4 + REPORTCOL colHead = "GT" colVal = 4.01+1 > abs( -5) ? "Yes" : "No" colWid=4 + REPORTCOL colHead = "LT" colVal = 4.01+.5 < min( 6, abs( -5)) ? "Yes" : "No" colWid=4 + REPORTCOL colHead = "LE" colVal = sqrt( 16) <= max( 4.1, -2) ? "Yes" : "No" colWid=4 + + // Trig fuctions. No test for tan( PI/2) -- HA calc is a little inaccurate, so no overflow +# #define HA (($hour-12)*PI/12) +# #define HAD (($hour-12)*15) + REPORT rpType=UDT rpFreq=Hour rpDayBeg=jul 1 rpTitle="Trig functions" + REPORTCOL colHead = "Day" colVal=$dayOfYear colWid=3 + REPORTCOL colHead = "Hr" colVal=$hour colWid=2 + REPORTCOL colHead = "HrAng" colVal = HA colWid=6 colDec=4 // hour angle: radians relative to solar noon (+ afternoon) + + REPORTCOL colHead = "SinHA" colVal = sin( HA) colWid=7 colDec=4 + REPORTCOL colHead = "CosHA" colVal = cos( HA) colWid=7 colDec=4 + REPORTCOL colHead = "C+SHA" colVal = pow( sin( HA),2)+pow( cos( HA),2) colWid=7 colDec=4 + REPORTCOL colHead = "TanHA" colVal = tan( HA) colWid=7 colDec=4 + REPORTCOL colHead = "S/C HA" colVal = sin( HA) / cos( HA) colWid=7 colDec=4 + REPORTCOL colHead = "asinHA" colVal = asin( sin( HA)) colWid=7 colDec=4 + REPORTCOL colHead = "acosHA" colVal = acos( cos( HA)) colWid=7 colDec=4 + REPORTCOL colHead = "atanHA" colVal = atan( tan( HA)) colWid=7 colDec=4 + REPORTCOL colHead = "atan2HA" colVal = atan2( sin( HA),cos( HA)) colWid=7 colDec=4 + + + REPORTCOL colHead = "HrAngD" colVal = HAD colWid=6 colDec=4 // hour angle: degrees relative to solar noon (+ afternoon) + REPORTCOL colHead = "SinHAD" colVal = sind( HAD) colWid=7 colDec=4 + REPORTCOL colHead = "CosHAD" colVal = cosd( HAD) colWid=7 colDec=4 + REPORTCOL colHead = "C+SHAD" colVal = pow( sind( HAD),2)+pow( cosd( HAD),2) colWid=7 colDec=4 + REPORTCOL colHead = "TanHAD" colVal = tand( HAD) colWid=7 colDec=4 + REPORTCOL colHead = "S/C HAD" colVal = sind( HAD) / cosd( HAD) colWid=7 colDec=4 + REPORTCOL colHead = "asinHAD" colVal = asind( sind( HAD)) colWid=7 colDec=4 + REPORTCOL colHead = "acosHAD" colVal = acosd( cosd( HAD)) colWid=7 colDec=4 + REPORTCOL colHead = "atanHAD" colVal = atand( tan( HA)) colWid=7 colDec=4 + REPORTCOL colHead = "atan2HAD" colVal = atan2d( sind( HAD),cosd( HAD)) colWid=8 colDec=4 + ENDREPORT + RUN $EOF -! CSE 0.918.0+expression-coverage.e4f1481c.79.dirty for Win32 console run(s) done: Mon 21-Aug-23 11:32:46 am +! CSE 0.919.0+expression-coverage.09511677.3.dirty for Win32 console run(s) done: Mon 13-Nov-23 2:31:55 pm ! Executable: d:\cse\msvc\cse.exe -! 21-Aug-23 11:32 am (VS 14.29 2775552 bytes) (HPWH 1.22.0) -! Command line: -x! -t1 expressions +! 13-Nov-23 2:30 pm (VS 14.29 2796032 bytes) (HPWH 1.22.0+HEAD.d205413.4) +! Command line: -x! -b -t1 expressions ! Input file: D:\cse\test\expressions.cse ! Report file: D:\CSE\TEST\EXPRESSIONS.REP ! Timing info -- -! Input: Time = 0.05 Calls = 1 T/C = 0.0480 +! Input: Time = 0.06 Calls = 1 T/C = 0.0550 ! AutoSizing: Time = 0.00 Calls = 0 T/C = 0.0000 -! Simulation: Time = 0.22 Calls = 1 T/C = 0.2240 +! Simulation: Time = 0.30 Calls = 1 T/C = 0.3030 ! Reports: Time = 0.00 Calls = 1 T/C = 0.0010 -! Total: Time = 0.28 Calls = 1 T/C = 0.2750 +! Total: Time = 0.36 Calls = 1 T/C = 0.3590 From 964b678eea90ed47d8d9df4b389aedaad92262e0 Mon Sep 17 00:00:00 2001 From: Chip Barnaby Date: Mon, 27 Nov 2023 14:01:35 -0500 Subject: [PATCH 04/13] More expressions added --- test/expressions.cse | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/test/expressions.cse b/test/expressions.cse index 05e435b5a..fcf847aa7 100644 --- a/test/expressions.cse +++ b/test/expressions.cse @@ -4,17 +4,39 @@ nSubSteps=20 wfName = "CA_SACRAMENTO-EXECUTIVE-AP_724830S_STYP20.epw" +// some data to probe +GAIN GN1 gnPower=$dayOfYear +GAIN GN2 gnPower=$dayOfYear/brkt( 2, $hour, 7) + + DELETE REPORT EB REPORT rpType=UDT rpFreq=Year rpTitle="Some one-off tests" -REPORTCOL colHead = "FtIn" colVal = 1' 6 == 1.5 ? "Yes" : "No" colWid=4 -REPORTCOL colHead = "GT" colVal = 4.01+1 > abs( -5) ? "Yes" : "No" colWid=4 -REPORTCOL colHead = "LT" colVal = 4.01+.5 < min( 6, abs( -5)) ? "Yes" : "No" colWid=4 -REPORTCOL colHead = "LE" colVal = sqrt( 16) <= max( 4.1, -2) ? "Yes" : "No" colWid=4 + REPORTCOL colHead = "FtIn" colVal = 1' 6 == 1.5 ? "Yes" : "No" colWid=4 + REPORTCOL colHead = "GT" colVal = 4.01+1 > abs( -5) ? "Yes" : "No" colWid=4 + REPORTCOL colHead = "LT" colVal = 4.01+.5 < min( 6, abs( -5)) ? "Yes" : "No" colWid=4 + REPORTCOL colHead = "LE" colVal = sqrt( 16) <= max( 4.1, -2) ? "Yes" : "No" colWid=4 + +ENDREPORT + +// TODO: no way to get the error return? +REPORT rpType=UDT rpFreq=Year rpTitle="FileInfo" + REPORTCOL colHead = "Error" colVal=fileInfo("%") colWid=5 + REPORTCOL colHead = "Empty" colVal = fileInfo("expressions.err") colWid=5 + REPORTCOL colHead = "Norm" colVal = fileInfo(@Top.wfName) colWid=5 + REPORTCOL colHead = "Dir" colVal = fileInfo(".") colWid=5 +ENDREPORT +REPORT rpType=UDT rpFreq=Hour rpDayBeg=may 1 rpTitle="log, pow, exp" + REPORTCOL colHead = "Hr" colVal=$hour colWid=2 + REPORTCOL colHead = "ExpHr" colVal=exp($hour-12) colwid=8 colDec=4 + REPORTCOL colHead = "LxHr" colVal=exp(loge($hour)) colwid=6 colDec=2 + REPORTCOL colHead = "LP10Hr" colVal=pow(10., log10($hour)) colwid=6 colDec=2 +ENDREPORT + -// Trig fuctions. No test for tan( PI/2) -- HA calc is a little inaccurate, so no overflow +// Trig fuctions. No check for tan( PI/2) -- HA calc is a little inaccurate, so no overflow #define HA (($hour-12)*PI/12) #define HAD (($hour-12)*15) REPORT rpType=UDT rpFreq=Hour rpDayBeg=jul 1 rpTitle="Trig functions" @@ -45,6 +67,12 @@ REPORT rpType=UDT rpFreq=Hour rpDayBeg=jul 1 rpTitle="Trig functions" REPORTCOL colHead = "atan2HAD" colVal = atan2d( sind( HAD),cosd( HAD)) colWid=8 colDec=4 ENDREPORT +REPORT rpType=UDT rpFreq=Hour rpDayBeg=may 1 rpTitle="Probes" + REPORTCOL colHead = "Hr" colVal=$hour colWid=2 + REPORTCOL colHead = "GN1" colVal=@GAIN[ "GN1"].gnPower colWid=6 colDec=2 + REPORTCOL colHead = "GN2" colVal=@GAIN[ 2].gnPower colWid=6 colDec=2 +ENDREPORT + RUN $EOF From 56a67032aad7ce8cf0282600875ba13142e2eed9 Mon Sep 17 00:00:00 2001 From: Chip Barnaby Date: Mon, 27 Nov 2023 14:22:44 -0500 Subject: [PATCH 05/13] Update ref/expressions.rep --- test/ref/expressions.rep | 122 +++++++++++++++++++++++++++++++++++---- 1 file changed, 110 insertions(+), 12 deletions(-) diff --git a/test/ref/expressions.rep b/test/ref/expressions.rep index 4f0c6b834..1c804e758 100644 --- a/test/ref/expressions.rep +++ b/test/ref/expressions.rep @@ -8,6 +8,45 @@ Some one-off tests +FileInfo + + Error Empty Norm Dir + ----- ----- ----- ----- + 0 1 2 3 + + + +log, pow, exp for Fri 01-May + + Hr ExpHr LxHr LP10Hr + -- -------- ------ ------ + 1 .0000167 1.00 1.00 + 2 .0000454 2.00 2.00 + 3 .0001234 3.00 3.00 + 4 .0003355 4.00 4.00 + 5 .0009119 5.00 5.00 + 6 0.002479 6.00 6.00 + 7 0.006738 7.00 7.00 + 8 0.01832 8.00 8.00 + 9 0.04979 9.00 9.00 + 10 0.1353 10.00 10.00 + 11 0.3679 11.00 11.00 + 12 1.0000 12.00 12.00 + 13 2.7183 13.00 13.00 + 14 7.3891 14.00 14.00 + 15 20.0855 15.00 15.00 + 16 54.5981 16.00 16.00 + 17 148.4132 17.00 17.00 + 18 403.4288 18.00 18.00 + 19 1096.633 19.00 19.00 + 20 2980.958 20.00 20.00 + 21 8103.084 21.00 21.00 + 22 22026.46 22.00 22.00 + 23 59874.14 23.00 23.00 + 24 162754.8 24.00 24.00 + + + Trig functions for Wed 01-Jul Day Hr HrAng SinHA CosHA C+SHA TanHA S/C HA asinHA acosHA atanHA atan2HA HrAngD SinHAD CosHAD C+SHAD TanHAD S/C HAD asinHAD acosHAD atanHAD atan2HAD @@ -39,9 +78,40 @@ Trig functions for Wed 01-Jul +Probes for Fri 01-May + + Hr GN1 GN2 + -- ------ ------ + 1 121.00 60.50 + 2 121.00 60.50 + 3 121.00 40.33 + 4 121.00 30.25 + 5 121.00 24.20 + 6 121.00 20.17 + 7 121.00 17.29 + 8 121.00 17.29 + 9 121.00 17.29 + 10 121.00 17.29 + 11 121.00 17.29 + 12 121.00 17.29 + 13 121.00 17.29 + 14 121.00 17.29 + 15 121.00 17.29 + 16 121.00 17.29 + 17 121.00 17.29 + 18 121.00 17.29 + 19 121.00 17.29 + 20 121.00 17.29 + 21 121.00 17.29 + 22 121.00 17.29 + 23 121.00 17.29 + 24 121.00 17.29 + + + ! Log for Run 001: -! CSE 0.919.0+expression-coverage.09511677.3.dirty for Win32 console +! CSE 0.919.0+expression-coverage.964b678e.5 for Win32 console @@ -53,17 +123,39 @@ Input for Run 001: wfName = "CA_SACRAMENTO-EXECUTIVE-AP_724830S_STYP20.epw" + // some data to probe + GAIN GN1 gnPower=$dayOfYear + GAIN GN2 gnPower=$dayOfYear/brkt( 2, $hour, 7) + + DELETE REPORT EB REPORT rpType=UDT rpFreq=Year rpTitle="Some one-off tests" - REPORTCOL colHead = "FtIn" colVal = 1' 6 == 1.5 ? "Yes" : "No" colWid=4 - REPORTCOL colHead = "GT" colVal = 4.01+1 > abs( -5) ? "Yes" : "No" colWid=4 - REPORTCOL colHead = "LT" colVal = 4.01+.5 < min( 6, abs( -5)) ? "Yes" : "No" colWid=4 - REPORTCOL colHead = "LE" colVal = sqrt( 16) <= max( 4.1, -2) ? "Yes" : "No" colWid=4 + REPORTCOL colHead = "FtIn" colVal = 1' 6 == 1.5 ? "Yes" : "No" colWid=4 + REPORTCOL colHead = "GT" colVal = 4.01+1 > abs( -5) ? "Yes" : "No" colWid=4 + REPORTCOL colHead = "LT" colVal = 4.01+.5 < min( 6, abs( -5)) ? "Yes" : "No" colWid=4 + REPORTCOL colHead = "LE" colVal = sqrt( 16) <= max( 4.1, -2) ? "Yes" : "No" colWid=4 + + ENDREPORT + + // TODO: no way to get the error return? + REPORT rpType=UDT rpFreq=Year rpTitle="FileInfo" + REPORTCOL colHead = "Error" colVal=fileInfo("%") colWid=5 + REPORTCOL colHead = "Empty" colVal = fileInfo("expressions.err") colWid=5 + REPORTCOL colHead = "Norm" colVal = fileInfo(@Top.wfName) colWid=5 + REPORTCOL colHead = "Dir" colVal = fileInfo(".") colWid=5 + ENDREPORT + REPORT rpType=UDT rpFreq=Hour rpDayBeg=may 1 rpTitle="log, pow, exp" + REPORTCOL colHead = "Hr" colVal=$hour colWid=2 + REPORTCOL colHead = "ExpHr" colVal=exp($hour-12) colwid=8 colDec=4 + REPORTCOL colHead = "LxHr" colVal=exp(loge($hour)) colwid=6 colDec=2 + REPORTCOL colHead = "LP10Hr" colVal=pow(10., log10($hour)) colwid=6 colDec=2 + ENDREPORT - // Trig fuctions. No test for tan( PI/2) -- HA calc is a little inaccurate, so no overflow + + // Trig fuctions. No check for tan( PI/2) -- HA calc is a little inaccurate, so no overflow # #define HA (($hour-12)*PI/12) # #define HAD (($hour-12)*15) REPORT rpType=UDT rpFreq=Hour rpDayBeg=jul 1 rpTitle="Trig functions" @@ -94,24 +186,30 @@ Input for Run 001: REPORTCOL colHead = "atan2HAD" colVal = atan2d( sind( HAD),cosd( HAD)) colWid=8 colDec=4 ENDREPORT + REPORT rpType=UDT rpFreq=Hour rpDayBeg=may 1 rpTitle="Probes" + REPORTCOL colHead = "Hr" colVal=$hour colWid=2 + REPORTCOL colHead = "GN1" colVal=@GAIN[ "GN1"].gnPower colWid=6 colDec=2 + REPORTCOL colHead = "GN2" colVal=@GAIN[ 2].gnPower colWid=6 colDec=2 + ENDREPORT + RUN $EOF -! CSE 0.919.0+expression-coverage.09511677.3.dirty for Win32 console run(s) done: Mon 13-Nov-23 2:31:55 pm +! CSE 0.919.0+expression-coverage.964b678e.5 for Win32 console run(s) done: Mon 27-Nov-23 2:16:28 pm ! Executable: d:\cse\msvc\cse.exe -! 13-Nov-23 2:30 pm (VS 14.29 2796032 bytes) (HPWH 1.22.0+HEAD.d205413.4) -! Command line: -x! -b -t1 expressions +! 27-Nov-23 2:14 pm (VS 14.29 2796032 bytes) (HPWH 1.22.0+HEAD.d205413.4) +! Command line: -x! -t1 expressions ! Input file: D:\cse\test\expressions.cse ! Report file: D:\CSE\TEST\EXPRESSIONS.REP ! Timing info -- -! Input: Time = 0.06 Calls = 1 T/C = 0.0550 +! Input: Time = 0.05 Calls = 1 T/C = 0.0460 ! AutoSizing: Time = 0.00 Calls = 0 T/C = 0.0000 -! Simulation: Time = 0.30 Calls = 1 T/C = 0.3030 +! Simulation: Time = 0.28 Calls = 1 T/C = 0.2830 ! Reports: Time = 0.00 Calls = 1 T/C = 0.0010 -! Total: Time = 0.36 Calls = 1 T/C = 0.3590 +! Total: Time = 0.33 Calls = 1 T/C = 0.3320 From 5b7cb482bb5976d266c22c6fe9396f723a60ce98 Mon Sep 17 00:00:00 2001 From: Chip Barnaby Date: Mon, 27 Nov 2023 15:46:40 -0500 Subject: [PATCH 06/13] Update HPWHsim --- vendor/HPWHsim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/HPWHsim b/vendor/HPWHsim index d20541324..92d5edf23 160000 --- a/vendor/HPWHsim +++ b/vendor/HPWHsim @@ -1 +1 @@ -Subproject commit d2054132479a920d651a77a733e53de2a24e634b +Subproject commit 92d5edf2393ff8f521121484f6a62082303a8d94 From 4b9ea9a3b47b117db5de98bd58a70ea80e7dc63c Mon Sep 17 00:00:00 2001 From: Chip Barnaby Date: Tue, 28 Nov 2023 14:00:13 -0500 Subject: [PATCH 07/13] Fix typos; coverage tracking only when _DEBUG --- src/cueval.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cueval.cpp b/src/cueval.cpp index aadbf0367..ff608eec0 100644 --- a/src/cueval.cpp +++ b/src/cueval.cpp @@ -135,9 +135,12 @@ w} /* cuEvalF */ #endif /////////////////////////////////////////////////////////////////////////////// -// Coveerage: counts use of opcodes to verify testing coverage +// Coverage: count use of opcodes to verify testing coverage +#if defined( _DEBUG) #define COVERAGE_TRACKING +#endif + #if defined( COVERAGE_TRACKING) static int coverageCounts[ PSOPE_COUNT] = { 0 }; static const char* GetPseudocodeName(int op) From 8a223ce49af2684f7f8febe8ca4d7d7199340fe5 Mon Sep 17 00:00:00 2001 From: Chip Barnaby Date: Tue, 28 Nov 2023 16:12:10 -0500 Subject: [PATCH 08/13] Extend coverage (psychro, interger arithmetic) --- test/expressions.cse | 16 +++++- test/ref/expressions.rep | 108 ++++++++++++++++++++++++++------------- 2 files changed, 87 insertions(+), 37 deletions(-) diff --git a/test/expressions.cse b/test/expressions.cse index fcf847aa7..5d7e79fa4 100644 --- a/test/expressions.cse +++ b/test/expressions.cse @@ -27,12 +27,26 @@ REPORT rpType=UDT rpFreq=Year rpTitle="FileInfo" REPORTCOL colHead = "Dir" colVal = fileInfo(".") colWid=5 ENDREPORT +REPORT rpType=UDT rpFreq=Day rpTitle="Dates etc" rpDayBeg=Apr 1 rpDayEnd=Apr 15 + REPORTCOL colHead = "DOY" colVal = $dayOfYear colWid=4 + REPORTCOL colHead = "DOW1" colVal = fix(abs(-($dayOfYear+3)))%7 + 1 colWid=4 + REPORTCOL colHead = "DOW2" colVal = $dayOfWeek colWid=4 +ENDREPORT + + -REPORT rpType=UDT rpFreq=Hour rpDayBeg=may 1 rpTitle="log, pow, exp" +REPORT rpType=UDT rpFreq=Hour rpDayBeg=may 1 rpTitle="log/pow/exp + psychro" REPORTCOL colHead = "Hr" colVal=$hour colWid=2 REPORTCOL colHead = "ExpHr" colVal=exp($hour-12) colwid=8 colDec=4 REPORTCOL colHead = "LxHr" colVal=exp(loge($hour)) colwid=6 colDec=2 REPORTCOL colHead = "LP10Hr" colVal=pow(10., log10($hour)) colwid=6 colDec=2 + REPORTCOL colHead = "tDBO" colVal=$tDbO colWid=10 colDec=3 + REPORTCOL colHead = "tWbO" colVal=$tWbO colWid=6 colDec=3 + REPORTCOL colHead = "wO" colVal=$wO colWid=6 colDec=5 + REPORTCOL colHead = "w1" colVal=wFromDbWb($tDbO,$tWbO) colWid=6 colDec=5 + REPORTCOL colHead = "rh" colVal=rhFromDbW($tDbO,$wO) colWid=6 colDec=4 + REPORTCOL colHead = "w2" colVal=wFromDbRh($tDbO,rhFromDbW($tDbO,$wO)) colWid=6 colDec=4 + REPORTCOL colHead = "enth" colVal=enthalpy($tDbO,$wO) colWid=6 colDec=2 ENDREPORT diff --git a/test/ref/expressions.rep b/test/ref/expressions.rep index 1c804e758..bf11e6351 100644 --- a/test/ref/expressions.rep +++ b/test/ref/expressions.rep @@ -16,34 +16,56 @@ FileInfo -log, pow, exp for Fri 01-May - - Hr ExpHr LxHr LP10Hr - -- -------- ------ ------ - 1 .0000167 1.00 1.00 - 2 .0000454 2.00 2.00 - 3 .0001234 3.00 3.00 - 4 .0003355 4.00 4.00 - 5 .0009119 5.00 5.00 - 6 0.002479 6.00 6.00 - 7 0.006738 7.00 7.00 - 8 0.01832 8.00 8.00 - 9 0.04979 9.00 9.00 - 10 0.1353 10.00 10.00 - 11 0.3679 11.00 11.00 - 12 1.0000 12.00 12.00 - 13 2.7183 13.00 13.00 - 14 7.3891 14.00 14.00 - 15 20.0855 15.00 15.00 - 16 54.5981 16.00 16.00 - 17 148.4132 17.00 17.00 - 18 403.4288 18.00 18.00 - 19 1096.633 19.00 19.00 - 20 2980.958 20.00 20.00 - 21 8103.084 21.00 21.00 - 22 22026.46 22.00 22.00 - 23 59874.14 23.00 23.00 - 24 162754.8 24.00 24.00 +Dates etc for Apr + + DOY DOW1 DOW2 + ---- ---- ---- + 91 4 4 + 92 5 5 + 93 6 6 + 94 7 7 + 95 1 1 + 96 2 2 + 97 3 3 + 98 4 4 + 99 5 5 + 100 6 6 + 101 7 7 + 102 1 1 + 103 2 2 + 104 3 3 + 105 4 4 + + + +log/pow/exp + psychro for Fri 01-May + + Hr ExpHr LxHr LP10Hr tDBO tWbO wO w1 rh w2 enth + -- -------- ------ ------ ---------- ------ ------ ------ ------ ------ ------ + 1 .0000167 1.00 1.00 58.640 49.228 .00531 .00531 0.5069 .00531 19.85 + 2 .0000454 2.00 2.00 59.000 50.695 .00599 .00599 0.5633 .00599 20.67 + 3 .0001234 3.00 3.00 57.740 50.462 .00615 .00615 0.6052 .00615 20.54 + 4 .0003355 4.00 4.00 61.340 51.806 .00603 .00603 0.5215 .00603 21.28 + 5 .0009119 5.00 5.00 60.080 52.186 .00652 .00652 0.5902 .00652 21.51 + 6 0.002479 6.00 6.00 60.800 52.971 .00679 .00679 0.5984 .00679 21.98 + 7 0.006738 7.00 7.00 60.440 52.578 .00665 .00665 0.5944 .00665 21.74 + 8 0.01832 8.00 8.00 63.500 54.078 .00679 .00679 0.5442 .00679 22.63 + 9 0.04979 9.00 9.00 68.540 55.326 .00633 .00633 0.4266 .00633 23.36 + 10 0.1353 10.00 10.00 73.580 57.288 .00633 .00633 0.3591 .00633 24.59 + 11 0.3679 11.00 11.00 77.540 58.638 .00624 .00624 0.3103 .00624 25.45 + 12 1.0000 12.00 12.00 82.220 59.322 .00559 .00559 0.2387 .00559 25.87 + 13 2.7183 13.00 13.00 84.200 59.242 .00510 .00510 0.2045 .00510 25.80 + 14 7.3891 14.00 14.00 86.180 60.943 .00571 .00571 0.2146 .00571 26.96 + 15 20.0855 15.00 15.00 87.260 61.626 .00591 .00591 0.2146 .00591 27.44 + 16 54.5981 16.00 16.00 88.160 62.459 .00624 .00624 0.2205 .00624 28.03 + 17 148.4132 17.00 17.00 88.880 63.409 .00670 .00670 0.2308 .00670 28.70 + 18 403.4288 18.00 18.00 88.520 63.913 .00711 .00711 0.2476 .00711 29.06 + 19 1096.633 19.00 19.00 87.800 63.821 .00721 .00721 0.2571 .00721 29.00 + 20 2980.958 20.00 20.00 85.460 64.183 .00799 .00799 0.3062 .00799 29.29 + 21 8103.084 21.00 21.00 81.680 62.876 .00799 .00799 0.3458 .00799 28.37 + 22 22026.46 22.00 22.00 78.620 61.885 .00804 .00804 0.3847 .00804 27.68 + 23 59874.14 23.00 23.00 75.740 61.739 .00861 .00861 0.4530 .00861 27.60 + 24 162754.8 24.00 24.00 73.760 61.046 .00861 .00861 0.4832 .00861 27.12 @@ -111,7 +133,7 @@ Probes for Fri 01-May ! Log for Run 001: -! CSE 0.919.0+expression-coverage.964b678e.5 for Win32 console +! CSE 0.920.0+expression-coverage.4b9ea9a3.9 for Win32 console @@ -146,12 +168,26 @@ Input for Run 001: REPORTCOL colHead = "Dir" colVal = fileInfo(".") colWid=5 ENDREPORT + REPORT rpType=UDT rpFreq=Day rpTitle="Dates etc" rpDayBeg=Apr 1 rpDayEnd=Apr 15 + REPORTCOL colHead = "DOY" colVal = $dayOfYear colWid=4 + REPORTCOL colHead = "DOW1" colVal = fix(abs(-($dayOfYear+3)))%7 + 1 colWid=4 + REPORTCOL colHead = "DOW2" colVal = $dayOfWeek colWid=4 + ENDREPORT + + - REPORT rpType=UDT rpFreq=Hour rpDayBeg=may 1 rpTitle="log, pow, exp" + REPORT rpType=UDT rpFreq=Hour rpDayBeg=may 1 rpTitle="log/pow/exp + psychro" REPORTCOL colHead = "Hr" colVal=$hour colWid=2 REPORTCOL colHead = "ExpHr" colVal=exp($hour-12) colwid=8 colDec=4 REPORTCOL colHead = "LxHr" colVal=exp(loge($hour)) colwid=6 colDec=2 REPORTCOL colHead = "LP10Hr" colVal=pow(10., log10($hour)) colwid=6 colDec=2 + REPORTCOL colHead = "tDBO" colVal=$tDbO colWid=10 colDec=3 + REPORTCOL colHead = "tWbO" colVal=$tWbO colWid=6 colDec=3 + REPORTCOL colHead = "wO" colVal=$wO colWid=6 colDec=5 + REPORTCOL colHead = "w1" colVal=wFromDbWb($tDbO,$tWbO) colWid=6 colDec=5 + REPORTCOL colHead = "rh" colVal=rhFromDbW($tDbO,$wO) colWid=6 colDec=4 + REPORTCOL colHead = "w2" colVal=wFromDbRh($tDbO,rhFromDbW($tDbO,$wO)) colWid=6 colDec=4 + REPORTCOL colHead = "enth" colVal=enthalpy($tDbO,$wO) colWid=6 colDec=2 ENDREPORT @@ -198,18 +234,18 @@ Input for Run 001: -! CSE 0.919.0+expression-coverage.964b678e.5 for Win32 console run(s) done: Mon 27-Nov-23 2:16:28 pm +! CSE 0.920.0+expression-coverage.4b9ea9a3.9 for Win32 console run(s) done: Tue 28-Nov-23 4:11:12 pm ! Executable: d:\cse\msvc\cse.exe -! 27-Nov-23 2:14 pm (VS 14.29 2796032 bytes) (HPWH 1.22.0+HEAD.d205413.4) +! 28-Nov-23 2:16 pm (VS 14.29 2798592 bytes) (HPWH 1.22.0+HEAD.92d5edf.77) ! Command line: -x! -t1 expressions ! Input file: D:\cse\test\expressions.cse ! Report file: D:\CSE\TEST\EXPRESSIONS.REP ! Timing info -- -! Input: Time = 0.05 Calls = 1 T/C = 0.0460 +! Input: Time = 0.05 Calls = 1 T/C = 0.0480 ! AutoSizing: Time = 0.00 Calls = 0 T/C = 0.0000 -! Simulation: Time = 0.28 Calls = 1 T/C = 0.2830 -! Reports: Time = 0.00 Calls = 1 T/C = 0.0010 -! Total: Time = 0.33 Calls = 1 T/C = 0.3320 +! Simulation: Time = 0.30 Calls = 1 T/C = 0.3020 +! Reports: Time = 0.00 Calls = 1 T/C = 0.0000 +! Total: Time = 0.35 Calls = 1 T/C = 0.3520 From fcae77bb22c0c3144eabd81bd7828597a54ac013 Mon Sep 17 00:00:00 2001 From: Chip Barnaby Date: Tue, 28 Nov 2023 16:18:40 -0500 Subject: [PATCH 09/13] Update HPWH --- vendor/HPWHsim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/HPWHsim b/vendor/HPWHsim index 92d5edf23..a336249cb 160000 --- a/vendor/HPWHsim +++ b/vendor/HPWHsim @@ -1 +1 @@ -Subproject commit 92d5edf2393ff8f521121484f6a62082303a8d94 +Subproject commit a336249cb220e846d17b6c70e5413f40ef958cfb From b47a6c09f6828add66564bcf868409c474d822b7 Mon Sep 17 00:00:00 2001 From: Chip Barnaby Date: Tue, 28 Nov 2023 16:28:40 -0500 Subject: [PATCH 10/13] Revert HPWH --- vendor/HPWHsim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/HPWHsim b/vendor/HPWHsim index a336249cb..92d5edf23 160000 --- a/vendor/HPWHsim +++ b/vendor/HPWHsim @@ -1 +1 @@ -Subproject commit a336249cb220e846d17b6c70e5413f40ef958cfb +Subproject commit 92d5edf2393ff8f521121484f6a62082303a8d94 From 372128302418c3e441eed0828b130503b7ceac70 Mon Sep 17 00:00:00 2001 From: Chip Barnaby Date: Sat, 2 Dec 2023 17:11:49 -0500 Subject: [PATCH 11/13] Write coverage into to report file; additional expressions in expressions.cse --- doc/src/records/top-members.md | 12 ++ src/CNRECS.DEF | 2 + src/cncult.cpp | 1 + src/cse.cpp | 8 +- src/cueval.cpp | 328 ++++++++++++++++++--------------- src/cueval.h | 2 +- src/cuparse.cpp | 10 +- test/expressions.cse | 43 ++++- test/ref/ASHPPKGROOM.REP | 47 ++--- test/ref/expressions.rep | 289 +++++++++++++++++++++++------ 10 files changed, 501 insertions(+), 241 deletions(-) diff --git a/doc/src/records/top-members.md b/doc/src/records/top-members.md index ed7f7c796..e6a530572 100644 --- a/doc/src/records/top-members.md +++ b/doc/src/records/top-members.md @@ -1062,6 +1062,18 @@ Allows passing an input value to ad-hoc debugging code. No permanent use; no im required: "No", variability: "subhourly") %> +**doCoverage=*choice*** + +Enables expression code coverage reporting. Development aid. + +<%= member_table( + units: "", + legal_range: "NO, YES", + default: "*NO*", + required: "No", + variability: "constant") %> + + **Related Probes:** - @[top](#p_top) diff --git a/src/CNRECS.DEF b/src/CNRECS.DEF index 477442c97..68753c33a 100644 --- a/src/CNRECS.DEF +++ b/src/CNRECS.DEF @@ -291,6 +291,8 @@ RECORD TOPRAT "top" *RAT /* top level RAT: contains control info and all once-on *i INT tp_dbgPrintMaskC // debug print mask constant portion (value known during setup) *declare "int tp_SetDbMask();" // combine tp_dbgPrintMask and tp_dbgPrintMaskC, call DbSetMask *s INT tp_dbgFlag // debug flag value for passing testing info to code; normally no effect + *i NOYESCH tp_doCoverage // track expression processing code coverage / report to log + // (testing/development aid) //TOP: inputs: autoSizing *i FRAC_GZ auszTol // autosizing result tolerance, dfl .005 diff --git a/src/cncult.cpp b/src/cncult.cpp index 94a8a6907..b809c0d54 100644 --- a/src/cncult.cpp +++ b/src/cncult.cpp @@ -2812,6 +2812,7 @@ CULT cnTopCult[] = // Top level table, points to all other tables, used in cal CULT( "dbgPrintMask",DAT, TOPRAT_DBGPRINTMASK,0, 0, VHRLY, TYINT, 0, 0, N, N), CULT( "dbgPrintMaskC",DAT, TOPRAT_DBGPRINTMASKC,0, 0, VEOI, TYINT, 0, 0, N, N), CULT( "dbgFlag", DAT, TOPRAT_DBGFLAG, 0, 0, VSUBHRLY,TYINT,0, 0, N, N), + CULT( "doCoverage", DAT, TOPRAT_DOCOVERAGE, 0, 0, VEOI, TYCH, 0, C_NOYESCH_NO, N, N), CULT( "ventAvail", DAT, TOPRAT_VENTAVAIL, 0, 0, VHRLY, TYCH, 0, nc( C_VENTAVAILVC_WHOLEBLDG), N, N), // TOP autosizing diff --git a/src/cse.cpp b/src/cse.cpp index dddb13684..b5ab07e6a 100644 --- a/src/cse.cpp +++ b/src/cse.cpp @@ -77,6 +77,7 @@ #include "timer.h" // tmrInit #include "tdpak.h" // tddtis #include "cuparse.h" // showProbeNames +#include "cueval.h" #include "cnguts.h" #include "csevrsn.h" // version # @@ -1161,6 +1162,10 @@ LOCAL int cse3( int argc, const char* argv[]) // reports: "Unspool" virtual reports from this run into report/export output files screen( NONL|QUIETIF, " Reports\n"); // progress indicator. follows last month name on screen (if no errMsgs). // Is final message, so end with newline. + + if (Top.tp_doCoverage == C_NOYESCH_YES) + CoverageReport( VrLog); + if (UnspoolInfo) // if UnspoolInfo got set up (in cncult.cpp). // If not (early input error), ermsgs will be unspooled below via PriRep info. { @@ -1198,9 +1203,6 @@ LOCAL int cse3( int argc, const char* argv[]) cul( 4, NULL, NULL, NULL, NULL); // cul.cpp extClr(); // clear expression tbl (to free DM), exman.cpp. cannot be done before RUN! - extern void CoverageAnalysis(); - CoverageAnalysis(); - // Format overall timing info and other final notes to virtual report. Includes date, time, program name, version. tmrStop(TMR_TOTAL); diff --git a/src/cueval.cpp b/src/cueval.cpp index ff608eec0..e5680844a 100644 --- a/src/cueval.cpp +++ b/src/cueval.cpp @@ -137,163 +137,185 @@ w} /* cuEvalF */ /////////////////////////////////////////////////////////////////////////////// // Coverage: count use of opcodes to verify testing coverage -#if defined( _DEBUG) -#define COVERAGE_TRACKING -#endif - -#if defined( COVERAGE_TRACKING) -static int coverageCounts[ PSOPE_COUNT] = { 0 }; -static const char* GetPseudocodeName(int op) +#include "vrpak.h" +// count of each opcode execution +// use 64 bits (insurance); 32 bits could conceivably overflow (?) +static long long int coverageCounts[PSOPE_COUNT] = { 0 }; +struct COVINFO { -#define OPNAMECASE( op) case op: opName = #op; break - const char* opName = "?"; - switch (op) - { + COVINFO(int _op, const char* _opName) : op(_op), opName(_opName) {} + int op; // op code + const char* opName; // text name of pseudo-opH +}; - OPNAMECASE(PSNUL); - OPNAMECASE(PSEND); - OPNAMECASE(PSKON2); - OPNAMECASE(PSKON4); +#define OPINFO( op) COVINFO( op, #op) +static COVINFO coverageInfo[] = +{ OPINFO(PSNUL), + OPINFO(PSEND), + OPINFO(PSKON2), + OPINFO(PSKON4), #if defined( USE_PSPKONN) - OPNAMECASE(PSPKONN); + OPINFO(PSPKONN), #endif - OPNAMECASE(PSLOD2); - OPNAMECASE(PSLOD4); - OPNAMECASE(PSRLOD2); - OPNAMECASE(PSRLOD4); - OPNAMECASE(PSSTO2); - OPNAMECASE(PSSTO4); - OPNAMECASE(PSPUT2); - OPNAMECASE(PSPUT4); - OPNAMECASE(PSRSTO2); - OPNAMECASE(PSRSTO4); - OPNAMECASE(PSDUP2); - OPNAMECASE(PSDUP4); - OPNAMECASE(PSPOP2); - OPNAMECASE(PSPOP4); - OPNAMECASE(PSFIX2); - OPNAMECASE(PSFIX4); - OPNAMECASE(PSFLOAT2); - OPNAMECASE(PSFLOAT4); - OPNAMECASE(PSSIINT); - OPNAMECASE(PSINTSI); - OPNAMECASE(PSIBOO); - OPNAMECASE(PSSCH); - OPNAMECASE(PSNCN); - OPNAMECASE(PSFINCHES); - OPNAMECASE(PSIDOY); - OPNAMECASE(PSIABS); - OPNAMECASE(PSINEG); - OPNAMECASE(PSIADD); - OPNAMECASE(PSISUB); - OPNAMECASE(PSIMUL); - OPNAMECASE(PSIDIV); - OPNAMECASE(PSIMOD); - OPNAMECASE(PSIDEC); - OPNAMECASE(PSIINC); - OPNAMECASE(PSINOT); - OPNAMECASE(PSIONC); - OPNAMECASE(PSILSH); - OPNAMECASE(PSIRSH); - OPNAMECASE(PSIEQ); - OPNAMECASE(PSINE); - OPNAMECASE(PSILT); - OPNAMECASE(PSILE); - OPNAMECASE(PSIGE); - OPNAMECASE(PSIGT); - OPNAMECASE(PSIBOR); - OPNAMECASE(PSIXOR); - OPNAMECASE(PSIBAN); - OPNAMECASE(PSIBRKT); - OPNAMECASE(PSIMIN); - OPNAMECASE(PSIMAX); - OPNAMECASE(PSFABS); - OPNAMECASE(PSFNEG); - OPNAMECASE(PSFADD); - OPNAMECASE(PSFSUB); - OPNAMECASE(PSFMUL); - OPNAMECASE(PSFDIV); - OPNAMECASE(PSFDEC); - OPNAMECASE(PSFINC); - OPNAMECASE(PSFEQ); - OPNAMECASE(PSFNE); - OPNAMECASE(PSFLT); - OPNAMECASE(PSFLE); - OPNAMECASE(PSFGE); - OPNAMECASE(PSFGT); - OPNAMECASE(PSFBRKT); - OPNAMECASE(PSFMIN); - OPNAMECASE(PSFMAX); - OPNAMECASE(PSFSQRT); - OPNAMECASE(PSFEXP); - OPNAMECASE(PSFPOW); - OPNAMECASE(PSFLOGE); - OPNAMECASE(PSFLOG10); - OPNAMECASE(PSFSIN); - OPNAMECASE(PSFCOS); - OPNAMECASE(PSFTAN); - OPNAMECASE(PSFASIN); - OPNAMECASE(PSFACOS); - OPNAMECASE(PSFATAN); - OPNAMECASE(PSFATAN2); - OPNAMECASE(PSFSIND); - OPNAMECASE(PSFCOSD); - OPNAMECASE(PSFTAND); - OPNAMECASE(PSFASIND); - OPNAMECASE(PSFACOSD); - OPNAMECASE(PSFATAND); - OPNAMECASE(PSFATAN2D); - OPNAMECASE(PSDBWB2W); - OPNAMECASE(PSDBRH2W); - OPNAMECASE(PSDBW2RH); - OPNAMECASE(PSDBW2H); - OPNAMECASE(PSFILEINFO); - OPNAMECASE(PSNOP); - OPNAMECASE(PSJMP); - OPNAMECASE(PSPJZ); - OPNAMECASE(PSJZP); - OPNAMECASE(PSJNZP); - OPNAMECASE(PSDISP); - OPNAMECASE(PSDISP1); - OPNAMECASE(PSCALA); - OPNAMECASE(PSRETA); - OPNAMECASE(PSCHUFAI); - OPNAMECASE(PSSELFAI); - OPNAMECASE(PSIPRN); - OPNAMECASE(PSFPRN); - OPNAMECASE(PSSPRN); - OPNAMECASE(PSRATRN); - OPNAMECASE(PSRATROS); - OPNAMECASE(PSRATLOD2); - OPNAMECASE(PSRATLOD4); - OPNAMECASE(PSRATLODD); - OPNAMECASE(PSRATLODL); - OPNAMECASE(PSRATLODA); - OPNAMECASE(PSRATLODS); - OPNAMECASE(PSEXPLOD4); - OPNAMECASE(PSEXPLODS); - OPNAMECASE(PSIMPLODNNR); - OPNAMECASE(PSIMPLODSNR); - OPNAMECASE(PSIMPLODNNM); - OPNAMECASE(PSIMPLODSNM); - OPNAMECASE(PSCONTIN); - OPNAMECASE(PSSTEPPED); - default: break; + OPINFO(PSLOD2), + OPINFO(PSLOD4), + OPINFO(PSRLOD2), + OPINFO(PSRLOD4), + OPINFO(PSSTO2), + OPINFO(PSSTO4), + OPINFO(PSPUT2), + OPINFO(PSPUT4), + OPINFO(PSRSTO2), + OPINFO(PSRSTO4), + OPINFO(PSDUP2), + OPINFO(PSDUP4), + OPINFO(PSPOP2), + OPINFO(PSPOP4), + OPINFO(PSFIX2), + OPINFO(PSFIX4), + OPINFO(PSFLOAT2), + OPINFO(PSFLOAT4), + OPINFO(PSSIINT), + OPINFO(PSINTSI), + OPINFO(PSIBOO), + OPINFO(PSSCH), + OPINFO(PSNCN), + OPINFO(PSFINCHES), + OPINFO(PSIDOY), + OPINFO(PSIABS), + OPINFO(PSINEG), + OPINFO(PSIADD), + OPINFO(PSISUB), + OPINFO(PSIMUL), + OPINFO(PSIDIV), + OPINFO(PSIMOD), + OPINFO(PSIDEC), + OPINFO(PSIINC), + OPINFO(PSINOT), + OPINFO(PSIONC), + OPINFO(PSILSH), + OPINFO(PSIRSH), + OPINFO(PSIEQ), + OPINFO(PSINE), + OPINFO(PSILT), + OPINFO(PSILE), + OPINFO(PSIGE), + OPINFO(PSIGT), + OPINFO(PSIBOR), + OPINFO(PSIXOR), + OPINFO(PSIBAN), + OPINFO(PSIBRKT), + OPINFO(PSIMIN), + OPINFO(PSIMAX), + OPINFO(PSFABS), + OPINFO(PSFNEG), + OPINFO(PSFADD), + OPINFO(PSFSUB), + OPINFO(PSFMUL), + OPINFO(PSFDIV), + OPINFO(PSFDEC), + OPINFO(PSFINC), + OPINFO(PSFEQ), + OPINFO(PSFNE), + OPINFO(PSFLT), + OPINFO(PSFLE), + OPINFO(PSFGE), + OPINFO(PSFGT), + OPINFO(PSFBRKT), + OPINFO(PSFMIN), + OPINFO(PSFMAX), + OPINFO(PSFSQRT), + OPINFO(PSFEXP), + OPINFO(PSFPOW), + OPINFO(PSFLOGE), + OPINFO(PSFLOG10), + OPINFO(PSFSIN), + OPINFO(PSFCOS), + OPINFO(PSFTAN), + OPINFO(PSFASIN), + OPINFO(PSFACOS), + OPINFO(PSFATAN), + OPINFO(PSFATAN2), + OPINFO(PSFSIND), + OPINFO(PSFCOSD), + OPINFO(PSFTAND), + OPINFO(PSFASIND), + OPINFO(PSFACOSD), + OPINFO(PSFATAND), + OPINFO(PSFATAN2D), + OPINFO(PSDBWB2W), + OPINFO(PSDBRH2W), + OPINFO(PSDBW2RH), + OPINFO(PSDBW2H), + OPINFO(PSFILEINFO), + OPINFO(PSNOP), + OPINFO(PSJMP), + OPINFO(PSPJZ), + OPINFO(PSJZP), + OPINFO(PSJNZP), + OPINFO(PSDISP), + OPINFO(PSDISP1), + OPINFO(PSCALA), + OPINFO(PSRETA), + OPINFO(PSCHUFAI), + OPINFO(PSSELFAI), + OPINFO(PSIPRN), + OPINFO(PSFPRN), + OPINFO(PSSPRN), + OPINFO(PSRATRN), + OPINFO(PSRATROS), + OPINFO(PSRATLOD2), + OPINFO(PSRATLOD4), + OPINFO(PSRATLODD), + OPINFO(PSRATLODL), + OPINFO(PSRATLODA), + OPINFO(PSRATLODS), + OPINFO(PSEXPLOD4), + OPINFO(PSEXPLODS), + OPINFO(PSIMPLODNNR), + OPINFO(PSIMPLODSNR), + OPINFO(PSIMPLODNNM), + OPINFO(PSIMPLODSNM), + OPINFO(PSCONTIN), + OPINFO(PSSTEPPED) +}; +#undef OPINFO +//----------------------------------------------------------------------------- +static RC CoverageInit() // one-time initialize coverage testing +// returns RCOK if setup is valid +// else RCBAD (msg issued) +{ + RC rc = RCOK; + // VZero(coverageCounts, PSOPE_COUNT); // not needed (static init'd) + // check that covInfo table is well formed + for (int op = 0; op= parStk && parSp->ty==TYNC && argTy==TYFL) // if have number-choice and want float { - EE( cnvPrevSf( 0, PSNCN, 0)) // float it (ie error if a choice). possible? insurance. + EE( cnvPrevSf( 0, PSNCN, 0)) // float it (ie error if a choice). possible? insurance. parSp->ty = TYFL; // konstize may use ty. } else @@ -2743,10 +2743,10 @@ LOCAL RC FC sysVar( SVST *v, USI wanTy) if (v->f & INC) // on option, emit ++ (1-base for user) if (v->ty==TYSI) EE( emit( PSIINC) ) - else if (v->ty==TYFL) - EE( emit( PSFINC) ) - //(else bad table entry) - parSp->ty = v->ty; // set type + else if (v->ty==TYFL) + EE( emit( PSFINC) ) + //(else bad table entry) + parSp->ty = v->ty; // set type } break; } // switch (v->cs) diff --git a/test/expressions.cse b/test/expressions.cse index 5d7e79fa4..a01e11ca6 100644 --- a/test/expressions.cse +++ b/test/expressions.cse @@ -1,9 +1,11 @@ -nSubSteps=20 +nSubSteps=6 #define PI 3.1415927 wfName = "CA_SACRAMENTO-EXECUTIVE-AP_724830S_STYP20.epw" +doCoverage = Yes + // some data to probe GAIN GN1 gnPower=$dayOfYear GAIN GN2 gnPower=$dayOfYear/brkt( 2, $hour, 7) @@ -13,9 +15,12 @@ DELETE REPORT EB REPORT rpType=UDT rpFreq=Year rpTitle="Some one-off tests" REPORTCOL colHead = "FtIn" colVal = 1' 6 == 1.5 ? "Yes" : "No" colWid=4 - REPORTCOL colHead = "GT" colVal = 4.01+1 > abs( -5) ? "Yes" : "No" colWid=4 REPORTCOL colHead = "LT" colVal = 4.01+.5 < min( 6, abs( -5)) ? "Yes" : "No" colWid=4 REPORTCOL colHead = "LE" colVal = sqrt( 16) <= max( 4.1, -2) ? "Yes" : "No" colWid=4 + REPORTCOL colHead = "EQ" colVal = sqrt( 16) == ToFloat( 4) ? "Yes" : "No" colWid=4 + REPORTCOL colHead = "NE" colVal = sqrt( 17) != 4 ? "Yes" : "No" colWid=4 + REPORTCOL colHead = "GE" colVal = 3 >= abs( -3) ? "Yes" : "No" colWid=4 + REPORTCOL colHead = "GT" colVal = !(4.01+1 > abs( -5)) ? "No" : "Yes" colWid=4 ENDREPORT @@ -27,10 +32,41 @@ REPORT rpType=UDT rpFreq=Year rpTitle="FileInfo" REPORTCOL colHead = "Dir" colVal = fileInfo(".") colWid=5 ENDREPORT -REPORT rpType=UDT rpFreq=Day rpTitle="Dates etc" rpDayBeg=Apr 1 rpDayEnd=Apr 15 +REPORT rpType=UDT rpFreq=Day rpTitle="Dates etc" rpDayBeg=Apr 20 rpDayEnd=May 10 + REPORTCOL colHead = "Date" colVal = @Top.dateStr + REPORTCOL colHead = "DOM" colVal = $dayOfMonth colWid=4 REPORTCOL colHead = "DOY" colVal = $dayOfYear colWid=4 + REPORTCOL colHead = "M^Y" colVal = $dayOfMonth^$dayOfYear colWid=4 + REPORTCOL colHead = "M|Y" colVal = $dayOfMonth|$dayOfYear colWid=4 + REPORTCOL colHead = "M&Y" colVal = $dayOfMonth&$dayOfYear colWid=4 REPORTCOL colHead = "DOW1" colVal = fix(abs(-($dayOfYear+3)))%7 + 1 colWid=4 REPORTCOL colHead = "DOW2" colVal = $dayOfWeek colWid=4 + REPORTCOL colHead = "DOW3" colVal = $dayOfYear%7 colWid=4 + REPORTCOL colHead = "!DOW3" colVal = !($dayOfYear%7) colWid=5 + REPORTCOL colHead = "M>W" colVal = $dayOfMonth>$dayOfWeek colWid=4 + REPORTCOL colHead = "MXMW" colVal = max( $dayOfMonth, $dayOfWeek, $dayOfYear) colWid=4 + REPORTCOL colHead = "MMMW" colVal = min( $dayOfMonth, $dayOfWeek, $dayOfYear) colWid=4 + // use select() to force integer logical comparison (avoids float promotion) + REPORTCOL colHead = "LT" colVal = select( $dayOfWeek < $dayOfMonth, "LT", default "--") colWid=4 + REPORTCOL colHead = "LE" colVal = select( $dayOfWeek <= $dayOfMonth, "LE", default "--") colWid=4 + REPORTCOL colHead = "EQ" colVal = select( $dayOfWeek == $dayOfMonth, "EQ", default "--") colWid=4 + REPORTCOL colHead = "NE" colVal = select( $dayOfWeek != $dayOfMonth, "NE", default "--") colWid=4 + REPORTCOL colHead = "GE" colVal = select( $dayOfWeek >= $dayOfMonth, "GE", default "--") colWid=4 + REPORTCOL colHead = "GT" colVal = select( $dayOfWeek > $dayOfMonth, "GT", default "--") colWid=4 + REPORTCOL colHead = "Sel" colVal = Select( $dayOfWeek==1, "Sun", $dayOfWeek == 2, "Mon", $dayofWeek == 3, "Tue", $dayOfWeek == 4, "Wed", + $dayOfWeek == 5, "Thu", $dayOfWeek==6, "Fri", $dayofWeek==7, "Sat", default "Er") colWid = 4 + // choose1 w/ default + REPORTCOL colHead = "Chs1" colVal = choose1( $dayofWeek, "Sun", "Mon", "Tue","Wed", "Thu", "Fri", "Sat") colWid = 4 + // choose1 w/o default + REPORTCOL colHead = "Chs2" colVal = choose1( $dayofWeek, "Sun", "Mon", "Tue", default "Oth") colWid = 4 + // shifts + REPORTCOL colHead = "W>>" colVal = $dayOfWeek >> 1 colWid=4 + REPORTCOL colHead = "W<<" colVal = $dayOfWeek << 1 colWid=4 + // not not + REPORTCOL colHead = "!!" colVal = !!(($dayOfWeek-1)*$dayOfWeek) colWid=4 + // integer divide + REPORTCOL colHead = "W/7" colVal = select( $dayOfWeek/7, "1", default "0") colWid=4 + REPORTCOL colHead = "brkt" colVal = choose( brkt( 3, $dayOfWeek, 5), "Er0","Sun", "Mon", "Tue","Wed", "Thu", "Fri", "Sat", default "ErX") colWid=4 ENDREPORT @@ -47,6 +83,7 @@ REPORT rpType=UDT rpFreq=Hour rpDayBeg=may 1 rpTitle="log/pow/exp + psychro" REPORTCOL colHead = "rh" colVal=rhFromDbW($tDbO,$wO) colWid=6 colDec=4 REPORTCOL colHead = "w2" colVal=wFromDbRh($tDbO,rhFromDbW($tDbO,$wO)) colWid=6 colDec=4 REPORTCOL colHead = "enth" colVal=enthalpy($tDbO,$wO) colWid=6 colDec=2 + REPORTCOL colHead = "brkt" colVal=brkt( 60, $tdbO, 80.) colWid=6 colDec=2 ENDREPORT diff --git a/test/ref/ASHPPKGROOM.REP b/test/ref/ASHPPKGROOM.REP index 8d1064c40..0494e2079 100644 --- a/test/ref/ASHPPKGROOM.REP +++ b/test/ref/ASHPPKGROOM.REP @@ -458,7 +458,7 @@ Top jan1DoW 6 8 16384 0 1 16 nz 0 0 0 wuDays 6 10 16384 0 1 1 nz 0 0 0 nSubSteps 6 11 16384 0 1 1 nz 0 0 0 - nSubhrTicks 6 180 0 0 1 1 0 0 0 0 + nSubhrTicks 6 181 0 0 1 1 0 0 0 0 wfName 6 12 16392 0 3 4 0 0 0 0 TDVfName 6 13 0 0 3 4 0 0 0 0 elevation 6 14 0 0 3 2 0 0 0 0 @@ -514,23 +514,24 @@ Top dbgPrintMask 6 67 0 0 739 32 0 0 0 0 dbgPrintMaskC 6 68 16384 0 1 32 0 0 0 0 dbgFlag 6 69 0 0 1763 32 0 0 0 0 + doCoverage 6 70 0 0 1 16 nz 0 0 0 ventAvail 6 63 0 0 739 16 nz 0 0 0 - auszTol 6 70 0 0 1 2 0 0.005 0 0 - heatDsTDbO 6 71 16384 0 739 2 0 0 0 0 - heatDsTWbO 6 72 0 0 739 2 0 0 0 0 - coolDsMo 6 73 128 0 1 1 0 0 nz 0 - coolDsDay 6 86 16512 0 1 28672 0 0 nz 0 - coolDsCond 6 99 128 0 1 8192 DESCOND 0 0 nz 0 - runSerial 6 118 0 0 1 1 0 0 0 0 - runTitle 6 119 0 0 1 4 0 0 0 0 - repHdrL 6 126 16384 0 1 4 0 0 0 0 - repHdrR 6 127 0 0 1 4 0 0 0 0 - repCpl 6 128 0 0 1 1 nz 0 0 0 - repLpp 6 129 0 0 1 1 nz 0 0 0 - repTopM 6 130 0 0 1 1 nz 0 0 0 - repBotM 6 131 0 0 1 1 nz 0 0 0 - repTestPfx 6 132 0 0 1 4 0 0 0 0 - ck5aa5 6 287 4 0 0 1 nz 0 0 0 + auszTol 6 71 0 0 1 2 0 0.005 0 0 + heatDsTDbO 6 72 16384 0 739 2 0 0 0 0 + heatDsTWbO 6 73 0 0 739 2 0 0 0 0 + coolDsMo 6 74 128 0 1 1 0 0 nz 0 + coolDsDay 6 87 16512 0 1 28672 0 0 nz 0 + coolDsCond 6 100 128 0 1 8192 DESCOND 0 0 nz 0 + runSerial 6 119 0 0 1 1 0 0 0 0 + runTitle 6 120 0 0 1 4 0 0 0 0 + repHdrL 6 127 16384 0 1 4 0 0 0 0 + repHdrR 6 128 0 0 1 4 0 0 0 0 + repCpl 6 129 0 0 1 1 nz 0 0 0 + repLpp 6 130 0 0 1 1 nz 0 0 0 + repTopM 6 131 0 0 1 1 nz 0 0 0 + repBotM 6 132 0 0 1 1 nz 0 0 0 + repTestPfx 6 133 0 0 1 4 0 0 0 0 + ck5aa5 6 288 4 0 0 1 nz 0 0 0 material 5 0 16400 0 0 0 material 0 0 494 0 construction 5 0 16400 0 0 0 construction 0 0 483 0 foundation 5 0 16 0 0 0 foundation 0 0 471 0 @@ -2004,7 +2005,7 @@ inverse Parent: Top ivX 6 6 8 0 1771 2 0 0 0 0 ivY 6 7 8 0 1771 2 0 0 0 0 endInverse 13 0 0 0 0 0 0 0 0 0 -! CSE 0.919.0+airnet-msg-control.ec6c303d.4.dirty for Win32 console +! CSE 0.920.0+expression-coverage.b47a6c09.12.dirty for Win32 console @@ -3567,10 +3568,10 @@ Input for Run 001: -! CSE 0.919.0+airnet-msg-control.ec6c303d.4.dirty for Win32 console run(s) done: Thu 19-Oct-23 10:12:56 am +! CSE 0.920.0+expression-coverage.b47a6c09.12.dirty for Win32 console run(s) done: Sat 02-Dec-23 5:09:30 pm ! Executable: d:\cse\msvc\cse.exe -! 19-Oct-23 10:10 am (VS 14.29 2797568 bytes) (HPWH 1.22.0+HEAD.d205413.4) +! 01-Dec-23 4:54 pm (VS 14.29 2799104 bytes) (HPWH 1.22.0+heat-exchange-models.92d5edf.77) ! Command line: -x! -t1 ashppkgroom ! Input file: D:\cse\test\ashppkgroom.cse ! Report file: D:\CSE\TEST\ASHPPKGROOM.REP @@ -3578,7 +3579,7 @@ Input for Run 001: ! Timing info -- ! Input: Time = 0.10 Calls = 2 T/C = 0.0480 -! AutoSizing: Time = 0.27 Calls = 1 T/C = 0.2700 -! Simulation: Time = 6.61 Calls = 1 T/C = 6.6080 +! AutoSizing: Time = 0.28 Calls = 1 T/C = 0.2800 +! Simulation: Time = 6.56 Calls = 1 T/C = 6.5580 ! Reports: Time = 0.00 Calls = 1 T/C = 0.0020 -! Total: Time = 6.99 Calls = 1 T/C = 6.9850 +! Total: Time = 6.94 Calls = 1 T/C = 6.9430 diff --git a/test/ref/expressions.rep b/test/ref/expressions.rep index bf11e6351..5bbf54657 100644 --- a/test/ref/expressions.rep +++ b/test/ref/expressions.rep @@ -2,9 +2,9 @@ Some one-off tests - FtIn GT LT LE - ---- ---- ---- ---- - Yes Yes Yes Yes + FtIn LT LE EQ NE GE GT + ---- ---- ---- ---- ---- ---- ---- + Yes Yes Yes Yes Yes Yes Yes @@ -18,54 +18,66 @@ FileInfo Dates etc for Apr - DOY DOW1 DOW2 - ---- ---- ---- - 91 4 4 - 92 5 5 - 93 6 6 - 94 7 7 - 95 1 1 - 96 2 2 - 97 3 3 - 98 4 4 - 99 5 5 - 100 6 6 - 101 7 7 - 102 1 1 - 103 2 2 - 104 3 3 - 105 4 4 + Date DOM DOY M^Y M|Y M&Y DOW1 DOW2 DOW3 !DOW3 M>W MXMW MMMW LT LE EQ NE GE GT Sel Chs1 Chs2 W>> W<< !! W/7 brkt + ---------- ---- ---- ---- ---- ---- ---- ---- ---- ----- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- + Mon 20-Apr 20 110 122 126 4 2 2 5 0 1 110 2 LT LE -- NE -- -- Mon Mon Mon 1 4 1 0 Tue + Tue 21-Apr 21 111 122 127 5 3 3 6 0 1 111 3 LT LE -- NE -- -- Tue Tue Tue 1 6 1 0 Tue + Wed 22-Apr 22 112 102 118 16 4 4 0 1 1 112 4 LT LE -- NE -- -- Wed Wed Oth 2 8 1 0 Wed + Thu 23-Apr 23 113 102 119 17 5 5 1 0 1 113 5 LT LE -- NE -- -- Thu Thu Oth 2 10 1 0 Thu + Fri 24-Apr 24 114 106 122 16 6 6 2 0 1 114 6 LT LE -- NE -- -- Fri Fri Oth 3 12 1 0 Thu + Sat 25-Apr 25 115 106 123 17 7 7 3 0 1 115 7 LT LE -- NE -- -- Sat Sat Oth 3 14 1 1 Thu + Sun 26-Apr 26 116 110 126 16 1 1 4 0 1 116 1 LT LE -- NE -- -- Sun Sun Sun 0 2 0 0 Tue + Mon 27-Apr 27 117 110 127 17 2 2 5 0 1 117 2 LT LE -- NE -- -- Mon Mon Mon 1 4 1 0 Tue + Tue 28-Apr 28 118 106 126 20 3 3 6 0 1 118 3 LT LE -- NE -- -- Tue Tue Tue 1 6 1 0 Tue + Wed 29-Apr 29 119 106 127 21 4 4 0 1 1 119 4 LT LE -- NE -- -- Wed Wed Oth 2 8 1 0 Wed + Thu 30-Apr 30 120 102 126 24 5 5 1 0 1 120 5 LT LE -- NE -- -- Thu Thu Oth 2 10 1 0 Thu + + +Dates etc for May + + Date DOM DOY M^Y M|Y M&Y DOW1 DOW2 DOW3 !DOW3 M>W MXMW MMMW LT LE EQ NE GE GT Sel Chs1 Chs2 W>> W<< !! W/7 brkt + ---------- ---- ---- ---- ---- ---- ---- ---- ---- ----- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- + Fri 01-May 1 121 120 121 1 6 6 2 0 0 121 1 -- -- -- NE GE GT Fri Fri Oth 3 12 1 0 Thu + Sat 02-May 2 122 120 122 2 7 7 3 0 0 122 2 -- -- -- NE GE GT Sat Sat Oth 3 14 1 1 Thu + Sun 03-May 3 123 120 123 3 1 1 4 0 1 123 1 LT LE -- NE -- -- Sun Sun Sun 0 2 0 0 Tue + Mon 04-May 4 124 120 124 4 2 2 5 0 1 124 2 LT LE -- NE -- -- Mon Mon Mon 1 4 1 0 Tue + Tue 05-May 5 125 120 125 5 3 3 6 0 1 125 3 LT LE -- NE -- -- Tue Tue Tue 1 6 1 0 Tue + Wed 06-May 6 126 120 126 6 4 4 0 1 1 126 4 LT LE -- NE -- -- Wed Wed Oth 2 8 1 0 Wed + Thu 07-May 7 127 120 127 7 5 5 1 0 1 127 5 LT LE -- NE -- -- Thu Thu Oth 2 10 1 0 Thu + Fri 08-May 8 128 136 136 0 6 6 2 0 1 128 6 LT LE -- NE -- -- Fri Fri Oth 3 12 1 0 Thu + Sat 09-May 9 129 136 137 1 7 7 3 0 1 129 7 LT LE -- NE -- -- Sat Sat Oth 3 14 1 1 Thu + Sun 10-May 10 130 136 138 2 1 1 4 0 1 130 1 LT LE -- NE -- -- Sun Sun Sun 0 2 0 0 Tue log/pow/exp + psychro for Fri 01-May - Hr ExpHr LxHr LP10Hr tDBO tWbO wO w1 rh w2 enth - -- -------- ------ ------ ---------- ------ ------ ------ ------ ------ ------ - 1 .0000167 1.00 1.00 58.640 49.228 .00531 .00531 0.5069 .00531 19.85 - 2 .0000454 2.00 2.00 59.000 50.695 .00599 .00599 0.5633 .00599 20.67 - 3 .0001234 3.00 3.00 57.740 50.462 .00615 .00615 0.6052 .00615 20.54 - 4 .0003355 4.00 4.00 61.340 51.806 .00603 .00603 0.5215 .00603 21.28 - 5 .0009119 5.00 5.00 60.080 52.186 .00652 .00652 0.5902 .00652 21.51 - 6 0.002479 6.00 6.00 60.800 52.971 .00679 .00679 0.5984 .00679 21.98 - 7 0.006738 7.00 7.00 60.440 52.578 .00665 .00665 0.5944 .00665 21.74 - 8 0.01832 8.00 8.00 63.500 54.078 .00679 .00679 0.5442 .00679 22.63 - 9 0.04979 9.00 9.00 68.540 55.326 .00633 .00633 0.4266 .00633 23.36 - 10 0.1353 10.00 10.00 73.580 57.288 .00633 .00633 0.3591 .00633 24.59 - 11 0.3679 11.00 11.00 77.540 58.638 .00624 .00624 0.3103 .00624 25.45 - 12 1.0000 12.00 12.00 82.220 59.322 .00559 .00559 0.2387 .00559 25.87 - 13 2.7183 13.00 13.00 84.200 59.242 .00510 .00510 0.2045 .00510 25.80 - 14 7.3891 14.00 14.00 86.180 60.943 .00571 .00571 0.2146 .00571 26.96 - 15 20.0855 15.00 15.00 87.260 61.626 .00591 .00591 0.2146 .00591 27.44 - 16 54.5981 16.00 16.00 88.160 62.459 .00624 .00624 0.2205 .00624 28.03 - 17 148.4132 17.00 17.00 88.880 63.409 .00670 .00670 0.2308 .00670 28.70 - 18 403.4288 18.00 18.00 88.520 63.913 .00711 .00711 0.2476 .00711 29.06 - 19 1096.633 19.00 19.00 87.800 63.821 .00721 .00721 0.2571 .00721 29.00 - 20 2980.958 20.00 20.00 85.460 64.183 .00799 .00799 0.3062 .00799 29.29 - 21 8103.084 21.00 21.00 81.680 62.876 .00799 .00799 0.3458 .00799 28.37 - 22 22026.46 22.00 22.00 78.620 61.885 .00804 .00804 0.3847 .00804 27.68 - 23 59874.14 23.00 23.00 75.740 61.739 .00861 .00861 0.4530 .00861 27.60 - 24 162754.8 24.00 24.00 73.760 61.046 .00861 .00861 0.4832 .00861 27.12 + Hr ExpHr LxHr LP10Hr tDBO tWbO wO w1 rh w2 enth brkt + -- -------- ------ ------ ---------- ------ ------ ------ ------ ------ ------ ------ + 1 .0000167 1.00 1.00 58.640 49.228 .00531 .00531 0.5069 .00531 19.85 60.00 + 2 .0000454 2.00 2.00 59.000 50.695 .00599 .00599 0.5633 .00599 20.67 60.00 + 3 .0001234 3.00 3.00 57.740 50.462 .00615 .00615 0.6052 .00615 20.54 60.00 + 4 .0003355 4.00 4.00 61.340 51.806 .00603 .00603 0.5215 .00603 21.28 61.34 + 5 .0009119 5.00 5.00 60.080 52.186 .00652 .00652 0.5902 .00652 21.51 60.08 + 6 0.002479 6.00 6.00 60.800 52.971 .00679 .00679 0.5984 .00679 21.98 60.80 + 7 0.006738 7.00 7.00 60.440 52.578 .00665 .00665 0.5944 .00665 21.74 60.44 + 8 0.01832 8.00 8.00 63.500 54.078 .00679 .00679 0.5442 .00679 22.63 63.50 + 9 0.04979 9.00 9.00 68.540 55.326 .00633 .00633 0.4266 .00633 23.36 68.54 + 10 0.1353 10.00 10.00 73.580 57.288 .00633 .00633 0.3591 .00633 24.59 73.58 + 11 0.3679 11.00 11.00 77.540 58.638 .00624 .00624 0.3103 .00624 25.45 77.54 + 12 1.0000 12.00 12.00 82.220 59.322 .00559 .00559 0.2387 .00559 25.87 80.00 + 13 2.7183 13.00 13.00 84.200 59.242 .00510 .00510 0.2045 .00510 25.80 80.00 + 14 7.3891 14.00 14.00 86.180 60.943 .00571 .00571 0.2146 .00571 26.96 80.00 + 15 20.0855 15.00 15.00 87.260 61.626 .00591 .00591 0.2146 .00591 27.44 80.00 + 16 54.5981 16.00 16.00 88.160 62.459 .00624 .00624 0.2205 .00624 28.03 80.00 + 17 148.4132 17.00 17.00 88.880 63.409 .00670 .00670 0.2308 .00670 28.70 80.00 + 18 403.4288 18.00 18.00 88.520 63.913 .00711 .00711 0.2476 .00711 29.06 80.00 + 19 1096.633 19.00 19.00 87.800 63.821 .00721 .00721 0.2571 .00721 29.00 80.00 + 20 2980.958 20.00 20.00 85.460 64.183 .00799 .00799 0.3062 .00799 29.29 80.00 + 21 8103.084 21.00 21.00 81.680 62.876 .00799 .00799 0.3458 .00799 28.37 80.00 + 22 22026.46 22.00 22.00 78.620 61.885 .00804 .00804 0.3847 .00804 27.68 78.62 + 23 59874.14 23.00 23.00 75.740 61.739 .00861 .00861 0.4530 .00861 27.60 75.74 + 24 162754.8 24.00 24.00 73.760 61.046 .00861 .00861 0.4832 .00861 27.12 73.76 @@ -133,18 +145,150 @@ Probes for Fri 01-May ! Log for Run 001: -! CSE 0.920.0+expression-coverage.4b9ea9a3.9 for Win32 console +! CSE 0.920.0+expression-coverage.b47a6c09.12.dirty for Win32 console + + +Expression Coverage + +PSNUL 0 +PSEND 332671 +PSKON2 5661 +PSKON4 678932 +PSPKONN 4095 +PSLOD2 320665 +PSLOD4 116064 +PSRLOD2 0 +PSRLOD4 0 +PSSTO2 0 +PSSTO4 0 +PSPUT2 0 +PSPUT4 0 +PSRSTO2 0 +PSRSTO4 0 +PSDUP2 0 +PSDUP4 0 +PSPOP2 0 +PSPOP4 0 +PSFIX2 0 +PSFIX4 0 +PSFLOAT2 312183 +PSFLOAT4 0 +PSSIINT 0 +PSINTSI 0 +PSIBOO 0 +PSSCH 0 +PSNCN 0 +PSFINCHES 1 +PSIDOY 5 +PSIABS 373 +PSINEG 373 +PSIADD 372 +PSISUB 372 +PSIMUL 372 +PSIDIV 372 +PSIMOD 1116 +PSIDEC 0 +PSIINC 302809 +PSINOT 1117 +PSIONC 0 +PSILSH 372 +PSIRSH 372 +PSIEQ 1861 +PSINE 372 +PSILT 372 +PSILE 372 +PSIGE 372 +PSIGT 372 +PSIBOR 372 +PSIXOR 372 +PSIBAN 372 +PSIBRKT 372 +PSIMIN 0 +PSIMAX 0 +PSFABS 2 +PSFNEG 3 +PSFADD 18230 +PSFSUB 241056 +PSFMUL 232128 +PSFDIV 151776 +PSFDEC 0 +PSFINC 0 +PSFEQ 2 +PSFNE 1 +PSFLT 1 +PSFLE 1 +PSFGE 1 +PSFGT 373 +PSFBRKT 17856 +PSFMIN 745 +PSFMAX 745 +PSFSQRT 3 +PSFEXP 17856 +PSFPOW 44640 +PSFLOGE 8928 +PSFLOG10 8928 +PSFSIN 44640 +PSFCOS 44640 +PSFTAN 26784 +PSFASIN 8928 +PSFACOS 8928 +PSFATAN 8928 +PSFATAN2 8928 +PSFSIND 44640 +PSFCOSD 44640 +PSFTAND 8928 +PSFASIND 8928 +PSFACOSD 8928 +PSFATAND 8928 +PSFATAN2D 8928 +PSDBWB2W 8928 +PSDBRH2W 8928 +PSDBW2RH 17856 +PSDBW2H 8928 +PSFILEINFO 4 +PSNOP 3082 +PSJMP 2444 +PSPJZ 4093 +PSJZP 0 +PSJNZP 0 +PSDISP 372 +PSDISP1 744 +PSCALA 0 +PSRETA 0 +PSCHUFAI 0 +PSSELFAI 0 +PSIPRN 0 +PSFPRN 0 +PSSPRN 0 +PSRATRN 373 +PSRATROS 0 +PSRATLOD2 0 +PSRATLOD4 0 +PSRATLODD 0 +PSRATLODL 0 +PSRATLODA 0 +PSRATLODS 373 +PSEXPLOD4 9300 +PSEXPLODS 0 +PSIMPLODNNR 0 +PSIMPLODSNR 0 +PSIMPLODNNM 0 +PSIMPLODSNM 0 +PSCONTIN 0 +PSSTEPPED 0 Input for Run 001: - nSubSteps=20 + nSubSteps=6 # #define PI 3.1415927 wfName = "CA_SACRAMENTO-EXECUTIVE-AP_724830S_STYP20.epw" + doCoverage = Yes + // some data to probe GAIN GN1 gnPower=$dayOfYear GAIN GN2 gnPower=$dayOfYear/brkt( 2, $hour, 7) @@ -154,9 +298,12 @@ Input for Run 001: REPORT rpType=UDT rpFreq=Year rpTitle="Some one-off tests" REPORTCOL colHead = "FtIn" colVal = 1' 6 == 1.5 ? "Yes" : "No" colWid=4 - REPORTCOL colHead = "GT" colVal = 4.01+1 > abs( -5) ? "Yes" : "No" colWid=4 REPORTCOL colHead = "LT" colVal = 4.01+.5 < min( 6, abs( -5)) ? "Yes" : "No" colWid=4 REPORTCOL colHead = "LE" colVal = sqrt( 16) <= max( 4.1, -2) ? "Yes" : "No" colWid=4 + REPORTCOL colHead = "EQ" colVal = sqrt( 16) == ToFloat( 4) ? "Yes" : "No" colWid=4 + REPORTCOL colHead = "NE" colVal = sqrt( 17) != 4 ? "Yes" : "No" colWid=4 + REPORTCOL colHead = "GE" colVal = 3 >= abs( -3) ? "Yes" : "No" colWid=4 + REPORTCOL colHead = "GT" colVal = !(4.01+1 > abs( -5)) ? "No" : "Yes" colWid=4 ENDREPORT @@ -168,10 +315,41 @@ Input for Run 001: REPORTCOL colHead = "Dir" colVal = fileInfo(".") colWid=5 ENDREPORT - REPORT rpType=UDT rpFreq=Day rpTitle="Dates etc" rpDayBeg=Apr 1 rpDayEnd=Apr 15 + REPORT rpType=UDT rpFreq=Day rpTitle="Dates etc" rpDayBeg=Apr 20 rpDayEnd=May 10 + REPORTCOL colHead = "Date" colVal = @Top.dateStr + REPORTCOL colHead = "DOM" colVal = $dayOfMonth colWid=4 REPORTCOL colHead = "DOY" colVal = $dayOfYear colWid=4 + REPORTCOL colHead = "M^Y" colVal = $dayOfMonth^$dayOfYear colWid=4 + REPORTCOL colHead = "M|Y" colVal = $dayOfMonth|$dayOfYear colWid=4 + REPORTCOL colHead = "M&Y" colVal = $dayOfMonth&$dayOfYear colWid=4 REPORTCOL colHead = "DOW1" colVal = fix(abs(-($dayOfYear+3)))%7 + 1 colWid=4 REPORTCOL colHead = "DOW2" colVal = $dayOfWeek colWid=4 + REPORTCOL colHead = "DOW3" colVal = $dayOfYear%7 colWid=4 + REPORTCOL colHead = "!DOW3" colVal = !($dayOfYear%7) colWid=5 + REPORTCOL colHead = "M>W" colVal = $dayOfMonth>$dayOfWeek colWid=4 + REPORTCOL colHead = "MXMW" colVal = max( $dayOfMonth, $dayOfWeek, $dayOfYear) colWid=4 + REPORTCOL colHead = "MMMW" colVal = min( $dayOfMonth, $dayOfWeek, $dayOfYear) colWid=4 + // use select() to force integer logical comparison (avoids float promotion) + REPORTCOL colHead = "LT" colVal = select( $dayOfWeek < $dayOfMonth, "LT", default "--") colWid=4 + REPORTCOL colHead = "LE" colVal = select( $dayOfWeek <= $dayOfMonth, "LE", default "--") colWid=4 + REPORTCOL colHead = "EQ" colVal = select( $dayOfWeek == $dayOfMonth, "EQ", default "--") colWid=4 + REPORTCOL colHead = "NE" colVal = select( $dayOfWeek != $dayOfMonth, "NE", default "--") colWid=4 + REPORTCOL colHead = "GE" colVal = select( $dayOfWeek >= $dayOfMonth, "GE", default "--") colWid=4 + REPORTCOL colHead = "GT" colVal = select( $dayOfWeek > $dayOfMonth, "GT", default "--") colWid=4 + REPORTCOL colHead = "Sel" colVal = Select( $dayOfWeek==1, "Sun", $dayOfWeek == 2, "Mon", $dayofWeek == 3, "Tue", $dayOfWeek == 4, "Wed", + $dayOfWeek == 5, "Thu", $dayOfWeek==6, "Fri", $dayofWeek==7, "Sat", default "Er") colWid = 4 + // choose1 w/ default + REPORTCOL colHead = "Chs1" colVal = choose1( $dayofWeek, "Sun", "Mon", "Tue","Wed", "Thu", "Fri", "Sat") colWid = 4 + // choose1 w/o default + REPORTCOL colHead = "Chs2" colVal = choose1( $dayofWeek, "Sun", "Mon", "Tue", default "Oth") colWid = 4 + // shifts + REPORTCOL colHead = "W>>" colVal = $dayOfWeek >> 1 colWid=4 + REPORTCOL colHead = "W<<" colVal = $dayOfWeek << 1 colWid=4 + // not not + REPORTCOL colHead = "!!" colVal = !!(($dayOfWeek-1)*$dayOfWeek) colWid=4 + // integer divide + REPORTCOL colHead = "W/7" colVal = select( $dayOfWeek/7, "1", default "0") colWid=4 + REPORTCOL colHead = "brkt" colVal = choose( brkt( 3, $dayOfWeek, 5), "Er0","Sun", "Mon", "Tue","Wed", "Thu", "Fri", "Sat", default "ErX") colWid=4 ENDREPORT @@ -188,6 +366,7 @@ Input for Run 001: REPORTCOL colHead = "rh" colVal=rhFromDbW($tDbO,$wO) colWid=6 colDec=4 REPORTCOL colHead = "w2" colVal=wFromDbRh($tDbO,rhFromDbW($tDbO,$wO)) colWid=6 colDec=4 REPORTCOL colHead = "enth" colVal=enthalpy($tDbO,$wO) colWid=6 colDec=2 + REPORTCOL colHead = "brkt" colVal=brkt( 60, $tdbO, 80.) colWid=6 colDec=2 ENDREPORT @@ -234,18 +413,18 @@ Input for Run 001: -! CSE 0.920.0+expression-coverage.4b9ea9a3.9 for Win32 console run(s) done: Tue 28-Nov-23 4:11:12 pm +! CSE 0.920.0+expression-coverage.b47a6c09.12.dirty for Win32 console run(s) done: Sat 02-Dec-23 5:02:33 pm ! Executable: d:\cse\msvc\cse.exe -! 28-Nov-23 2:16 pm (VS 14.29 2798592 bytes) (HPWH 1.22.0+HEAD.92d5edf.77) +! 01-Dec-23 4:54 pm (VS 14.29 2799104 bytes) (HPWH 1.22.0+heat-exchange-models.92d5edf.77) ! Command line: -x! -t1 expressions ! Input file: D:\cse\test\expressions.cse ! Report file: D:\CSE\TEST\EXPRESSIONS.REP ! Timing info -- -! Input: Time = 0.05 Calls = 1 T/C = 0.0480 +! Input: Time = 0.05 Calls = 1 T/C = 0.0510 ! AutoSizing: Time = 0.00 Calls = 0 T/C = 0.0000 -! Simulation: Time = 0.30 Calls = 1 T/C = 0.3020 +! Simulation: Time = 0.17 Calls = 1 T/C = 0.1680 ! Reports: Time = 0.00 Calls = 1 T/C = 0.0000 -! Total: Time = 0.35 Calls = 1 T/C = 0.3520 +! Total: Time = 0.22 Calls = 1 T/C = 0.2210 From 63b39acc2c06e5a8c633f80dec8c928e39a56e6e Mon Sep 17 00:00:00 2001 From: Chip Barnaby Date: Thu, 7 Dec 2023 11:29:54 -0500 Subject: [PATCH 12/13] Coverage extension --- test/expressions.cse | 2 ++ test/ref/expressions.rep | 76 +++++++++++++++++++++------------------- 2 files changed, 41 insertions(+), 37 deletions(-) diff --git a/test/expressions.cse b/test/expressions.cse index a01e11ca6..6a14e3969 100644 --- a/test/expressions.cse +++ b/test/expressions.cse @@ -64,6 +64,8 @@ REPORT rpType=UDT rpFreq=Day rpTitle="Dates etc" rpDayBeg=Apr 20 rpDayEnd=May 1 REPORTCOL colHead = "W<<" colVal = $dayOfWeek << 1 colWid=4 // not not REPORTCOL colHead = "!!" colVal = !!(($dayOfWeek-1)*$dayOfWeek) colWid=4 + // complement + REPORTCOL colHead = "~" colVal = ~$dayOfWeek colWid=4 // integer divide REPORTCOL colHead = "W/7" colVal = select( $dayOfWeek/7, "1", default "0") colWid=4 REPORTCOL colHead = "brkt" colVal = choose( brkt( 3, $dayOfWeek, 5), "Er0","Sun", "Mon", "Tue","Wed", "Thu", "Fri", "Sat", default "ErX") colWid=4 diff --git a/test/ref/expressions.rep b/test/ref/expressions.rep index 5bbf54657..524929c73 100644 --- a/test/ref/expressions.rep +++ b/test/ref/expressions.rep @@ -18,35 +18,35 @@ FileInfo Dates etc for Apr - Date DOM DOY M^Y M|Y M&Y DOW1 DOW2 DOW3 !DOW3 M>W MXMW MMMW LT LE EQ NE GE GT Sel Chs1 Chs2 W>> W<< !! W/7 brkt - ---------- ---- ---- ---- ---- ---- ---- ---- ---- ----- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- - Mon 20-Apr 20 110 122 126 4 2 2 5 0 1 110 2 LT LE -- NE -- -- Mon Mon Mon 1 4 1 0 Tue - Tue 21-Apr 21 111 122 127 5 3 3 6 0 1 111 3 LT LE -- NE -- -- Tue Tue Tue 1 6 1 0 Tue - Wed 22-Apr 22 112 102 118 16 4 4 0 1 1 112 4 LT LE -- NE -- -- Wed Wed Oth 2 8 1 0 Wed - Thu 23-Apr 23 113 102 119 17 5 5 1 0 1 113 5 LT LE -- NE -- -- Thu Thu Oth 2 10 1 0 Thu - Fri 24-Apr 24 114 106 122 16 6 6 2 0 1 114 6 LT LE -- NE -- -- Fri Fri Oth 3 12 1 0 Thu - Sat 25-Apr 25 115 106 123 17 7 7 3 0 1 115 7 LT LE -- NE -- -- Sat Sat Oth 3 14 1 1 Thu - Sun 26-Apr 26 116 110 126 16 1 1 4 0 1 116 1 LT LE -- NE -- -- Sun Sun Sun 0 2 0 0 Tue - Mon 27-Apr 27 117 110 127 17 2 2 5 0 1 117 2 LT LE -- NE -- -- Mon Mon Mon 1 4 1 0 Tue - Tue 28-Apr 28 118 106 126 20 3 3 6 0 1 118 3 LT LE -- NE -- -- Tue Tue Tue 1 6 1 0 Tue - Wed 29-Apr 29 119 106 127 21 4 4 0 1 1 119 4 LT LE -- NE -- -- Wed Wed Oth 2 8 1 0 Wed - Thu 30-Apr 30 120 102 126 24 5 5 1 0 1 120 5 LT LE -- NE -- -- Thu Thu Oth 2 10 1 0 Thu + Date DOM DOY M^Y M|Y M&Y DOW1 DOW2 DOW3 !DOW3 M>W MXMW MMMW LT LE EQ NE GE GT Sel Chs1 Chs2 W>> W<< !! ~ W/7 brkt + ---------- ---- ---- ---- ---- ---- ---- ---- ---- ----- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- + Mon 20-Apr 20 110 122 126 4 2 2 5 0 1 110 2 LT LE -- NE -- -- Mon Mon Mon 1 4 1 -3 0 Tue + Tue 21-Apr 21 111 122 127 5 3 3 6 0 1 111 3 LT LE -- NE -- -- Tue Tue Tue 1 6 1 -4 0 Tue + Wed 22-Apr 22 112 102 118 16 4 4 0 1 1 112 4 LT LE -- NE -- -- Wed Wed Oth 2 8 1 -5 0 Wed + Thu 23-Apr 23 113 102 119 17 5 5 1 0 1 113 5 LT LE -- NE -- -- Thu Thu Oth 2 10 1 -6 0 Thu + Fri 24-Apr 24 114 106 122 16 6 6 2 0 1 114 6 LT LE -- NE -- -- Fri Fri Oth 3 12 1 -7 0 Thu + Sat 25-Apr 25 115 106 123 17 7 7 3 0 1 115 7 LT LE -- NE -- -- Sat Sat Oth 3 14 1 -8 1 Thu + Sun 26-Apr 26 116 110 126 16 1 1 4 0 1 116 1 LT LE -- NE -- -- Sun Sun Sun 0 2 0 -2 0 Tue + Mon 27-Apr 27 117 110 127 17 2 2 5 0 1 117 2 LT LE -- NE -- -- Mon Mon Mon 1 4 1 -3 0 Tue + Tue 28-Apr 28 118 106 126 20 3 3 6 0 1 118 3 LT LE -- NE -- -- Tue Tue Tue 1 6 1 -4 0 Tue + Wed 29-Apr 29 119 106 127 21 4 4 0 1 1 119 4 LT LE -- NE -- -- Wed Wed Oth 2 8 1 -5 0 Wed + Thu 30-Apr 30 120 102 126 24 5 5 1 0 1 120 5 LT LE -- NE -- -- Thu Thu Oth 2 10 1 -6 0 Thu Dates etc for May - Date DOM DOY M^Y M|Y M&Y DOW1 DOW2 DOW3 !DOW3 M>W MXMW MMMW LT LE EQ NE GE GT Sel Chs1 Chs2 W>> W<< !! W/7 brkt - ---------- ---- ---- ---- ---- ---- ---- ---- ---- ----- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- - Fri 01-May 1 121 120 121 1 6 6 2 0 0 121 1 -- -- -- NE GE GT Fri Fri Oth 3 12 1 0 Thu - Sat 02-May 2 122 120 122 2 7 7 3 0 0 122 2 -- -- -- NE GE GT Sat Sat Oth 3 14 1 1 Thu - Sun 03-May 3 123 120 123 3 1 1 4 0 1 123 1 LT LE -- NE -- -- Sun Sun Sun 0 2 0 0 Tue - Mon 04-May 4 124 120 124 4 2 2 5 0 1 124 2 LT LE -- NE -- -- Mon Mon Mon 1 4 1 0 Tue - Tue 05-May 5 125 120 125 5 3 3 6 0 1 125 3 LT LE -- NE -- -- Tue Tue Tue 1 6 1 0 Tue - Wed 06-May 6 126 120 126 6 4 4 0 1 1 126 4 LT LE -- NE -- -- Wed Wed Oth 2 8 1 0 Wed - Thu 07-May 7 127 120 127 7 5 5 1 0 1 127 5 LT LE -- NE -- -- Thu Thu Oth 2 10 1 0 Thu - Fri 08-May 8 128 136 136 0 6 6 2 0 1 128 6 LT LE -- NE -- -- Fri Fri Oth 3 12 1 0 Thu - Sat 09-May 9 129 136 137 1 7 7 3 0 1 129 7 LT LE -- NE -- -- Sat Sat Oth 3 14 1 1 Thu - Sun 10-May 10 130 136 138 2 1 1 4 0 1 130 1 LT LE -- NE -- -- Sun Sun Sun 0 2 0 0 Tue + Date DOM DOY M^Y M|Y M&Y DOW1 DOW2 DOW3 !DOW3 M>W MXMW MMMW LT LE EQ NE GE GT Sel Chs1 Chs2 W>> W<< !! ~ W/7 brkt + ---------- ---- ---- ---- ---- ---- ---- ---- ---- ----- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- + Fri 01-May 1 121 120 121 1 6 6 2 0 0 121 1 -- -- -- NE GE GT Fri Fri Oth 3 12 1 -7 0 Thu + Sat 02-May 2 122 120 122 2 7 7 3 0 0 122 2 -- -- -- NE GE GT Sat Sat Oth 3 14 1 -8 1 Thu + Sun 03-May 3 123 120 123 3 1 1 4 0 1 123 1 LT LE -- NE -- -- Sun Sun Sun 0 2 0 -2 0 Tue + Mon 04-May 4 124 120 124 4 2 2 5 0 1 124 2 LT LE -- NE -- -- Mon Mon Mon 1 4 1 -3 0 Tue + Tue 05-May 5 125 120 125 5 3 3 6 0 1 125 3 LT LE -- NE -- -- Tue Tue Tue 1 6 1 -4 0 Tue + Wed 06-May 6 126 120 126 6 4 4 0 1 1 126 4 LT LE -- NE -- -- Wed Wed Oth 2 8 1 -5 0 Wed + Thu 07-May 7 127 120 127 7 5 5 1 0 1 127 5 LT LE -- NE -- -- Thu Thu Oth 2 10 1 -6 0 Thu + Fri 08-May 8 128 136 136 0 6 6 2 0 1 128 6 LT LE -- NE -- -- Fri Fri Oth 3 12 1 -7 0 Thu + Sat 09-May 9 129 136 137 1 7 7 3 0 1 129 7 LT LE -- NE -- -- Sat Sat Oth 3 14 1 -8 1 Thu + Sun 10-May 10 130 136 138 2 1 1 4 0 1 130 1 LT LE -- NE -- -- Sun Sun Sun 0 2 0 -2 0 Tue @@ -145,17 +145,17 @@ Probes for Fri 01-May ! Log for Run 001: -! CSE 0.920.0+expression-coverage.b47a6c09.12.dirty for Win32 console +! CSE 0.920.0+expression-coverage.37212830.13.dirty for Win32 console Expression Coverage PSNUL 0 -PSEND 332671 +PSEND 333043 PSKON2 5661 PSKON4 678932 PSPKONN 4095 -PSLOD2 320665 +PSLOD2 321037 PSLOD4 116064 PSRLOD2 0 PSRLOD4 0 @@ -171,7 +171,7 @@ PSPOP2 0 PSPOP4 0 PSFIX2 0 PSFIX4 0 -PSFLOAT2 312183 +PSFLOAT2 312555 PSFLOAT4 0 PSSIINT 0 PSINTSI 0 @@ -188,9 +188,9 @@ PSIMUL 372 PSIDIV 372 PSIMOD 1116 PSIDEC 0 -PSIINC 302809 +PSIINC 303181 PSINOT 1117 -PSIONC 0 +PSIONC 372 PSILSH 372 PSIRSH 372 PSIEQ 1861 @@ -347,6 +347,8 @@ Input for Run 001: REPORTCOL colHead = "W<<" colVal = $dayOfWeek << 1 colWid=4 // not not REPORTCOL colHead = "!!" colVal = !!(($dayOfWeek-1)*$dayOfWeek) colWid=4 + // complement + REPORTCOL colHead = "~" colVal = ~$dayOfWeek colWid=4 // integer divide REPORTCOL colHead = "W/7" colVal = select( $dayOfWeek/7, "1", default "0") colWid=4 REPORTCOL colHead = "brkt" colVal = choose( brkt( 3, $dayOfWeek, 5), "Er0","Sun", "Mon", "Tue","Wed", "Thu", "Fri", "Sat", default "ErX") colWid=4 @@ -413,18 +415,18 @@ Input for Run 001: -! CSE 0.920.0+expression-coverage.b47a6c09.12.dirty for Win32 console run(s) done: Sat 02-Dec-23 5:02:33 pm +! CSE 0.920.0+expression-coverage.37212830.13.dirty for Win32 console run(s) done: Thu 07-Dec-23 11:27:42 am ! Executable: d:\cse\msvc\cse.exe -! 01-Dec-23 4:54 pm (VS 14.29 2799104 bytes) (HPWH 1.22.0+heat-exchange-models.92d5edf.77) +! 03-Dec-23 3:32 pm (VS 14.29 2799104 bytes) (HPWH 1.22.0+heat-exchange-models.92d5edf.77) ! Command line: -x! -t1 expressions ! Input file: D:\cse\test\expressions.cse ! Report file: D:\CSE\TEST\EXPRESSIONS.REP ! Timing info -- -! Input: Time = 0.05 Calls = 1 T/C = 0.0510 +! Input: Time = 0.06 Calls = 1 T/C = 0.0630 ! AutoSizing: Time = 0.00 Calls = 0 T/C = 0.0000 -! Simulation: Time = 0.17 Calls = 1 T/C = 0.1680 -! Reports: Time = 0.00 Calls = 1 T/C = 0.0000 -! Total: Time = 0.22 Calls = 1 T/C = 0.2210 +! Simulation: Time = 0.19 Calls = 1 T/C = 0.1910 +! Reports: Time = 0.00 Calls = 1 T/C = 0.0010 +! Total: Time = 0.26 Calls = 1 T/C = 0.2580 From 120a9c90a3df158c652433fa799add990ae0a378 Mon Sep 17 00:00:00 2001 From: Chip Barnaby Date: Wed, 10 Jan 2024 09:59:27 -0500 Subject: [PATCH 13/13] Merge from main --- test/ref/ASHPPKGROOM.REP | 42 ++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/test/ref/ASHPPKGROOM.REP b/test/ref/ASHPPKGROOM.REP index 47fe844c2..c8a388464 100644 --- a/test/ref/ASHPPKGROOM.REP +++ b/test/ref/ASHPPKGROOM.REP @@ -9,7 +9,7 @@ Info: Zone 'Conditioned-zn': Temp control outcomes Cooling 81.2 0.52 1.80 8.7 --------------- Warning: Zone 'Attic-atc': Condensation occurred in 1861 subhours of run. - Total condensation heat = 28.6412 kBtu. + Total condensation heat = 28.6419 kBtu. --------------- @@ -1304,13 +1304,13 @@ dhwheater Parent: dhwsys whLDEF 6 36 0 0 1 2 0 1 0 0 whEff 6 45 0 0 1 2 0 1 0 0 whSBL 6 46 0 0 1 2 0 0 0 0 - whFAdjElec 6 98 0 0 1763 2 0 1 0 0 - whFAdjFuel 6 99 0 0 1763 2 0 1 0 0 + whFAdjElec 6 97 0 0 1763 2 0 1 0 0 + whFAdjFuel 6 98 0 0 1763 2 0 1 0 0 whPilotPwr 6 47 0 0 739 2 0 0 0 0 whParElec 6 48 0 0 739 2 0 0 0 0 - whElecMtr 6 110 0 0 1 8192 meter 0 0 0 0 - whFuelMtr 6 111 0 0 1 8192 meter 0 0 0 0 - whxBUEndUse 6 112 0 0 1 16 nz 0 0 0 + whElecMtr 6 109 0 0 1 8192 meter 0 0 0 0 + whFuelMtr 6 110 0 0 1 8192 meter 0 0 0 0 + whxBUEndUse 6 111 0 0 1 16 nz 0 0 0 endDHWHEATER 13 0 0 0 0 0 0 0 0 0 @@ -1350,13 +1350,13 @@ dhwloopheater Parent: dhwsys whLDEF 6 36 0 0 1 2 0 1 0 0 whEff 6 45 0 0 1 2 0 1 0 0 whSBL 6 46 0 0 1 2 0 0 0 0 - whFAdjElec 6 98 0 0 1763 2 0 1 0 0 - whFAdjFuel 6 99 0 0 1763 2 0 1 0 0 + whFAdjElec 6 97 0 0 1763 2 0 1 0 0 + whFAdjFuel 6 98 0 0 1763 2 0 1 0 0 whPilotPwr 6 47 0 0 739 2 0 0 0 0 whParElec 6 48 0 0 739 2 0 0 0 0 - whElecMtr 6 110 0 0 1 8192 meter 0 0 0 0 - whFuelMtr 6 111 0 0 1 8192 meter 0 0 0 0 - whxBUEndUse 6 112 0 0 1 16 nz 0 0 0 + whElecMtr 6 109 0 0 1 8192 meter 0 0 0 0 + whFuelMtr 6 110 0 0 1 8192 meter 0 0 0 0 + whxBUEndUse 6 111 0 0 1 16 nz 0 0 0 endDHWHEATER 13 0 0 0 0 0 0 0 0 0 @@ -2005,7 +2005,7 @@ inverse Parent: Top ivX 6 6 8 0 1771 2 0 0 0 0 ivY 6 7 8 0 1771 2 0 0 0 0 endInverse 13 0 0 0 0 0 0 0 0 0 -! CSE 0.920.0+expression-coverage.63b39acc.14 for Win32 console +! CSE 0.920.0+expression-coverage.cd8c3efc.75 for Win32 console @@ -3568,18 +3568,18 @@ Input for Run 001: -! CSE 0.920.0+expression-coverage.63b39acc.14 for Win32 console run(s) done: Tue 09-Jan-24 2:26:24 pm +! CSE 0.920.0+expression-coverage.cd8c3efc.75 for Win32 console run(s) done: Wed 10-Jan-24 9:57:03 am ! Executable: d:\cse\msvc\cse.exe -! 09-Jan-24 2:25 pm (VS 14.29 2799104 bytes) (HPWH 1.22.0+HEAD.92d5edf.77) -! Command line: -x! -b -t1 ashpPkgRoom -! Input file: D:\cse\test\ashpPkgRoom.cse +! 10-Jan-24 9:54 am (VS 14.29 2885632 bytes) (HPWH 1.22.0+HEAD.1696156.200) +! Command line: -x! -t1 ashppkgroom +! Input file: D:\cse\test\ashppkgroom.cse ! Report file: D:\CSE\TEST\ASHPPKGROOM.REP ! Timing info -- -! Input: Time = 0.12 Calls = 2 T/C = 0.0600 -! AutoSizing: Time = 0.38 Calls = 1 T/C = 0.3780 -! Simulation: Time = 7.77 Calls = 1 T/C = 7.7670 -! Reports: Time = 0.00 Calls = 1 T/C = 0.0030 -! Total: Time = 8.28 Calls = 1 T/C = 8.2750 +! Input: Time = 0.09 Calls = 2 T/C = 0.0470 +! AutoSizing: Time = 0.27 Calls = 1 T/C = 0.2710 +! Simulation: Time = 6.52 Calls = 1 T/C = 6.5210 +! Reports: Time = 0.00 Calls = 1 T/C = 0.0020 +! Total: Time = 6.89 Calls = 1 T/C = 6.8940