From a0cfd47135f4cc4c38a69980c09abed1263a5ba3 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Wed, 16 Jun 2004 03:34:19 +0000 Subject: [PATCH] Add unit tests for name server. This commit was SVN r1301. --- test/ns/Makefile.am | 17 +++++++++++++++++ test/ns/ns.c | 23 +++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 test/ns/Makefile.am create mode 100644 test/ns/ns.c diff --git a/test/ns/Makefile.am b/test/ns/Makefile.am new file mode 100644 index 0000000000..b6edd46433 --- /dev/null +++ b/test/ns/Makefile.am @@ -0,0 +1,17 @@ +# -*- makefile -*- +# +# $HEADER$ +# + +include $(top_srcdir)/config/Makefile.options +AM_CPPFLAGS = -I$(top_srcdir)/test/support -DOMPI_ENABLE_DEBUG_OVERRIDE=1 + +noinst_PROGRAMS = \ + ns + +ns_SOURCES = ns.c +ns_LDADD = \ + $(top_builddir)/src/ns/name_server.lo \ + $(top_builddir)/test/support/libsupport.la +ns_DEPENDENCIES = $(ompi_ns_LDADD) + diff --git a/test/ns/ns.c b/test/ns/ns.c new file mode 100644 index 0000000000..25f9cbdcb2 --- /dev/null +++ b/test/ns/ns.c @@ -0,0 +1,23 @@ +#include + +#include "ns/name_server.h" + +int main(int argc, char **argv) +{ + int i; + uint32_t *foo; + ompi_process_name_t j; + +foo = (uint32_t*) &j; + + for (i=0; i<30; i++) { + j = ompi_process_name_new(); + fprintf(stderr, "name: %x %x\n", foo[0], foo[1]); + } + + for (i=0; i<3; i++) { + j = ompi_process_name_get_range(30000); + fprintf(stderr, "range name: %x %x\n", foo[0], foo[1]); + } + +}