projects
/
yaffs2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More test tweaks
[yaffs2.git]
/
direct
/
tests
/
yaffs_test.c
diff --git
a/direct/tests/yaffs_test.c
b/direct/tests/yaffs_test.c
index 3b0e62a9ba50dde7e82cc09c12005392fa3d761e..f9fd564bcce9e13ea76b0c78dc35a31c16488352 100644
(file)
--- a/
direct/tests/yaffs_test.c
+++ b/
direct/tests/yaffs_test.c
@@
-19,13
+19,14
@@
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
+#include <signal.h>
#include "yaffsfs.h"
#include "nor_stress.h"
#include "yaffs_fsx.h"
#include "yaffsfs.h"
#include "nor_stress.h"
#include "yaffs_fsx.h"
-
+void (*ext_fatal)(void);
int random_seed;
int random_seed;
@@
-55,11
+56,28
@@
void BadUsage(void)
exit(2);
}
exit(2);
}
+void test_fatal(void)
+{
+ printf("fatal yaffs test pid %d sleeping\n",getpid());
+ while(1)
+ sleep(1);
+
+}
+
+void bad_ptr_handler(int sig)
+{
+ printf("signal %d received\n",sig);
+ test_fatal();
+}
int main(int argc, char **argv)
{
int ch;
int main(int argc, char **argv)
{
int ch;
-
+ ext_fatal = test_fatal;
+ signal(SIGSEGV,bad_ptr_handler);
+ signal(SIGBUS,bad_ptr_handler);
+ signal(SIGABRT,bad_ptr_handler);
+
while ((ch = getopt(argc,argv, "filn:ps:u"))
!= EOF)
switch (ch) {
while ((ch = getopt(argc,argv, "filn:ps:u"))
!= EOF)
switch (ch) {