Skip to content

Commit

Permalink
nocr3
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisHeimbigner committed Sep 25, 2024
1 parent 9d1ccc6 commit f1ed2c3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 21 deletions.
40 changes: 19 additions & 21 deletions unit_test/run_pluginpaths.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
# Test the programmatic API for manipulating the plugin paths.
# This script is still full of cruft that needs to be removed

export SETX=1

if test "x$srcdir" = x ; then srcdir=`pwd`; fi
. ../test_common.sh


set -x

IMPLS=
Expand All @@ -32,7 +31,6 @@ cd $ISOPATH
fi

TP="${execdir}/tst_pluginpaths"
NOCR="tr -d '\r'"

filenamefor() {
# tmp|ref_action
Expand Down Expand Up @@ -64,34 +62,34 @@ modfor() {
testget() {
filenamefor tmp get
# print out the global state
echon "testget(global): " | ${NOCR} >> ${filename}.txt
${TP} -x "set:${DFALT},get:global" | ${NOCR} >> ${filename}.txt ;
echon "testget(global): " >> ${filename}.txt
${TP} -x "set:${DFALT},get:global" >> ${filename}.txt ;
# print out the HDF5 state
echon "testget(hdf5): " | ${NOCR} >> ${filename}.txt
${TP} -x "set:${DFALT},get:hdf5" | ${NOCR} >> ${filename}.txt ;
echon "testget(hdf5): " >> ${filename}.txt
${TP} -x "set:${DFALT},get:hdf5" >> ${filename}.txt ;
# print out the NCZarr state
echon "testget(nczarr): " | ${NOCR} >> ${filename}.txt
${TP} -x "set:${DFALT},get:nczarr" | ${NOCR} >> ${filename}.txt ;
echon "testget(nczarr): " >> ${filename}.txt
${TP} -x "set:${DFALT},get:nczarr" >> ${filename}.txt ;
}

# Set the global state to some value and verify that it was sync'd to hdf5 and nczarr
testset() {
filenamefor tmp set
# print out the global state, modify it and print again
echon "testset(global): before: " | ${NOCR} >> ${filename}.txt
${TP} -x "set:${DFALT},get:global" | ${NOCR} >> ${filename}.txt ;
echon "testset(global): after: " | ${NOCR} >> ${filename}.txt
${TP} -x "set:${DFALT},set:${DFALTSET},get:global" | ${NOCR} >> ${filename}.txt ;
echon "testset(global): before: " >> ${filename}.txt
${TP} -x "set:${DFALT},get:global" >> ${filename}.txt ;
echon "testset(global): after: " >> ${filename}.txt
${TP} -x "set:${DFALT},set:${DFALTSET},get:global" >> ${filename}.txt ;
# print out the HDF5 state
echon "testset(hdf5): before: " | ${NOCR} >> ${filename}.txt
${TP} -x "set:${DFALT},get:hdf5" | ${NOCR} >> ${filename}.txt ;
echon "testset(hdf5): after: " | ${NOCR} >> ${filename}.txt
${TP} -x "set:${DFALT},set:${DFALTSET},get:hdf5" | ${NOCR} >> ${filename}.txt ;
echon "testset(hdf5): before: " >> ${filename}.txt
${TP} -x "set:${DFALT},get:hdf5" >> ${filename}.txt ;
echon "testset(hdf5): after: " >> ${filename}.txt
${TP} -x "set:${DFALT},set:${DFALTSET},get:hdf5" >> ${filename}.txt ;
# print out the NCZarr state
echon "testset(nczarr): before: " | ${NOCR} >> ${filename}.txt
${TP} -x "set:${DFALT},get:nczarr" | ${NOCR} >> ${filename}.txt ;
echon "testset(nczarr): after: " | ${NOCR} >> ${filename}.txt
${TP} -x "set:${DFALT},set:${DFALTSET},get:nczarr" | ${NOCR} >> ${filename}.txt ;
echon "testset(nczarr): before: " >> ${filename}.txt
${TP} -x "set:${DFALT},get:nczarr" >> ${filename}.txt ;
echon "testset(nczarr): after: " >> ${filename}.txt
${TP} -x "set:${DFALT},set:${DFALTSET},get:nczarr" >> ${filename}.txt ;
}

#########################
Expand Down
6 changes: 6 additions & 0 deletions unit_test/tst_pluginpaths.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,12 @@ main(int argc, char** argv)
int c;
size_t i;

#ifdef _WIN32
/* Convert \r\n -> \n output on stdout */
if(freopen(0, "wb", stdout)==0)
abort();
#endif

/* Init options */
memset((void*)&dumpoptions,0,sizeof(dumpoptions));

Expand Down

0 comments on commit f1ed2c3

Please sign in to comment.