]> granicus.if.org Git - postgresql/blobdiff - src/test/modules/test_rls_hooks/test_rls_hooks.c
Fix more strcmp() calls using boolean-like comparisons for result checks
[postgresql] / src / test / modules / test_rls_hooks / test_rls_hooks.c
index 8bf8f764ac31a7016fb53c43052d74e8915e44c9..10379bc59c0ecae89fef85391d0bc63baa868966 100644 (file)
@@ -75,8 +75,8 @@ test_rls_hooks_permissive(CmdType cmdtype, Relation relation)
        ParseState *qual_pstate;
        RangeTblEntry *rte;
 
-       if (strcmp(RelationGetRelationName(relation), "rls_test_permissive")
-               && strcmp(RelationGetRelationName(relation), "rls_test_both"))
+       if (strcmp(RelationGetRelationName(relation), "rls_test_permissive") != 0 &&
+               strcmp(RelationGetRelationName(relation), "rls_test_both") != 0)
                return NIL;
 
        qual_pstate = make_parsestate(NULL);
@@ -140,8 +140,8 @@ test_rls_hooks_restrictive(CmdType cmdtype, Relation relation)
        RangeTblEntry *rte;
 
 
-       if (strcmp(RelationGetRelationName(relation), "rls_test_restrictive")
-               && strcmp(RelationGetRelationName(relation), "rls_test_both"))
+       if (strcmp(RelationGetRelationName(relation), "rls_test_restrictive") != 0 &&
+               strcmp(RelationGetRelationName(relation), "rls_test_both") != 0)
                return NIL;
 
        qual_pstate = make_parsestate(NULL);