diff options
author | Yves-Alexis Perez <corsac@debian.org> | 2014-03-27 21:11:12 +0100 |
---|---|---|
committer | Yves-Alexis Perez <corsac@debian.org> | 2014-04-02 21:17:46 +0200 |
commit | 30fdd655491ddae3b8a998ad6e60ae84e87fa973 (patch) | |
tree | a83f2a6302e175e257e083c0ceb445c831f08e28 /debian/patches | |
parent | a6e205d014557688e42905bdf48caec9922b44fe (diff) | |
download | vyos-strongswan-30fdd655491ddae3b8a998ad6e60ae84e87fa973.tar.gz vyos-strongswan-30fdd655491ddae3b8a998ad6e60ae84e87fa973.zip |
debian/patches/ 02_unit-tests-Fix-filtered-enumerator-tests-on-64-bit-b.patch added, fix testsuite failing on 64 bit big-endian platforms (s390x).
Diffstat (limited to 'debian/patches')
-rw-r--r-- | debian/patches/02_unit-tests-Fix-filtered-enumerator-tests-on-64-bit-b.patch | 77 | ||||
-rw-r--r-- | debian/patches/series | 1 |
2 files changed, 78 insertions, 0 deletions
diff --git a/debian/patches/02_unit-tests-Fix-filtered-enumerator-tests-on-64-bit-b.patch b/debian/patches/02_unit-tests-Fix-filtered-enumerator-tests-on-64-bit-b.patch new file mode 100644 index 000000000..beeb9e655 --- /dev/null +++ b/debian/patches/02_unit-tests-Fix-filtered-enumerator-tests-on-64-bit-b.patch @@ -0,0 +1,77 @@ +From 0462304dbb5a9eba56a782d5da1f9ab71571ee40 Mon Sep 17 00:00:00 2001 +From: Tobias Brunner <tobias@strongswan.org> +Date: Thu, 27 Mar 2014 15:35:32 +0100 +Subject: [PATCH] unit-tests: Fix filtered enumerator tests on 64-bit + big-endian platforms + +In case of sizeof(void*) == 8 and sizeof(int) == 4 on big-endian hosts +the tests failed as the actual integer value got cut off. +--- + src/libstrongswan/tests/suites/test_enumerator.c | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +diff --git a/src/libstrongswan/tests/suites/test_enumerator.c b/src/libstrongswan/tests/suites/test_enumerator.c +index b5dde46..9bd6d24 100644 +--- a/src/libstrongswan/tests/suites/test_enumerator.c ++++ b/src/libstrongswan/tests/suites/test_enumerator.c +@@ -104,10 +104,10 @@ static void destroy_data(void *data) + * filtered test + */ + +-static bool filter(void *data, int *v, int *vo, int *w, int *wo, +- int *x, int *xo, int *y, int *yo, int *z, int *zo) ++static bool filter(int *data, int **v, int *vo, int **w, int *wo, ++ int **x, int *xo, int **y, int *yo, int **z, int *zo) + { +- int val = *v; ++ int val = **v; + + *vo = val++; + *wo = val++; +@@ -118,21 +118,21 @@ static bool filter(void *data, int *v, int *vo, int *w, int *wo, + return TRUE; + } + +-static bool filter_odd(void *data, int *item, int *out) ++static bool filter_odd(void *data, int **item, int *out) + { + fail_if(data != (void*)101, "data does not match '101' in filter function"); +- *out = *item; +- return *item % 2 == 0; ++ *out = **item; ++ return **item % 2 == 0; + } + + START_TEST(test_filtered) + { +- int round, v, w, x, y, z; ++ int data[5] = {1,2,3,4,5}, round, v, w, x, y, z; + linked_list_t *list; + enumerator_t *enumerator; + +- list = linked_list_create_with_items((void*)1, (void*)2, (void*)3, (void*)4, +- (void*)5, NULL); ++ list = linked_list_create_with_items(&data[0], &data[1], &data[2], &data[3], ++ &data[4], NULL); + + round = 1; + enumerator = enumerator_create_filter(list->create_enumerator(list), +@@ -155,12 +155,12 @@ END_TEST + + START_TEST(test_filtered_filter) + { +- int count, x; ++ int data[5] = {1,2,3,4,5}, count, x; + linked_list_t *list; + enumerator_t *enumerator; + +- list = linked_list_create_with_items((void*)1, (void*)2, (void*)3, (void*)4, +- (void*)5, NULL); ++ list = linked_list_create_with_items(&data[0], &data[1], &data[2], &data[3], ++ &data[4], NULL); + + count = 0; + /* should also work without destructor, so set this manually */ +-- +1.9.1 + diff --git a/debian/patches/series b/debian/patches/series index 2cf256b6c..06fa1b5d0 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ 01_fix-manpages.patch +02_unit-tests-Fix-filtered-enumerator-tests-on-64-bit-b.patch |