2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
|
**
** Test error and warning log operation. This webpage is accessible to
** 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()
*/
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<=4; 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");
|
>
>
|
|
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
|
**
** Test error and warning log operation. This webpage is accessible to
** 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");
|
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
|
@ <li value='4'> warning during SQL
if( iCase==4 ){
Stmt q;
db_prepare(&q, "SELECT uuid FROM blob LIMIT 5");
db_step(&q);
sqlite3_log(SQLITE_ERROR, "Test warning message during SQL");
db_finalize(&q);
}
@ </ol>
@ <p>End of test</p>
style_footer();
}
|
>
>
>
>
|
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
|
@ <li value='4'> warning during SQL
if( iCase==4 ){
Stmt q;
db_prepare(&q, "SELECT uuid FROM blob LIMIT 5");
db_step(&q);
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();
}
|