diff options
author | Jiri Olsa <Jiri Olsa jolsa@redhat.com> | 2011-05-24 23:43:20 +0200 |
---|---|---|
committer | Jiri Olsa <Jiri Olsa jolsa@redhat.com> | 2011-05-25 12:45:51 +0200 |
commit | c07613777f463ff09145816656067313329dd592 (patch) | |
tree | 60391254808585fcb46bc97ee547ce92fa3f8a54 | |
parent | 56798f25922db3299e11418e9114329006a498ab (diff) | |
download | latrace-c07613777f463ff09145816656067313329dd592.tar.gz latrace-c07613777f463ff09145816656067313329dd592.tar.xz latrace-c07613777f463ff09145816656067313329dd592.zip |
fix test_[short|int|long] tests
- removed the complex math from test_[short|int]_* functions
and return simple numbers, it's easier to debug
- kept and simplified math for test_long
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | test/lib-test-args.c | 52 | ||||
-rw-r--r-- | test/sysdeps/i686/test-args.c | 16 | ||||
-rw-r--r-- | test/sysdeps/x86_64/test-args.c | 16 |
4 files changed, 43 insertions, 43 deletions
@@ -2,7 +2,7 @@ * args - use isprint to decide whether to print the character, force test.sh to use bash (contributed by Dr. David Alan Gilbert <david.gilbert@linaro.org>) - * fix test_char tests + * fix test_[char|short|int|long] tests 2011-05-13 Jiri Olsa <olsajiri@gmail.com> * build fix for ARM diff --git a/test/lib-test-args.c b/test/lib-test-args.c index 865d675..a55bd20 100644 --- a/test/lib-test-args.c +++ b/test/lib-test-args.c @@ -46,92 +46,92 @@ char test_char_9(char a, char b, char c, char d, char e, char f, char g, char h, short test_short_1(short a) { - return -a; + return -100; } short test_short_2(short a, short b) { - return a + b; + return 30; } short test_short_3(short a, short b, short c) { - return a + b - c; + return -8; } short test_short_4(short a, short b, short c, short d) { - return a + b * c + d; + return 2097; } short test_short_5(short a, short b, short c, short d, short e) { - return a + b - c + d * e; + return 1583; } short test_short_6(short a, short b, short c, short d, short e, short f) { - return a * b * c + d * e - f; + return -25344; } short test_short_7(short a, short b, short c, short d, short e, short f, short g) { - return a / b + c + d * e - f * g; + return -19; } short test_short_8(short a, short b, short c, short d, short e, short f, short g, short h) { - return a + b + c + d + e + f + g + h; + return 3134; } short test_short_9(short a, short b, short c, short d, short e, short f, short g, short h, short i) { - return a - b - c - d - e - f - g - h - i; + return -2482; } int test_int_1(int a) { - return -a; + return -100; } int test_int_2(int a, int b) { - return a + b; + return 30; } int test_int_3(int a, int b, int c) { - return a + b - c; + return -8; } int test_int_4(int a, int b, int c, int d) { - return a + b * c + d; + return 200997; } int test_int_5(int a, int b, int c, int d, int e) { - return a + b - c + d * e; + return -2144725863; } int test_int_6(int a, int b, int c, int d, int e, int f) { - return a * b * c + d * e - f; + return -1223446720; } int test_int_7(int a, int b, int c, int d, int e, int f, int g) { - return a / b + c + d * e - f * g; + return -19; } int test_int_8(int a, int b, int c, int d, int e, int f, int g, int h) { - return a + b + c + d + e + f + g + h; + return 214322534; } int test_int_9(int a, int b, int c, int d, int e, int f, int g, int h, int i) { - return a - b - c - d - e - f - g - h - i; + return -2482; } long test_long_1(long a) @@ -141,40 +141,40 @@ long test_long_1(long a) long test_long_2(long a, long b) { - return a + b; + return a * b; } long test_long_3(long a, long b, long c) { - return a + b - c; + return a * b * c; } long test_long_4(long a, long b, long c, long d) { - return a + b * c + d; + return a * b * c * d; } long test_long_5(long a, long b, long c, long d, long e) { - return a + b - c + d * e; + return a * b * c * d * e; } long test_long_6(long a, long b, long c, long d, long e, long f) { - return a * b * c + d * e - f; + return a * b * c * d * e * f; } long test_long_7(long a, long b, long c, long d, long e, long f, long g) { - return a / b + c + d * e - f * g; + return a * b * c * d * e * f * g; } long test_long_8(long a, long b, long c, long d, long e, long f, long g, long h) { - return a + b + c + d + e + f + g + h; + return 0; } long test_long_9(long a, long b, long c, long d, long e, long f, long g, long h, long i) { - return a - b - c - d - e - f - g - h - i; + return a * b * c * d * e * f * g * h * i; } diff --git a/test/sysdeps/i686/test-args.c b/test/sysdeps/i686/test-args.c index f19a064..6e748d8 100644 --- a/test/sysdeps/i686/test-args.c +++ b/test/sysdeps/i686/test-args.c @@ -11,42 +11,42 @@ int test_long(struct lt_config_shared *sh) struct re_test_data data2[] = { { RE_TEST_TYPE_STR, 0, 39, "test_long_2\\(a = 123410, b = -268435455\\)" }, { RE_TEST_TYPE_STR, 40, -1, "\\[.*lib-test-args.so\\] \\{" }, - { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_2 = -268312045" }, + { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_2 = -536747502" }, }; struct re_test_data data3[] = { { RE_TEST_TYPE_STR, 0, 38, "test_long_3\\(a = 1, b = -2, c = 234217\\)" }, { RE_TEST_TYPE_STR, 39, -1, "\\[.*lib-test-args.so\\] \\{" }, - { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_3 = -234218" }, + { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_3 = -468434" }, }; struct re_test_data data4[] = { { RE_TEST_TYPE_STR, 0, 55, "test_long_4\\(a = 2025479151, b = 2, c = 9119999, d = -1\\)" }, { RE_TEST_TYPE_STR, 56, -1, "\\[.*lib-test-args.so\\] \\{" }, - { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_4 = 2043719148" }, + { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_4 = 1786259934" }, }; struct re_test_data data5[] = { { RE_TEST_TYPE_STR, 0, 63, "test_long_5\\(a = -1, b = 2147483647, c = 13, d = 100, e = 34121\\)" }, { RE_TEST_TYPE_STR, 64, -1, "\\[.*lib-test-args.so\\] \\{" }, - { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_5 = -2144071563" }, + { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_5 = 44357300" }, }; struct re_test_data data6[] = { { RE_TEST_TYPE_STR, 0, 79, "test_long_6\\(a = 100, b = 102143210, c = -345436543, d = 12, e = -45, f = -1324\\)" }, { RE_TEST_TYPE_STR, 80, -1, "\\[.*lib-test-args.so\\] \\{" }, - { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_6 = -1913679240" }, + { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_6 = 111854720" }, }; struct re_test_data data7[] = { { RE_TEST_TYPE_STR, 0, 71, "test_long_7\\(a = 1, b = 24321, c = -3, d = 4, e = 432145, f = 6, g = 27\\)" }, { RE_TEST_TYPE_STR, 72, -1, "\\[.*lib-test-args.so\\] \\{" }, - { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_7 = 1728415" }, + { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_7 = -666544408" }, }; struct re_test_data data8[] = { { RE_TEST_TYPE_STR, 0, 96, "test_long_8\\(a = -11111, b = 214321543, c = 30, d = -4, e = 51432123, f = -123, g = 7000, h = 76\\)" }, { RE_TEST_TYPE_STR, 97, -1, "\\[.*lib-test-args.so\\] \\{" }, - { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_8 = 265749534" }, + { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_8 = 0" }, }; struct re_test_data data9[] = { { RE_TEST_TYPE_STR, 0, 93, "test_long_9\\(a = -10, b = 1, c = 3, d = 12424234, e = 9, f = 3, g = 14321311, h = -99, i = 10\\)" }, { RE_TEST_TYPE_STR, 94, -1, "\\[.*lib-test-args.so\\] \\{" }, - { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_9 = -26745482" }, + { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_9 = 1488062792" }, }; #define DATA_CNT(num) (sizeof(data ## num)/sizeof(struct re_test_data)) diff --git a/test/sysdeps/x86_64/test-args.c b/test/sysdeps/x86_64/test-args.c index b05f084..eeee439 100644 --- a/test/sysdeps/x86_64/test-args.c +++ b/test/sysdeps/x86_64/test-args.c @@ -11,42 +11,42 @@ int test_long(struct lt_config_shared *sh) struct re_test_data data2[] = { { RE_TEST_TYPE_STR, 0, 47, "test_long_2\\(a = 123410, b = -12391243214298120\\)" }, { RE_TEST_TYPE_STR, 48, -1, "\\[.*lib-test-args.so\\] \\{" }, - { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_2 = -12391243214174710" }, + { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_2 = 1876433041361794928" }, }; struct re_test_data data3[] = { { RE_TEST_TYPE_STR, 0, 38, "test_long_3\\(a = 1, b = -2, c = 234217\\)" }, { RE_TEST_TYPE_STR, 39, -1, "\\[.*lib-test-args.so\\] \\{" }, - { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_3 = -234218" }, + { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_3 = -468434" }, }; struct re_test_data data4[] = { { RE_TEST_TYPE_STR, 0, 61, "test_long_4\\(a = 1999990880043210, b = 2, c = 9119999, d = -1\\)" }, { RE_TEST_TYPE_STR, 62, -1, "\\[.*lib-test-args.so\\] \\{" }, - { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_4 = 1999990898283207" }, + { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_4 = 7830125791102782868" }, }; struct re_test_data data5[] = { { RE_TEST_TYPE_STR, 0, 63, "test_long_5\\(a = -1, b = 2147483647, c = 13, d = 100, e = 34121\\)" }, { RE_TEST_TYPE_STR, 64, -1, "\\[.*lib-test-args.so\\] \\{" }, - { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_5 = 2150895733" }, + { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_5 = -95256576375073100" }, }; struct re_test_data data6[] = { { RE_TEST_TYPE_STR, 0, 91, "test_long_6\\(a = 100, b = 20432143210, c = -345436543, d = 12, e = 9999999999999, f = -1324\\)" }, { RE_TEST_TYPE_STR, 92, -1, "\\[.*lib-test-args.so\\] \\{" }, - { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_6 = -4824496853369340280" }, + { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_6 = -4763653747676887424" }, }; struct re_test_data data7[] = { { RE_TEST_TYPE_STR, 0, 71, "test_long_7\\(a = 1, b = 24321, c = -3, d = 4, e = 432145, f = 6, g = 27\\)" }, { RE_TEST_TYPE_STR, 72, -1, "\\[.*lib-test-args.so\\] \\{" }, - { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_7 = 1728415" }, + { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_7 = -20431825971480" }, }; struct re_test_data data8[] = { { RE_TEST_TYPE_STR, 0, 96, "test_long_8\\(a = -11111, b = 214321543, c = 30, d = -4, e = 51432123, f = -123, g = 7000, h = 76\\)" }, { RE_TEST_TYPE_STR, 97, -1, "\\[.*lib-test-args.so\\] \\{" }, - { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_8 = 265749534" }, + { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_8 = 0" }, }; struct re_test_data data9[] = { { RE_TEST_TYPE_STR, 0, 100, "test_long_9\\(a = -10, b = 1, c = 3, d = 124321432234134, e = 9, f = 3, g = 14321311, h = -99, i = 10\\)" }, { RE_TEST_TYPE_STR, 101, -1, "\\[.*lib-test-args.so\\] \\{" }, - { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_9 = -124321446555382" }, + { RE_TEST_TYPE_STR, -1, -1, "\\} test_long_9 = -3544365624466803272" }, }; #define DATA_CNT(num) (sizeof(data ## num)/sizeof(struct re_test_data)) |