Skip to content
Snippets Groups Projects
Commit 40074a5a authored by Danny Auble's avatar Danny Auble
Browse files

Altered pack test to test packing doubles as 64 bit vars

parent af9165cd
No related branches found
No related tags found
No related merge requests found
File mode changed from 100644 to 100755
......@@ -9,7 +9,7 @@ elan_lib =
endif
INCLUDES = -I$(top_srcdir)
LDADD = $(top_builddir)/src/common/libcommon.la \
LDADD = $(top_builddir)/src/api/libslurm.o -ldl\
$(elan_lib)
check_PROGRAMS = \
......
......@@ -87,22 +87,22 @@ bitstring_test_SOURCES = bitstring-test.c
bitstring_test_OBJECTS = bitstring-test.$(OBJEXT)
bitstring_test_LDADD = $(LDADD)
@HAVE_ELAN_TRUE@am__DEPENDENCIES_1 = $(top_builddir)/src/plugins/switch/elan/switch_elan.la
bitstring_test_DEPENDENCIES = $(top_builddir)/src/common/libcommon.la \
bitstring_test_DEPENDENCIES = $(top_builddir)/src/api/libslurm.o \
$(am__DEPENDENCIES_1)
log_test_SOURCES = log-test.c
log_test_OBJECTS = log-test.$(OBJEXT)
log_test_LDADD = $(LDADD)
log_test_DEPENDENCIES = $(top_builddir)/src/common/libcommon.la \
log_test_DEPENDENCIES = $(top_builddir)/src/api/libslurm.o \
$(am__DEPENDENCIES_1)
pack_test_SOURCES = pack-test.c
pack_test_OBJECTS = pack-test.$(OBJEXT)
pack_test_LDADD = $(LDADD)
pack_test_DEPENDENCIES = $(top_builddir)/src/common/libcommon.la \
pack_test_DEPENDENCIES = $(top_builddir)/src/api/libslurm.o \
$(am__DEPENDENCIES_1)
runqsw_SOURCES = runqsw.c
runqsw_OBJECTS = runqsw.$(OBJEXT)
runqsw_LDADD = $(LDADD)
runqsw_DEPENDENCIES = $(top_builddir)/src/common/libcommon.la \
runqsw_DEPENDENCIES = $(top_builddir)/src/api/libslurm.o \
$(am__DEPENDENCIES_1)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/slurm
depcomp = $(SHELL) $(top_srcdir)/auxdir/depcomp
......@@ -321,7 +321,7 @@ AUTOMAKE_OPTIONS = foreign
@HAVE_ELAN_FALSE@elan_lib =
@HAVE_ELAN_TRUE@elan_lib = $(top_builddir)/src/plugins/switch/elan/switch_elan.la
INCLUDES = -I$(top_srcdir)
LDADD = $(top_builddir)/src/common/libcommon.la \
LDADD = $(top_builddir)/src/api/libslurm.o -ldl\
$(elan_lib)
all: all-am
......
......@@ -39,10 +39,13 @@ int main (int argc, char *argv[])
char *nullstr = NULL;
char *data;
int data_size;
long double test_double = 1340664754944.2132312, test_double2;
uint64_t test64;
buffer = init_buf (0);
pack16(test16, buffer);
pack32(test32, buffer);
pack64((uint64_t)test_double, buffer);
packstr(testbytes, buffer);
packstr(teststring, buffer);
......@@ -50,6 +53,7 @@ int main (int argc, char *argv[])
packstr("literal", buffer);
packstr("", buffer);
data_size = get_buf_offset(buffer);
printf("wrote %d bytes\n", data_size);
......@@ -63,7 +67,14 @@ int main (int argc, char *argv[])
unpack32(&out32, buffer);
TEST(out32 != test32, "un/pack32");
unpackstr_ptr(&outbytes, &byte_cnt, buffer);
unpack64(&test64, buffer);
test_double2 = (long double)test64;
TEST(test64 != (uint64_t)test_double, "un/pack double as a uint64");
/* info("Original\t %Lf", test_double); */
/* info("uint64\t %ld", test64); */
/* info("converted LD\t %Lf", test_double2); */
unpackstr_ptr(&outbytes, &byte_cnt, buffer);
TEST( ( strcmp(testbytes, outbytes) != 0 ) , "un/packstr_ptr");
unpackstr_xmalloc(&outstring, &byte_cnt, buffer);
......@@ -80,6 +91,7 @@ int main (int argc, char *argv[])
unpackstr_xmalloc(&outstring, &byte_cnt, buffer);
TEST(strcmp("", outstring) != 0, "un/packstr of string \"\" ");
xfree(outstring);
free_buf(buffer);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment