summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2011-11-20 20:18:59 +0100
committerSimon Josefsson <simon@josefsson.org>2011-11-20 21:27:57 +0100
commitf1744a0b833fa8f4792c01a11d82b6525b237d3c (patch)
tree778b8567174bf82f112c7838299524aea17b8051 /tests
parent6a926a686de9e7a398c0f2086f4e754fa8c17c31 (diff)
downloadlibtasn1-f1744a0b833fa8f4792c01a11d82b6525b237d3c.tar.gz
libtasn1-f1744a0b833fa8f4792c01a11d82b6525b237d3c.tar.bz2
libtasn1-f1744a0b833fa8f4792c01a11d82b6525b237d3c.zip
Silence warnings.
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/Test_errors.c4
-rw-r--r--tests/Test_indefinite.c2
-rw-r--r--tests/Test_parser.c13
-rw-r--r--tests/Test_simple.c11
-rw-r--r--tests/Test_tree.c8
6 files changed, 18 insertions, 21 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index bc03513..950380c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -17,6 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS) $(CFLAG_VISIBILITY)
AM_CPPFLAGS = -I$(top_srcdir)/lib -I$(top_srcdir)/gl -I../gl
AM_LDFLAGS = -no-install
diff --git a/tests/Test_errors.c b/tests/Test_errors.c
index f839454..891b1b4 100644
--- a/tests/Test_errors.c
+++ b/tests/Test_errors.c
@@ -30,10 +30,6 @@ main (int argc, char *argv[])
{
errstr = asn1_strerror (ec);
asn1_perror (ec);
-#ifndef ASN1_DISABLE_DEPRECATED
- errstr = libtasn1_strerror (ec);
- libtasn1_perror (ec);
-#endif
ec++;
}
while (errstr);
diff --git a/tests/Test_indefinite.c b/tests/Test_indefinite.c
index 1100421..697faf9 100644
--- a/tests/Test_indefinite.c
+++ b/tests/Test_indefinite.c
@@ -104,7 +104,7 @@ main (int argc, char *argv[])
if (result != ASN1_SUCCESS)
{
asn1_perror (result);
- printf ("Cannot decode BER data (size %d)\n", size);
+ printf ("Cannot decode BER data (size %ld)\n", size);
exit (1);
}
diff --git a/tests/Test_parser.c b/tests/Test_parser.c
index 534c43f..d0c5c44 100644
--- a/tests/Test_parser.c
+++ b/tests/Test_parser.c
@@ -34,12 +34,12 @@
typedef struct
{
int lineNumber;
- char *line;
+ const char *line;
int errorNumber;
- char *errorDescription;
+ const char *errorDescription;
} test_type;
-char *fileCorrectName;
+const char *fileCorrectName;
char fileErroredName[] = "Test_parser_ERROR.asn";
#define _FILE_ "Test_parser_ERROR.asn"
@@ -107,7 +107,7 @@ test_type test_array[] = {
{0}
};
-int
+static int
readLine (FILE * file, char *line)
{
int c;
@@ -123,9 +123,8 @@ readLine (FILE * file, char *line)
return c;
}
-
-void
-createFile (int lineNumber, char *line)
+static void
+createFile (int lineNumber, const char *line)
{
FILE *fileIn, *fileOut;
char lineRead[1024];
diff --git a/tests/Test_simple.c b/tests/Test_simple.c
index c2a4fc2..9cc6ed9 100644
--- a/tests/Test_simple.c
+++ b/tests/Test_simple.c
@@ -28,9 +28,9 @@
struct tv
{
- size_t bitlen;
+ int bitlen;
const char *bitstr;
- size_t derlen;
+ int derlen;
const char *der;
};
@@ -103,7 +103,8 @@ main (int argc, char *argv[])
{
/* Encode */
- asn1_bit_der (tv[i].bitstr, tv[i].bitlen, der, &der_len);
+ asn1_bit_der ((const unsigned char *) tv[i].bitstr, tv[i].bitlen,
+ der, &der_len);
#if 0
{
@@ -117,7 +118,7 @@ main (int argc, char *argv[])
if (der_len != tv[i].derlen
|| memcmp (der, tv[i].der, der_len) != 0)
{
- fprintf (stderr, "asn1_bit_der iter %d\n", i);
+ fprintf (stderr, "asn1_bit_der iter %ld\n", i);
return 1;
}
@@ -128,7 +129,7 @@ main (int argc, char *argv[])
if (result != ASN1_SUCCESS || ret_len != tv[i].derlen
|| bit_len != tv[i].bitlen)
{
- fprintf (stderr, "asn1_get_bit_der iter %d\n", i);
+ fprintf (stderr, "asn1_get_bit_der iter %ld\n", i);
return 1;
}
}
diff --git a/tests/Test_tree.c b/tests/Test_tree.c
index 2b0065e..fe96af5 100644
--- a/tests/Test_tree.c
+++ b/tests/Test_tree.c
@@ -65,7 +65,7 @@ typedef struct
{
int action;
const char *par1;
- const unsigned char *par2;
+ const char *par2;
int par3;
int errorNumber;
} test_type;
@@ -714,18 +714,18 @@ main (int argc, char *argv[])
case ACT_READ_BIT:
if (test->action == ACT_READ_BIT)
{
- if ((valueLen - (valueLen / 8.0)) == 0)
+ if (valueLen % 8 == 0)
tag = valueLen / 8;
else
tag = (valueLen / 8) + 1;
- if ((test->par3 - (test->par3 / 8.0)) == 0)
+ if (test->par3 % 8 == 0)
class = test->par3 / 8;
else
class = (test->par3 / 8) + 1;
}
for (k = 0; k < class; k++)
- if (test->par2[k] != value[k])
+ if ((unsigned char) test->par2[k] != value[k])
{
k = -1;
break;