diff options
author | Jonathan McCrohan <jmccrohan@gmail.com> | 2012-11-17 17:04:05 +0000 |
---|---|---|
committer | Jonathan McCrohan <jmccrohan@gmail.com> | 2012-11-17 17:04:05 +0000 |
commit | 2fc13f629ad1d5f991ac3679e9d399760ceef085 (patch) | |
tree | b267e6b0bacca43f0563a12d9b2a3efb51feaf61 /tests | |
parent | c317fac1d7221e4a278c41490ff300f7802e9dcb (diff) | |
parent | f2499612c5594944d3e0891259859668d35c85b2 (diff) | |
download | libconfig-2fc13f629ad1d5f991ac3679e9d399760ceef085.tar.gz |
Merge tag 'upstream/1.4.9'
Upstream version 1.4.9
Conflicts:
debian/changelog
debian/control
libconfig.spec
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.in | 2 | ||||
-rw-r--r-- | tests/tests.c | 14 |
2 files changed, 11 insertions, 5 deletions
diff --git a/tests/Makefile.in b/tests/Makefile.in index c9f388f..ecf67de 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -115,6 +115,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -142,6 +143,7 @@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ diff --git a/tests/tests.c b/tests/tests.c index 298c402..e13e67f 100644 --- a/tests/tests.c +++ b/tests/tests.c @@ -20,10 +20,14 @@ ---------------------------------------------------------------------------- */ +#include <stdio.h> #include <stdlib.h> -#include <unistd.h> #include <sys/stat.h> +#ifdef _MSC_VER +#define snprintf _snprintf +#endif + #include <libconfig.h> #include <tinytest.h> @@ -48,7 +52,7 @@ static void parse_and_compare(const char *input_file, const char *output_file) remove("temp.cfg"); TT_ASSERT_TRUE(config_write_file(&cfg, "temp.cfg")); - TT_ASSERT_FILE_EQ("temp.cfg", output_file); + TT_ASSERT_TXTFILE_EQ("temp.cfg", output_file); remove("temp.cfg"); config_destroy(&cfg); @@ -135,7 +139,7 @@ TT_TEST(ParsingAndFormatting) sprintf(output_file, "testdata/output_%d.cfg", i); printf("parsing %s\n", input_file); - if((access(input_file, F_OK) != 0) || (access(output_file, F_OK) != 0)) + if(!tt_file_exists(input_file) || !tt_file_exists(output_file)) break; parse_and_compare(input_file, output_file); @@ -157,7 +161,7 @@ TT_TEST(ParseInvalidFiles) sprintf(input_file, "testdata/bad_input_%d.cfg", i); sprintf(error_file, "testdata/parse_error_%d.txt", i); - if((access(input_file, F_OK) != 0) || (access(error_file, F_OK) != 0)) + if(!tt_file_exists(input_file) || !tt_file_exists(error_file)) break; fp = fopen(error_file, "rt"); @@ -185,7 +189,7 @@ TT_TEST(ParseInvalidStrings) sprintf(input_file, "testdata/bad_input_%d.cfg", i); sprintf(error_file, "testdata/parse_error_%d.txt", i); - if((access(input_file, F_OK) != 0) || (access(error_file, F_OK) != 0)) + if(!tt_file_exists(input_file) || !tt_file_exists(error_file)) break; input_text = read_file_to_string(input_file); |