aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2014-05-21 08:31:08 +0300
committerJukka Jylänki <jujjyl@gmail.com>2014-05-21 08:31:08 +0300
commit57ed92d565981c4f6d796c980b2530f0b47ee72b (patch)
tree5b69dffef9b04ff4f16aa524e9fbb2e89be108f2
parentbf1c3dff114fd2387fa5a0834b065a76d10c156e (diff)
Fix test breakages in s_* suites after musl_charfuncs merge.
-rw-r--r--system/lib/libc/musl/src/compat/strlwr.c4
-rw-r--r--system/lib/libc/musl/src/compat/strupr.c4
-rw-r--r--tests/test_core.py7
3 files changed, 13 insertions, 2 deletions
diff --git a/system/lib/libc/musl/src/compat/strlwr.c b/system/lib/libc/musl/src/compat/strlwr.c
index 90d6c106..7c70a948 100644
--- a/system/lib/libc/musl/src/compat/strlwr.c
+++ b/system/lib/libc/musl/src/compat/strlwr.c
@@ -1,10 +1,12 @@
#include <ctype.h>
-void strlwr(char *str)
+char *strlwr(char *str)
{
+ char *ret = str;
while(*str)
{
*str = tolower(*str);
++str;
}
+ return ret;
}
diff --git a/system/lib/libc/musl/src/compat/strupr.c b/system/lib/libc/musl/src/compat/strupr.c
index 2b1d97bb..469ad8b1 100644
--- a/system/lib/libc/musl/src/compat/strupr.c
+++ b/system/lib/libc/musl/src/compat/strupr.c
@@ -1,10 +1,12 @@
#include <ctype.h>
-void strupr(char *str)
+char *strupr(char *str)
{
+ char *ret = str;
while(*str)
{
*str = toupper(*str);
++str;
}
+ return ret;
}
diff --git a/tests/test_core.py b/tests/test_core.py
index ec5bb9fe..7c317894 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -971,6 +971,7 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
self.do_run_from_file(src, output)
def test_strings(self):
+ if Settings.USE_TYPED_ARRAYS != 2: return self.skip('musl libc needs ta2')
test_path = path_from_root('tests', 'core', 'test_strings')
src, output = (test_path + s for s in ('.in', '.out'))
@@ -2466,6 +2467,7 @@ The current type of b is: 9
self.do_run_from_file(src, output)
def test_strtol_hex(self):
+ if self.run_name.startswith('s_'): return self.skip('Needs musl libc.')
# tests strtoll for hex strings (0x...)
test_path = path_from_root('tests', 'core', 'test_strtol_hex')
src, output = (test_path + s for s in ('.in', '.out'))
@@ -2473,6 +2475,7 @@ The current type of b is: 9
self.do_run_from_file(src, output)
def test_strtol_dec(self):
+ if self.run_name.startswith('s_'): return self.skip('Needs musl libc.')
# tests strtoll for decimal strings (0x...)
test_path = path_from_root('tests', 'core', 'test_strtol_dec')
src, output = (test_path + s for s in ('.in', '.out'))
@@ -2480,6 +2483,7 @@ The current type of b is: 9
self.do_run_from_file(src, output)
def test_strtol_bin(self):
+ if self.run_name.startswith('s_'): return self.skip('Needs musl libc.')
# tests strtoll for binary strings (0x...)
test_path = path_from_root('tests', 'core', 'test_strtol_bin')
src, output = (test_path + s for s in ('.in', '.out'))
@@ -2487,6 +2491,7 @@ The current type of b is: 9
self.do_run_from_file(src, output)
def test_strtol_oct(self):
+ if self.run_name.startswith('s_'): return self.skip('Needs musl libc.')
# tests strtoll for decimal strings (0x...)
test_path = path_from_root('tests', 'core', 'test_strtol_oct')
src, output = (test_path + s for s in ('.in', '.out'))
@@ -3718,6 +3723,7 @@ int main()
self.do_run(src, expected)
def test_transtrcase(self):
+ if Settings.USE_TYPED_ARRAYS != 2: return self.skip('musl libc needs ta2')
test_path = path_from_root('tests', 'core', 'test_transtrcase')
src, output = (test_path + s for s in ('.in', '.out'))
@@ -4613,6 +4619,7 @@ int main(void) {
### 'Medium' tests
def test_fannkuch(self):
+ if Settings.USE_TYPED_ARRAYS != 2: return self.skip('musl libc needs ta2')
try:
if self.run_name == 'slow2' or self.run_name == 'slow2asm':
old_target = os.environ.get('EMCC_LLVM_TARGET') or ''