diff options
author | Karel Klic <kklic@redhat.com> | 2011-02-04 15:11:04 +0100 |
---|---|---|
committer | Karel Klic <kklic@redhat.com> | 2011-02-04 15:11:04 +0100 |
commit | 7ae7e83314e449f5d7f69be41f1498bf33340d1b (patch) | |
tree | 683e46da30f96e8d598085df3387a64272c0b253 /tests/btparser | |
parent | 236f571db5ec6d0f05891373f518b6d87cedebbe (diff) | |
download | abrt-7ae7e83314e449f5d7f69be41f1498bf33340d1b.tar.gz abrt-7ae7e83314e449f5d7f69be41f1498bf33340d1b.tar.xz abrt-7ae7e83314e449f5d7f69be41f1498bf33340d1b.zip |
btparser: Better normalization of glibc architecture-specific functions.
btparser: New supported format of thread header: "Thread 8 (LWP 6357):"
Diffstat (limited to 'tests/btparser')
-rw-r--r-- | tests/btparser/thread.at | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/btparser/thread.at b/tests/btparser/thread.at index c36b796f..5a3976e3 100644 --- a/tests/btparser/thread.at +++ b/tests/btparser/thread.at @@ -275,6 +275,14 @@ int main(void) " tv_sec = 1273231242, tv_nsec = 190522021}, __unused = {0, 0, 0}}\n", &thread); + /* Another format of the header. */ + check("Thread 3 (LWP 635):\n" + "#0 0x000000322160e7fd in fsync () at ../sysdeps/unix/syscall-template.S:82\n" + "No locals.\n" + "#1 0x000000322222987a in write_to_temp_file () at gfileutils.c:980\n" + "No locals.\n", + &thread); + return 0; } ]]) @@ -347,3 +355,42 @@ int main(void) return 0; } ]]) + +## ------------------- ## +## btp_thread_skip_lwp ## +## ------------------- ## + +AT_TESTFUN([btp_thread_skip_lwp], +[[ +#include <thread.h> +#include <assert.h> +#include <stdlib.h> + +void check(char *input, + int expected_count) +{ + char *old_input = input; + assert(expected_count == btp_thread_skip_lwp(&input)); + assert(input - old_input == expected_count); +} + +int main(void) +{ + check("(LWP 20)", 8); + check("(LWP 20)10", 8); + check("(LWP 245443452355454343450)", 27); + check("(LWP 245443452355454343450) ", 27); + + check("", 0); + check(" ", 0); + check(" (LWP 20)", 0); + check("(LWP", 0); + check("(LWP 20", 0); + check("(LWP )", 0); + check("(LWP 20()", 0); + check("(LWP 0x0)", 0); + check("(LWP 20(", 0); + + return 0; +} +]]) |