Skip to content

Commit

Permalink
Fix additional big-endian machine error in dap4.
Browse files Browse the repository at this point in the history
Follow on to PR: #1302
  • Loading branch information
DennisHeimbigner committed Feb 15, 2019
1 parent 30c2ca2 commit d13619b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 8 deletions.
10 changes: 6 additions & 4 deletions dap4_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.sh)

FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ FILE_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE)

IF(ENABLE_DAP_REMOTE_TESTS)
# Change name (add '4') to avoid cmake
# complaint about duplicate targets.
BUILD_BIN_TEST(findtestserver4)
ENDIF()

IF(ENABLE_TESTS)

# Base tests
Expand All @@ -35,10 +41,6 @@ IF(ENABLE_TESTS)

IF(ENABLE_DAP_REMOTE_TESTS)

# Change name (add '4') to avoid cmake
# complaint about duplicate targets.
BUILD_BIN_TEST(findtestserver4)

IF(BUILD_UTILITIES)
#add_sh_test(dap4_test test_remote)
ENDIF(BUILD_UTILITIES)
Expand Down
5 changes: 4 additions & 1 deletion dap4_test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ test_data.log: test_meta.log
if ENABLE_DAP_REMOTE_TESTS
# Note: This program name was changed to findtestserver4
# to avoid cmake complaint about duplicate targets.
check_PROGRAMS += findtestserver4
noinst_PROGRAMS = findtestserver4
findtestserver4_SOURCES = findtestserver4.c
endif

if ENABLE_DAP_REMOTE_TESTS
if BUILD_UTILITIES
# relies on ncdump
TESTS += test_remote.sh
Expand Down
4 changes: 4 additions & 0 deletions libdap4/d4meta.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,11 @@ convertString(union ATOMICS* converter, NCD4node* type, const char* s)
if(sscanf(s,"%lf",&converter->f64[0]) != 1) return THROW(NC_ERANGE);
break;
case NC_CHAR:
#ifdef WORDS_BIGENDIAN
converter->i8[7] = s[0];
#else
converter->i8[0] = s[0];
#endif
break;
case NC_STRING:
converter->s[0]= strdup(s);
Expand Down
7 changes: 5 additions & 2 deletions ncdap_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.sh)

FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ FILE_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE)


IF(ENABLE_DAP_REMOTE_TESTS)
BUILD_BIN_TEST(findtestserver)
ENDIF()

IF(ENABLE_TESTS)
# Base tests
# The tests are set up as a combination of shell scripts and executables that
Expand All @@ -31,8 +36,6 @@ IF(ENABLE_TESTS)

IF(ENABLE_DAP_REMOTE_TESTS)

BUILD_BIN_TEST(findtestserver)

IF(BUILD_UTILITIES)
add_sh_test(ncdap tst_ber)
add_sh_test(ncdap tst_remote3)
Expand Down
4 changes: 3 additions & 1 deletion ncdap_test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ endif
# because the server may be down or inaccessible

if ENABLE_DAP_REMOTE_TESTS
check_PROGRAMS += findtestserver
noinst_PROGRAMS = findtestserver
findtestserver_SOURCES = findtestserver.c
endif

if ENABLE_DAP_REMOTE_TESTS
if BUILD_UTILITIES
TESTS += tst_ber.sh tst_remote3.sh tst_formatx.sh testurl.sh tst_fillmismatch.sh tst_zero_len_var.sh
endif
Expand Down

0 comments on commit d13619b

Please sign in to comment.