Skip to contentSkip to conversation

tests/qtest/qmp-cmd-test: Use inclusive language

PATCH Superseded Thomas Huth 4 participants 4 messages Sep 12, 2020 – Sep 14, 2020

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/qtest/qmp-cmd-test: Use inclusive language

We simply want to ignore certain queries here, so let's rather use the term 'ignore' to express this intention.

---
 tests/qtest/qmp-cmd-test.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
tests/qtest/qmp-cmd-test.c +5 -5
index 3109a9fe96..18069a82fa 100644
@@ -82,9 +82,9 @@ static void test_query(const void *data)
     qtest_quit(qts);
 }
 
-static bool query_is_blacklisted(const char *cmd)
+static bool ignore_query(const char *cmd)
 {
-    const char *blacklist[] = {
+    const char *ignorelist[] = {
         /* Not actually queries: */
         "add-fd",
         /* Success depends on target arch: */
@@ -101,8 +101,8 @@ static bool query_is_blacklisted(const char *cmd)
     };
     int i;
 
-    for (i = 0; blacklist[i]; i++) {
-        if (!strcmp(cmd, blacklist[i])) {
+    for (i = 0; ignorelist[i]; i++) {
+        if (!strcmp(cmd, ignorelist[i])) {
             return true;
         }
     }
@@ -179,7 +179,7 @@ static void add_query_tests(QmpSchema *schema)
             continue;
         }
 
-        if (query_is_blacklisted(si->name)) {
+        if (ignore_query(si->name)) {
             continue;
         }
 
Signature · 1 line
2.18.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Thomas Huth

We simply want to ignore certain queries here, so let's rather use the term 'ignore' to express this intention.

Quoted 41 lines
---
 tests/qtest/qmp-cmd-test.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
tests/qtest/qmp-cmd-test.c +5 -5
index 3109a9fe96..18069a82fa 100644
@@ -82,9 +82,9 @@ static void test_query(const void *data)
     qtest_quit(qts);
 }
 
-static bool query_is_blacklisted(const char *cmd)
+static bool ignore_query(const char *cmd)
 {
-    const char *blacklist[] = {
+    const char *ignorelist[] = {
         /* Not actually queries: */
         "add-fd",
         /* Success depends on target arch: */
@@ -101,8 +101,8 @@ static bool query_is_blacklisted(const char *cmd)
     };
     int i;
 
-    for (i = 0; blacklist[i]; i++) {
-        if (!strcmp(cmd, blacklist[i])) {
+    for (i = 0; ignorelist[i]; i++) {
+        if (!strcmp(cmd, ignorelist[i])) {
             return true;
         }
     }
@@ -179,7 +179,7 @@ static void add_query_tests(QmpSchema *schema)
             continue;
         }
 
-        if (query_is_blacklisted(si->name)) {
+        if (ignore_query(si->name)) {
             continue;
         }
 
#2 lore raw
In reply to Thomas Huth
Quoted 13 lines · Thomas Huth

We simply want to ignore certain queries here, so let's rather use the term 'ignore' to express this intention.

---
 tests/qtest/qmp-cmd-test.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
tests/qtest/qmp-cmd-test.c +0 -0
index 3109a9fe96..18069a82fa 100644

tests/qtest/qmp-cmd-test.c static void test_query(const void *data) · line 87

Quoted 8 lines
tests/qtest/qmp-cmd-test.c +2 -2
@@ -82,9 +82,9 @@ static void test_query(const void *data)
     qtest_quit(qts);
 }
 
-static bool query_is_blacklisted(const char *cmd)
+static bool ignore_query(const char *cmd)
 {
-    const char *blacklist[] = {
+    const char *ignorelist[] = {

Just "ignored", it's obviously a list.

Paolo

Quoted 24 lines
tests/qtest/qmp-cmd-test.c +3 -3
         /* Not actually queries: */
         "add-fd",
         /* Success depends on target arch: */
@@ -101,8 +101,8 @@ static bool query_is_blacklisted(const char *cmd)
     };
     int i;
 
-    for (i = 0; blacklist[i]; i++) {
-        if (!strcmp(cmd, blacklist[i])) {
+    for (i = 0; ignorelist[i]; i++) {
+        if (!strcmp(cmd, ignorelist[i])) {
             return true;
         }
     }
@@ -179,7 +179,7 @@ static void add_query_tests(QmpSchema *schema)
             continue;
         }
 
-        if (query_is_blacklisted(si->name)) {
+        if (ignore_query(si->name)) {
             continue;
         }
 
#3 lore raw
Quoted 17 lines · Paolo Bonzini
Quoted 16 lines · Thomas Huth

We simply want to ignore certain queries here, so let's rather use the term 'ignore' to express this intention.

---
 tests/qtest/qmp-cmd-test.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
tests/qtest/qmp-cmd-test.c +0 -0
index 3109a9fe96..18069a82fa 100644
@@ -82,9 +82,9 @@ static void test_query(const void *data)
     qtest_quit(qts);
 }
 
Quoted 2 lines

tests/qtest/qmp-cmd-test.c static void test_query(const void *data) · line 85

Quoted 2 lines
tests/qtest/qmp-cmd-test.c +1 -1
-static bool query_is_blacklisted(const char *cmd)
+static bool ignore_query(const char *cmd)

Okay, although I'd prefer query_is_ignored(), to signal "this is a predicate", whereas ignore_query() suggests the function ignores queries.

Quoted 5 lines

tests/qtest/qmp-cmd-test.c static void test_query(const void *data) · line 87

Quoted 3 lines
tests/qtest/qmp-cmd-test.c +1 -1
 {
-    const char *blacklist[] = {
+    const char *ignorelist[] = {

Just "ignored", it's obviously a list.

Yes, that's better.

"blacklist" contains "list" not because "list" is important, but because it's an actual word that makes the variable's purpose immediately obvious. "ignored" is an acceptable replacement, and is less clumsy than "ignorelist".

Quoted 27 lines

Paolo

Quoted 24 lines
tests/qtest/qmp-cmd-test.c +3 -3
         /* Not actually queries: */
         "add-fd",
         /* Success depends on target arch: */
@@ -101,8 +101,8 @@ static bool query_is_blacklisted(const char *cmd)
     };
     int i;
 
-    for (i = 0; blacklist[i]; i++) {
-        if (!strcmp(cmd, blacklist[i])) {
+    for (i = 0; ignorelist[i]; i++) {
+        if (!strcmp(cmd, ignorelist[i])) {
             return true;
         }
     }
@@ -179,7 +179,7 @@ static void add_query_tests(QmpSchema *schema)
             continue;
         }
 
-        if (query_is_blacklisted(si->name)) {
+        if (ignore_query(si->name)) {
             continue;
         }