File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44<def format="2">
55 <define name="TRUE" value="(!FALSE)"/>
66 <define name="FALSE" value="(0)"/>
7- <define name="g_return_if_fail(expr)" value="do{if(!(expr)){return;}}while(0); "/>
8- <define name="g_return_val_if_fail(expr,val)" value="do{if(!(expr)){return (val);}}while(0); "/>
9- <define name="g_return_if_reached()" value="do{return;}while(0); "/>
10- <define name="g_return_val_if_reached(val)" value="do{return (val);}while(0); "/>
7+ <define name="g_return_if_fail(expr)" value="do{if(!(expr)){return;}}while(0)"/>
8+ <define name="g_return_val_if_fail(expr,val)" value="do{if(!(expr)){return (val);}}while(0)"/>
9+ <define name="g_return_if_reached()" value="do{return;}while(0)"/>
10+ <define name="g_return_val_if_reached(val)" value="do{return (val);}while(0)"/>
1111 <define name="G_CALLBACK(cb)" value="cb"/>
1212 <define name="GTK_SIGNAL_FUNC(f)" value="G_CALLBACK(f)"/>
1313 <define name="G_DIR_SEPARATOR_S" value=""/""/>
Original file line number Diff line number Diff line change @@ -596,3 +596,43 @@ void gtk_widget_destroy_test() {
596596 // cppcheck-suppress mismatchAllocDealloc
597597 g_object_unref (widget );
598598}
599+
600+ void g_return_if_fail_test (const char * s ) {
601+ // cppcheck-suppress valueFlowBailout
602+ g_return_if_fail (s );
603+
604+ if (* s )
605+ // cppcheck-suppress valueFlowBailout
606+ g_return_if_fail (* s == 'a' );
607+ else
608+ g_info ("Test the else branch can be parsed" );
609+ }
610+
611+ int g_return_val_if_fail_test (const char * s ) {
612+ // cppcheck-suppress valueFlowBailout
613+ g_return_val_if_fail (s , 1 );
614+
615+ if (* s )
616+ // cppcheck-suppress valueFlowBailout
617+ g_return_val_if_fail (* s == 'a' , 1 );
618+ else
619+ g_info ("Test the else branch can be parsed" );
620+
621+ return 0 ;
622+ }
623+
624+ void g_return_if_reached_test (const char * s ) {
625+ if (s )
626+ g_return_if_reached ();
627+ else
628+ g_info ("Test the else branch can be parsed" );
629+ }
630+
631+ int g_return_val_if_reached_test (const char * s ) {
632+ if (s )
633+ g_return_val_if_reached (1 );
634+ else
635+ g_info ("Test the else branch can be parsed" );
636+
637+ return 0 ;
638+ }
You can’t perform that action at this time.
0 commit comments