aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2014-02-06 22:02:40 -0500
committerJukka Jylänki <jujjyl@gmail.com>2014-02-06 22:02:40 -0500
commit831bb584a91f5409af5df3c44f1bc8dc354ff0d8 (patch)
tree498e496abadd195c9451c745c7b24af1e1f92b62
parent25fcd51cd5c5f06fbfba6c07b00904e32c440b87 (diff)
Fix test_strcmp_uni and test_dlfcn_stacks after previous commit.
-rw-r--r--tests/core/test_strcmp_uni.out6
-rw-r--r--tests/test_core.py7
2 files changed, 9 insertions, 4 deletions
diff --git a/tests/core/test_strcmp_uni.out b/tests/core/test_strcmp_uni.out
index 58e237d7..ebfe2c8e 100644
--- a/tests/core/test_strcmp_uni.out
+++ b/tests/core/test_strcmp_uni.out
@@ -1,3 +1,3 @@
-Compare value strncmp is -1
-Compare value strncasecmp is -1
-Compare value memcmp is -1
+Compare value strncmp is -108
+Compare value strncasecmp is -76
+Compare value memcmp is -108
diff --git a/tests/test_core.py b/tests/test_core.py
index 55aeb697..eda5c8ff 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -3258,6 +3258,7 @@ def process(filename):
#include <assert.h>
#include <stdio.h>
#include <dlfcn.h>
+ #include <string.h>
typedef int (*FUNCTYPE)(const char *);
@@ -3268,6 +3269,10 @@ def process(filename):
snprintf(str, sizeof(str), "foobar");
+ // HACK: Use strcmp in the main executable so that it doesn't get optimized out and the dynamic library
+ // is able to use it.
+ assert(!strcmp(str, "foobar"));
+
lib_handle = dlopen("liblib.so", RTLD_NOW);
assert(lib_handle != NULL);
@@ -3280,7 +3285,7 @@ def process(filename):
return 0;
}
'''
- Settings.EXPORTED_FUNCTIONS = ['_main', '_malloc']
+ Settings.EXPORTED_FUNCTIONS = ['_main', '_malloc', '_strcmp']
self.do_run(src, 'success', force_c=True, post_build=self.dlfcn_post_build)
def test_dlfcn_funcs(self):