2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
|
** the administrator only.
**
** case=1 Issue a fossil_warning() while generating the page.
** case=2 Extra db_begin_transaction()
** case=3 Extra db_end_transaction()
** case=4 Error during SQL processing
** case=5 Call the segfault handler
*/
void test_warning_page(void){
int iCase = atoi(PD("case","0"));
int i;
login_check_credentials();
if( !g.perm.Setup && !g.perm.Admin ){
login_needed(0);
return;
}
style_header("Warning Test Page");
style_submenu_element("Error Log","%R/errorlog");
if( iCase<1 || iCase>4 ){
@ <p>Generate a message to the <a href="%R/errorlog">error log</a>
@ by clicking on one of the following cases:
}else{
@ <p>This is the test page for case=%d(iCase). All possible cases:
}
for(i=1; i<=5; i++){
@ <a href='./test-warning?case=%d(i)'>[%d(i)]</a>
}
@ </p>
@ <p><ol>
@ <li value='1'> Call fossil_warning()
if( iCase==1 ){
fossil_warning("Test warning message from /test-warning");
|
>
>
|
|
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
|
** the administrator only.
**
** case=1 Issue a fossil_warning() while generating the page.
** case=2 Extra db_begin_transaction()
** case=3 Extra db_end_transaction()
** case=4 Error during SQL processing
** case=5 Call the segfault handler
** case=6 Call webpage_assert()
** case=7 Call webpage_error()
*/
void test_warning_page(void){
int iCase = atoi(PD("case","0"));
int i;
login_check_credentials();
if( !g.perm.Setup && !g.perm.Admin ){
login_needed(0);
return;
}
style_header("Warning Test Page");
style_submenu_element("Error Log","%R/errorlog");
if( iCase<1 || iCase>4 ){
@ <p>Generate a message to the <a href="%R/errorlog">error log</a>
@ by clicking on one of the following cases:
}else{
@ <p>This is the test page for case=%d(iCase). All possible cases:
}
for(i=1; i<=7; i++){
@ <a href='./test-warning?case=%d(i)'>[%d(i)]</a>
}
@ </p>
@ <p><ol>
@ <li value='1'> Call fossil_warning()
if( iCase==1 ){
fossil_warning("Test warning message from /test-warning");
|
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
|
sqlite3_log(SQLITE_ERROR, "Test warning message during SQL");
db_finalize(&q);
}
@ <li value='5'> simulate segfault handling
if( iCase==5 ){
sigsegv_handler(0);
}
@ </ol>
@ <p>End of test</p>
style_footer();
}
|
>
>
>
>
>
>
>
>
>
|
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
|
sqlite3_log(SQLITE_ERROR, "Test warning message during SQL");
db_finalize(&q);
}
@ <li value='5'> simulate segfault handling
if( iCase==5 ){
sigsegv_handler(0);
}
@ <li value='6'> call webpage_assert(0)
if( iCase==6 ){
webpage_assert( 5==7 );
}
@ <li value='7'> call webpage_error()"
if( iCase==7 ){
cgi_reset_content();
webpage_error("Case 7 from /test-warning");
}
@ </ol>
@ <p>End of test</p>
style_footer();
}
|