Fossil SCM
Add a segfault simulator to the test-warning page.
Commit
c4dcb00dcc5f4a5b1e5dfecdaba1686add4b962519790c8bee93dac82d990018
Parent
cc8c33ee8aff995…
1 file changed
+7
-1
+7
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -2794,10 +2794,12 @@ | ||
| 2794 | 2794 | ** the administrator only. |
| 2795 | 2795 | ** |
| 2796 | 2796 | ** case=1 Issue a fossil_warning() while generating the page. |
| 2797 | 2797 | ** case=2 Extra db_begin_transaction() |
| 2798 | 2798 | ** case=3 Extra db_end_transaction() |
| 2799 | +** case=4 Error during SQL processing | |
| 2800 | +** case=5 Call the segfault handler | |
| 2799 | 2801 | */ |
| 2800 | 2802 | void test_warning_page(void){ |
| 2801 | 2803 | int iCase = atoi(PD("case","0")); |
| 2802 | 2804 | int i; |
| 2803 | 2805 | login_check_credentials(); |
| @@ -2811,11 +2813,11 @@ | ||
| 2811 | 2813 | @ <p>Generate a message to the <a href="%R/errorlog">error log</a> |
| 2812 | 2814 | @ by clicking on one of the following cases: |
| 2813 | 2815 | }else{ |
| 2814 | 2816 | @ <p>This is the test page for case=%d(iCase). All possible cases: |
| 2815 | 2817 | } |
| 2816 | - for(i=1; i<=4; i++){ | |
| 2818 | + for(i=1; i<=5; i++){ | |
| 2817 | 2819 | @ <a href='./test-warning?case=%d(i)'>[%d(i)]</a> |
| 2818 | 2820 | } |
| 2819 | 2821 | @ </p> |
| 2820 | 2822 | @ <p><ol> |
| 2821 | 2823 | @ <li value='1'> Call fossil_warning() |
| @@ -2835,10 +2837,14 @@ | ||
| 2835 | 2837 | Stmt q; |
| 2836 | 2838 | db_prepare(&q, "SELECT uuid FROM blob LIMIT 5"); |
| 2837 | 2839 | db_step(&q); |
| 2838 | 2840 | sqlite3_log(SQLITE_ERROR, "Test warning message during SQL"); |
| 2839 | 2841 | db_finalize(&q); |
| 2842 | + } | |
| 2843 | + @ <li value='5'> simulate segfault handling | |
| 2844 | + if( iCase==5 ){ | |
| 2845 | + sigsegv_handler(0); | |
| 2840 | 2846 | } |
| 2841 | 2847 | @ </ol> |
| 2842 | 2848 | @ <p>End of test</p> |
| 2843 | 2849 | style_footer(); |
| 2844 | 2850 | } |
| 2845 | 2851 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2794,10 +2794,12 @@ | |
| 2794 | ** the administrator only. |
| 2795 | ** |
| 2796 | ** case=1 Issue a fossil_warning() while generating the page. |
| 2797 | ** case=2 Extra db_begin_transaction() |
| 2798 | ** case=3 Extra db_end_transaction() |
| 2799 | */ |
| 2800 | void test_warning_page(void){ |
| 2801 | int iCase = atoi(PD("case","0")); |
| 2802 | int i; |
| 2803 | login_check_credentials(); |
| @@ -2811,11 +2813,11 @@ | |
| 2811 | @ <p>Generate a message to the <a href="%R/errorlog">error log</a> |
| 2812 | @ by clicking on one of the following cases: |
| 2813 | }else{ |
| 2814 | @ <p>This is the test page for case=%d(iCase). All possible cases: |
| 2815 | } |
| 2816 | for(i=1; i<=4; i++){ |
| 2817 | @ <a href='./test-warning?case=%d(i)'>[%d(i)]</a> |
| 2818 | } |
| 2819 | @ </p> |
| 2820 | @ <p><ol> |
| 2821 | @ <li value='1'> Call fossil_warning() |
| @@ -2835,10 +2837,14 @@ | |
| 2835 | Stmt q; |
| 2836 | db_prepare(&q, "SELECT uuid FROM blob LIMIT 5"); |
| 2837 | db_step(&q); |
| 2838 | sqlite3_log(SQLITE_ERROR, "Test warning message during SQL"); |
| 2839 | db_finalize(&q); |
| 2840 | } |
| 2841 | @ </ol> |
| 2842 | @ <p>End of test</p> |
| 2843 | style_footer(); |
| 2844 | } |
| 2845 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2794,10 +2794,12 @@ | |
| 2794 | ** the administrator only. |
| 2795 | ** |
| 2796 | ** case=1 Issue a fossil_warning() while generating the page. |
| 2797 | ** case=2 Extra db_begin_transaction() |
| 2798 | ** case=3 Extra db_end_transaction() |
| 2799 | ** case=4 Error during SQL processing |
| 2800 | ** case=5 Call the segfault handler |
| 2801 | */ |
| 2802 | void test_warning_page(void){ |
| 2803 | int iCase = atoi(PD("case","0")); |
| 2804 | int i; |
| 2805 | login_check_credentials(); |
| @@ -2811,11 +2813,11 @@ | |
| 2813 | @ <p>Generate a message to the <a href="%R/errorlog">error log</a> |
| 2814 | @ by clicking on one of the following cases: |
| 2815 | }else{ |
| 2816 | @ <p>This is the test page for case=%d(iCase). All possible cases: |
| 2817 | } |
| 2818 | for(i=1; i<=5; i++){ |
| 2819 | @ <a href='./test-warning?case=%d(i)'>[%d(i)]</a> |
| 2820 | } |
| 2821 | @ </p> |
| 2822 | @ <p><ol> |
| 2823 | @ <li value='1'> Call fossil_warning() |
| @@ -2835,10 +2837,14 @@ | |
| 2837 | Stmt q; |
| 2838 | db_prepare(&q, "SELECT uuid FROM blob LIMIT 5"); |
| 2839 | db_step(&q); |
| 2840 | sqlite3_log(SQLITE_ERROR, "Test warning message during SQL"); |
| 2841 | db_finalize(&q); |
| 2842 | } |
| 2843 | @ <li value='5'> simulate segfault handling |
| 2844 | if( iCase==5 ){ |
| 2845 | sigsegv_handler(0); |
| 2846 | } |
| 2847 | @ </ol> |
| 2848 | @ <p>End of test</p> |
| 2849 | style_footer(); |
| 2850 | } |
| 2851 |