diff options
author | Seonah Moon <seonah1.moon@samsung.com> | 2016-04-07 11:41:57 +0900 |
---|---|---|
committer | Seonah Moon <seonah1.moon@samsung.com> | 2016-04-07 13:29:05 +0900 |
commit | 8a08705db260779441360e959b97b6c172f8acb0 (patch) | |
tree | e5cfc1f4bc28cd81e93a96f9707a0efb143d278a /tests/unit | |
parent | f7bbc1c9b6a8e2c815d09612b53f453c90d962e0 (diff) | |
download | curl-8a08705db260779441360e959b97b6c172f8acb0.tar.gz curl-8a08705db260779441360e959b97b6c172f8acb0.tar.bz2 curl-8a08705db260779441360e959b97b6c172f8acb0.zip |
Imported Upstream version 7.44.0
Change-Id: I04e7fac0b620653ff8c174e87039756e98c4fb02
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/Makefile.in | 179 | ||||
-rw-r--r-- | tests/unit/Makefile.inc | 14 | ||||
-rw-r--r-- | tests/unit/curlcheck.h | 14 | ||||
-rw-r--r-- | tests/unit/unit1305.c | 18 | ||||
-rw-r--r-- | tests/unit/unit1397.c | 2 | ||||
-rw-r--r-- | tests/unit/unit1600.c | 63 | ||||
-rw-r--r-- | tests/unit/unit1601.c | 51 | ||||
-rw-r--r-- | tests/unit/unit1602.c | 80 |
8 files changed, 387 insertions, 34 deletions
diff --git a/tests/unit/Makefile.in b/tests/unit/Makefile.in index cd2ed53b2..7b0a10cc0 100644 --- a/tests/unit/Makefile.in +++ b/tests/unit/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -17,7 +17,17 @@ # these files are used in every single unit test program VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -80,9 +90,6 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -DIST_COMMON = $(srcdir)/Makefile.inc $(srcdir)/Makefile.in \ - $(srcdir)/Makefile.am $(top_srcdir)/mkinstalldirs \ - $(top_srcdir)/depcomp README @BUILD_UNITTESTS_TRUE@noinst_PROGRAMS = $(am__EXEEXT_1) subdir = tests/unit ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -105,7 +112,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/curl-compilers.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/lib/curl_config.h \ $(top_builddir)/include/curl/curlbuild.h CONFIG_CLEAN_FILES = @@ -114,7 +122,8 @@ am__EXEEXT_1 = unit1300$(EXEEXT) unit1301$(EXEEXT) unit1302$(EXEEXT) \ unit1303$(EXEEXT) unit1304$(EXEEXT) unit1305$(EXEEXT) \ unit1307$(EXEEXT) unit1308$(EXEEXT) unit1309$(EXEEXT) \ unit1330$(EXEEXT) unit1394$(EXEEXT) unit1395$(EXEEXT) \ - unit1396$(EXEEXT) unit1397$(EXEEXT) unit1398$(EXEEXT) + unit1396$(EXEEXT) unit1397$(EXEEXT) unit1398$(EXEEXT) \ + unit1600$(EXEEXT) unit1601$(EXEEXT) unit1602$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am__objects_1 = ../libtest/unit1300-first.$(OBJEXT) @@ -212,6 +221,24 @@ unit1398_OBJECTS = $(am_unit1398_OBJECTS) unit1398_LDADD = $(LDADD) unit1398_DEPENDENCIES = $(top_builddir)/src/libcurltool.la \ $(top_builddir)/lib/libcurlu.la +am__objects_16 = ../libtest/unit1600-first.$(OBJEXT) +am_unit1600_OBJECTS = unit1600-unit1600.$(OBJEXT) $(am__objects_16) +unit1600_OBJECTS = $(am_unit1600_OBJECTS) +unit1600_LDADD = $(LDADD) +unit1600_DEPENDENCIES = $(top_builddir)/src/libcurltool.la \ + $(top_builddir)/lib/libcurlu.la +am__objects_17 = ../libtest/unit1601-first.$(OBJEXT) +am_unit1601_OBJECTS = unit1601-unit1601.$(OBJEXT) $(am__objects_17) +unit1601_OBJECTS = $(am_unit1601_OBJECTS) +unit1601_LDADD = $(LDADD) +unit1601_DEPENDENCIES = $(top_builddir)/src/libcurltool.la \ + $(top_builddir)/lib/libcurlu.la +am__objects_18 = ../libtest/unit1602-first.$(OBJEXT) +am_unit1602_OBJECTS = unit1602-unit1602.$(OBJEXT) $(am__objects_18) +unit1602_OBJECTS = $(am_unit1602_OBJECTS) +unit1602_LDADD = $(LDADD) +unit1602_DEPENDENCIES = $(top_builddir)/src/libcurltool.la \ + $(top_builddir)/lib/libcurlu.la AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -250,13 +277,15 @@ SOURCES = $(unit1300_SOURCES) $(unit1301_SOURCES) $(unit1302_SOURCES) \ $(unit1303_SOURCES) $(unit1304_SOURCES) $(unit1305_SOURCES) \ $(unit1307_SOURCES) $(unit1308_SOURCES) $(unit1309_SOURCES) \ $(unit1330_SOURCES) $(unit1394_SOURCES) $(unit1395_SOURCES) \ - $(unit1396_SOURCES) $(unit1397_SOURCES) $(unit1398_SOURCES) + $(unit1396_SOURCES) $(unit1397_SOURCES) $(unit1398_SOURCES) \ + $(unit1600_SOURCES) $(unit1601_SOURCES) $(unit1602_SOURCES) DIST_SOURCES = $(unit1300_SOURCES) $(unit1301_SOURCES) \ $(unit1302_SOURCES) $(unit1303_SOURCES) $(unit1304_SOURCES) \ $(unit1305_SOURCES) $(unit1307_SOURCES) $(unit1308_SOURCES) \ $(unit1309_SOURCES) $(unit1330_SOURCES) $(unit1394_SOURCES) \ $(unit1395_SOURCES) $(unit1396_SOURCES) $(unit1397_SOURCES) \ - $(unit1398_SOURCES) + $(unit1398_SOURCES) $(unit1600_SOURCES) $(unit1601_SOURCES) \ + $(unit1602_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -281,6 +310,8 @@ am__define_uniq_tagged_files = \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.inc \ + $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -339,7 +370,7 @@ GREP = @GREP@ HAVE_GNUTLS_SRP = @HAVE_GNUTLS_SRP@ HAVE_LDAP_SSL = @HAVE_LDAP_SSL@ HAVE_LIBZ = @HAVE_LIBZ@ -HAVE_SSLEAY_SRP = @HAVE_SSLEAY_SRP@ +HAVE_OPENSSL_SRP = @HAVE_OPENSSL_SRP@ IDN_ENABLED = @IDN_ENABLED@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -394,6 +425,7 @@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_ENABLED = @SSL_ENABLED@ +SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SUPPORT_FEATURES = @SUPPORT_FEATURES@ SUPPORT_PROTOCOLS = @SUPPORT_PROTOCOLS@ @@ -410,7 +442,6 @@ USE_NSS = @USE_NSS@ USE_OPENLDAP = @USE_OPENLDAP@ USE_POLARSSL = @USE_POLARSSL@ USE_SCHANNEL = @USE_SCHANNEL@ -USE_SSLEAY = @USE_SSLEAY@ USE_UNIX_SOCKETS = @USE_UNIX_SOCKETS@ USE_WINDOWS_SSPI = @USE_WINDOWS_SSPI@ VERSION = @VERSION@ @@ -538,8 +569,9 @@ UNITFILES = curlcheck.h \ # These are all unit test programs -UNITPROGS = unit1300 unit1301 unit1302 unit1303 unit1304 unit1305 unit1307 \ - unit1308 unit1309 unit1330 unit1394 unit1395 unit1396 unit1397 unit1398 +UNITPROGS = unit1300 unit1301 unit1302 unit1303 unit1304 unit1305 unit1307 \ + unit1308 unit1309 unit1330 unit1394 unit1395 unit1396 unit1397 unit1398 \ + unit1600 unit1601 unit1602 unit1300_SOURCES = unit1300.c $(UNITFILES) unit1300_CPPFLAGS = $(AM_CPPFLAGS) @@ -574,6 +606,12 @@ unit1397_SOURCES = unit1397.c $(UNITFILES) unit1397_CPPFLAGS = $(AM_CPPFLAGS) unit1398_SOURCES = unit1398.c $(UNITFILES) unit1398_CPPFLAGS = $(AM_CPPFLAGS) +unit1600_SOURCES = unit1600.c $(UNITFILES) +unit1600_CPPFLAGS = $(AM_CPPFLAGS) +unit1601_SOURCES = unit1601.c $(UNITFILES) +unit1601_CPPFLAGS = $(AM_CPPFLAGS) +unit1602_SOURCES = unit1602.c $(UNITFILES) +unit1602_CPPFLAGS = $(AM_CPPFLAGS) all: all-am .SUFFIXES: @@ -590,7 +628,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/Ma echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/unit/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests/unit/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -599,7 +636,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; -$(srcdir)/Makefile.inc: +$(srcdir)/Makefile.inc $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -714,6 +751,24 @@ unit1397$(EXEEXT): $(unit1397_OBJECTS) $(unit1397_DEPENDENCIES) $(EXTRA_unit1397 unit1398$(EXEEXT): $(unit1398_OBJECTS) $(unit1398_DEPENDENCIES) $(EXTRA_unit1398_DEPENDENCIES) @rm -f unit1398$(EXEEXT) $(AM_V_CCLD)$(LINK) $(unit1398_OBJECTS) $(unit1398_LDADD) $(LIBS) +../libtest/unit1600-first.$(OBJEXT): ../libtest/$(am__dirstamp) \ + ../libtest/$(DEPDIR)/$(am__dirstamp) + +unit1600$(EXEEXT): $(unit1600_OBJECTS) $(unit1600_DEPENDENCIES) $(EXTRA_unit1600_DEPENDENCIES) + @rm -f unit1600$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit1600_OBJECTS) $(unit1600_LDADD) $(LIBS) +../libtest/unit1601-first.$(OBJEXT): ../libtest/$(am__dirstamp) \ + ../libtest/$(DEPDIR)/$(am__dirstamp) + +unit1601$(EXEEXT): $(unit1601_OBJECTS) $(unit1601_DEPENDENCIES) $(EXTRA_unit1601_DEPENDENCIES) + @rm -f unit1601$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit1601_OBJECTS) $(unit1601_LDADD) $(LIBS) +../libtest/unit1602-first.$(OBJEXT): ../libtest/$(am__dirstamp) \ + ../libtest/$(DEPDIR)/$(am__dirstamp) + +unit1602$(EXEEXT): $(unit1602_OBJECTS) $(unit1602_DEPENDENCIES) $(EXTRA_unit1602_DEPENDENCIES) + @rm -f unit1602$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit1602_OBJECTS) $(unit1602_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -737,6 +792,9 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@../libtest/$(DEPDIR)/unit1396-first.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../libtest/$(DEPDIR)/unit1397-first.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../libtest/$(DEPDIR)/unit1398-first.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@../libtest/$(DEPDIR)/unit1600-first.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@../libtest/$(DEPDIR)/unit1601-first.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@../libtest/$(DEPDIR)/unit1602-first.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unit1300-unit1300.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unit1301-unit1301.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unit1302-unit1302.Po@am__quote@ @@ -752,6 +810,9 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unit1396-unit1396.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unit1397-unit1397.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unit1398-unit1398.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unit1600-unit1600.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unit1601-unit1601.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unit1602-unit1602.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -1197,6 +1258,90 @@ unit1398-unit1398.obj: unit1398.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1398_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1398-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` +unit1600-unit1600.o: unit1600.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1600_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1600-unit1600.o -MD -MP -MF $(DEPDIR)/unit1600-unit1600.Tpo -c -o unit1600-unit1600.o `test -f 'unit1600.c' || echo '$(srcdir)/'`unit1600.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1600-unit1600.Tpo $(DEPDIR)/unit1600-unit1600.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1600.c' object='unit1600-unit1600.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1600_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1600-unit1600.o `test -f 'unit1600.c' || echo '$(srcdir)/'`unit1600.c + +unit1600-unit1600.obj: unit1600.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1600_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1600-unit1600.obj -MD -MP -MF $(DEPDIR)/unit1600-unit1600.Tpo -c -o unit1600-unit1600.obj `if test -f 'unit1600.c'; then $(CYGPATH_W) 'unit1600.c'; else $(CYGPATH_W) '$(srcdir)/unit1600.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1600-unit1600.Tpo $(DEPDIR)/unit1600-unit1600.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1600.c' object='unit1600-unit1600.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1600_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1600-unit1600.obj `if test -f 'unit1600.c'; then $(CYGPATH_W) 'unit1600.c'; else $(CYGPATH_W) '$(srcdir)/unit1600.c'; fi` + +../libtest/unit1600-first.o: ../libtest/first.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1600_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1600-first.o -MD -MP -MF ../libtest/$(DEPDIR)/unit1600-first.Tpo -c -o ../libtest/unit1600-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1600-first.Tpo ../libtest/$(DEPDIR)/unit1600-first.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1600-first.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1600_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1600-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c + +../libtest/unit1600-first.obj: ../libtest/first.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1600_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1600-first.obj -MD -MP -MF ../libtest/$(DEPDIR)/unit1600-first.Tpo -c -o ../libtest/unit1600-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1600-first.Tpo ../libtest/$(DEPDIR)/unit1600-first.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1600-first.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1600_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1600-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` + +unit1601-unit1601.o: unit1601.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1601_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1601-unit1601.o -MD -MP -MF $(DEPDIR)/unit1601-unit1601.Tpo -c -o unit1601-unit1601.o `test -f 'unit1601.c' || echo '$(srcdir)/'`unit1601.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1601-unit1601.Tpo $(DEPDIR)/unit1601-unit1601.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1601.c' object='unit1601-unit1601.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1601_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1601-unit1601.o `test -f 'unit1601.c' || echo '$(srcdir)/'`unit1601.c + +unit1601-unit1601.obj: unit1601.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1601_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1601-unit1601.obj -MD -MP -MF $(DEPDIR)/unit1601-unit1601.Tpo -c -o unit1601-unit1601.obj `if test -f 'unit1601.c'; then $(CYGPATH_W) 'unit1601.c'; else $(CYGPATH_W) '$(srcdir)/unit1601.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1601-unit1601.Tpo $(DEPDIR)/unit1601-unit1601.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1601.c' object='unit1601-unit1601.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1601_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1601-unit1601.obj `if test -f 'unit1601.c'; then $(CYGPATH_W) 'unit1601.c'; else $(CYGPATH_W) '$(srcdir)/unit1601.c'; fi` + +../libtest/unit1601-first.o: ../libtest/first.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1601_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1601-first.o -MD -MP -MF ../libtest/$(DEPDIR)/unit1601-first.Tpo -c -o ../libtest/unit1601-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1601-first.Tpo ../libtest/$(DEPDIR)/unit1601-first.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1601-first.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1601_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1601-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c + +../libtest/unit1601-first.obj: ../libtest/first.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1601_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1601-first.obj -MD -MP -MF ../libtest/$(DEPDIR)/unit1601-first.Tpo -c -o ../libtest/unit1601-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1601-first.Tpo ../libtest/$(DEPDIR)/unit1601-first.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1601-first.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1601_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1601-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` + +unit1602-unit1602.o: unit1602.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1602_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1602-unit1602.o -MD -MP -MF $(DEPDIR)/unit1602-unit1602.Tpo -c -o unit1602-unit1602.o `test -f 'unit1602.c' || echo '$(srcdir)/'`unit1602.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1602-unit1602.Tpo $(DEPDIR)/unit1602-unit1602.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1602.c' object='unit1602-unit1602.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1602_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1602-unit1602.o `test -f 'unit1602.c' || echo '$(srcdir)/'`unit1602.c + +unit1602-unit1602.obj: unit1602.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1602_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unit1602-unit1602.obj -MD -MP -MF $(DEPDIR)/unit1602-unit1602.Tpo -c -o unit1602-unit1602.obj `if test -f 'unit1602.c'; then $(CYGPATH_W) 'unit1602.c'; else $(CYGPATH_W) '$(srcdir)/unit1602.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/unit1602-unit1602.Tpo $(DEPDIR)/unit1602-unit1602.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unit1602.c' object='unit1602-unit1602.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1602_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unit1602-unit1602.obj `if test -f 'unit1602.c'; then $(CYGPATH_W) 'unit1602.c'; else $(CYGPATH_W) '$(srcdir)/unit1602.c'; fi` + +../libtest/unit1602-first.o: ../libtest/first.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1602_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1602-first.o -MD -MP -MF ../libtest/$(DEPDIR)/unit1602-first.Tpo -c -o ../libtest/unit1602-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1602-first.Tpo ../libtest/$(DEPDIR)/unit1602-first.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1602-first.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1602_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1602-first.o `test -f '../libtest/first.c' || echo '$(srcdir)/'`../libtest/first.c + +../libtest/unit1602-first.obj: ../libtest/first.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1602_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ../libtest/unit1602-first.obj -MD -MP -MF ../libtest/$(DEPDIR)/unit1602-first.Tpo -c -o ../libtest/unit1602-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../libtest/$(DEPDIR)/unit1602-first.Tpo ../libtest/$(DEPDIR)/unit1602-first.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../libtest/first.c' object='../libtest/unit1602-first.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unit1602_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ../libtest/unit1602-first.obj `if test -f '../libtest/first.c'; then $(CYGPATH_W) '../libtest/first.c'; else $(CYGPATH_W) '$(srcdir)/../libtest/first.c'; fi` + mostlyclean-libtool: -rm -f *.lo @@ -1408,6 +1553,8 @@ uninstall-am: mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am +.PRECIOUS: Makefile + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/tests/unit/Makefile.inc b/tests/unit/Makefile.inc index 526ec1fbd..9073b34e6 100644 --- a/tests/unit/Makefile.inc +++ b/tests/unit/Makefile.inc @@ -5,8 +5,9 @@ UNITFILES = curlcheck.h \ ../libtest/first.c # These are all unit test programs -UNITPROGS = unit1300 unit1301 unit1302 unit1303 unit1304 unit1305 unit1307 \ - unit1308 unit1309 unit1330 unit1394 unit1395 unit1396 unit1397 unit1398 +UNITPROGS = unit1300 unit1301 unit1302 unit1303 unit1304 unit1305 unit1307 \ + unit1308 unit1309 unit1330 unit1394 unit1395 unit1396 unit1397 unit1398 \ + unit1600 unit1601 unit1602 unit1300_SOURCES = unit1300.c $(UNITFILES) unit1300_CPPFLAGS = $(AM_CPPFLAGS) @@ -56,3 +57,12 @@ unit1397_CPPFLAGS = $(AM_CPPFLAGS) unit1398_SOURCES = unit1398.c $(UNITFILES) unit1398_CPPFLAGS = $(AM_CPPFLAGS) +unit1600_SOURCES = unit1600.c $(UNITFILES) +unit1600_CPPFLAGS = $(AM_CPPFLAGS) + +unit1601_SOURCES = unit1601.c $(UNITFILES) +unit1601_CPPFLAGS = $(AM_CPPFLAGS) + +unit1602_SOURCES = unit1602.c $(UNITFILES) +unit1602_CPPFLAGS = $(AM_CPPFLAGS) + diff --git a/tests/unit/curlcheck.h b/tests/unit/curlcheck.h index 96203e075..2e3746bdc 100644 --- a/tests/unit/curlcheck.h +++ b/tests/unit/curlcheck.h @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -36,11 +36,13 @@ unitfail++; \ } -#define verify_memory(dynamic, check, len) \ - if(dynamic && memcmp(dynamic, check, len)) { \ - fprintf(stderr, "%s:%d The dynamic string didn't match '%s'\n", \ - __FILE__, __LINE__, check); \ - unitfail++; \ +#define verify_memory(dynamic, check, len) \ + if(dynamic && memcmp(dynamic, check, len)) { \ + fprintf(stderr, "%s:%d Memory buffer mismatch size %d. '%s' is not\n", \ + __FILE__, __LINE__, len, hexdump((unsigned char *)check, len)); \ + fprintf(stderr, "%s:%d the same as '%s'\n", \ + __FILE__, __LINE__, hexdump((unsigned char *)dynamic, len)); \ + unitfail++; \ } /* fail() is for when the test case figured out by itself that a check diff --git a/tests/unit/unit1305.c b/tests/unit/unit1305.c index 91e3b0b27..96913f1fa 100644 --- a/tests/unit/unit1305.c +++ b/tests/unit/unit1305.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -40,18 +40,19 @@ #include "memdebug.h" /* LAST include file */ static struct SessionHandle *data; -static struct curl_hash *hp; +static struct curl_hash hp; static char *data_key; static struct Curl_dns_entry *data_node; static CURLcode unit_setup( void ) { + int rc; data = curl_easy_init(); if (!data) return CURLE_OUT_OF_MEMORY; - hp = Curl_mk_dnscache(); - if(!hp) { + rc = Curl_mk_dnscache(&hp); + if(rc) { curl_easy_cleanup(data); curl_global_cleanup(); return CURLE_OUT_OF_MEMORY; @@ -65,10 +66,8 @@ static void unit_stop( void ) Curl_freeaddrinfo(data_node->addr); free(data_node); } - if (data_key) - free(data_key); - - Curl_hash_destroy(hp); + free(data_key); + Curl_hash_destroy(&hp); curl_easy_cleanup(data); curl_global_cleanup(); @@ -130,7 +129,8 @@ UNITTEST_START abort_unless(rc == CURLE_OK, "data node creation failed"); key_len = strlen(data_key); - nodep = Curl_hash_add(hp, data_key, key_len+1, data_node); + data_node->inuse = 1; /* hash will hold the reference */ + nodep = Curl_hash_add(&hp, data_key, key_len+1, data_node); abort_unless(nodep, "insertion into hash failed"); /* Freeing will now be done by Curl_hash_destroy */ data_node = NULL; diff --git a/tests/unit/unit1397.c b/tests/unit/unit1397.c index fd60c2315..c05c119db 100644 --- a/tests/unit/unit1397.c +++ b/tests/unit/unit1397.c @@ -15,7 +15,7 @@ static void unit_stop( void ) UNITTEST_START /* only these backends define the tested functions */ -#if defined(USE_SSLEAY) || defined(USE_AXTLS) || defined(USE_GSKIT) +#if defined(USE_OPENSSL) || defined(USE_AXTLS) || defined(USE_GSKIT) /* here you start doing things and checking that the results are good */ diff --git a/tests/unit/unit1600.c b/tests/unit/unit1600.c new file mode 100644 index 000000000..6803cf336 --- /dev/null +++ b/tests/unit/unit1600.c @@ -0,0 +1,63 @@ +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at http://curl.haxx.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ***************************************************************************/ +#include "curlcheck.h" + +#include "urldata.h" +#include "curl_ntlm_core.h" + +CURL *easy; + +static CURLcode unit_setup(void) +{ + easy = curl_easy_init(); + return CURLE_OK; +} + +static void unit_stop(void) +{ + curl_easy_cleanup(easy); +} + +UNITTEST_START + +#if defined(USE_NTLM) && (!defined(USE_WINDOWS_SSPI) || defined(USE_WIN32_CRYPTO)) + unsigned char output[21]; + unsigned char *testp = output; + Curl_ntlm_core_mk_nt_hash(easy, "1", output); + + verify_memory(testp, + "\x69\x94\x3c\x5e\x63\xb4\xd2\xc1\x04\xdb" + "\xbc\xc1\x51\x38\xb7\x2b\x00\x00\x00\x00\x00", 21); + + Curl_ntlm_core_mk_nt_hash(easy, "hello-you-fool", output); + + verify_memory(testp, + "\x39\xaf\x87\xa6\x75\x0a\x7a\x00\xba\xa0" + "\xd3\x4f\x04\x9e\xc1\xd0\x00\x00\x00\x00\x00", 21); + + Curl_ntlm_core_mk_nt_hash(easy, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", output); + + verify_memory(testp, + "\x36\x9d\xae\x06\x84\x7e\xe1\xc1\x4a\x94\x39\xea\x6f\x44\x8c\x65\x00\x00\x00\x00\x00", 21); +#endif + +UNITTEST_STOP diff --git a/tests/unit/unit1601.c b/tests/unit/unit1601.c new file mode 100644 index 000000000..17aba05f5 --- /dev/null +++ b/tests/unit/unit1601.c @@ -0,0 +1,51 @@ +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at http://curl.haxx.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ***************************************************************************/ +#include "curlcheck.h" + +#include "curl_md5.h" + +static CURLcode unit_setup(void) +{ + return CURLE_OK; +} + +static void unit_stop(void) +{ + +} + +UNITTEST_START + + unsigned char output[16]; + unsigned char *testp = output; + Curl_md5it(output, (const unsigned char *)"1"); + + verify_memory(testp, + "\xc4\xca\x42\x38\xa0\xb9\x23\x82\x0d\xcc\x50\x9a\x6f\x75\x84\x9b", 16); + + Curl_md5it(output, (const unsigned char *)"hello-you-fool"); + + verify_memory(testp, + "\x88\x67\x0b\x6d\x5d\x74\x2f\xad\xa5\xcd\xf9\xb6\x82\x87\x5f\x22", 16); + + +UNITTEST_STOP diff --git a/tests/unit/unit1602.c b/tests/unit/unit1602.c new file mode 100644 index 000000000..3b25556bf --- /dev/null +++ b/tests/unit/unit1602.c @@ -0,0 +1,80 @@ +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at http://curl.haxx.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ***************************************************************************/ +#include "curlcheck.h" + +#define ENABLE_CURLX_PRINTF +#include "curlx.h" + +#include "hash.h" + +#include "memdebug.h" /* LAST include file */ + + static CURLcode unit_setup( void ) +{ + return CURLE_OK; +} + +static void unit_stop( void ) +{ + +} + +static void mydtor(void *p) +{ + int *ptr = (int*)p; + free(ptr); +} + +UNITTEST_START + int *value; + int *value2; + size_t klen = sizeof(int); + + struct curl_hash hash_static; + int key = 20; + int key2 = 25; + int rc = 0; + + rc = Curl_hash_init(&hash_static, 7, Curl_hash_str, + Curl_str_key_compare, mydtor); + + if(rc) + { + fail("Curl_hash_init failed to initialize static hash!"); + goto unit_test_abort; + } + + value = malloc(sizeof(int)); + value2 = malloc(sizeof(int)); + + *value = 199; + *value2 = 204; + Curl_hash_add(&hash_static, &key, klen, value); + + Curl_hash_clean(&hash_static); + + /* Attempt to add another key/value pair */ + Curl_hash_add(&hash_static, &key2, klen, value2); + + Curl_hash_destroy(&hash_static); + +UNITTEST_STOP |