diff mbox

[dpdk-dev,v2,2/4] test/test_meter: update meter test

Message ID 20171212095324.35420-3-jasvinder.singh@intel.com (mailing list archive)
State Superseded, archived
Headers show

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK

Commit Message

Jasvinder Singh Dec. 12, 2017, 9:53 a.m. UTC
From: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

Modify the unit test to accomodate the changes in the apis.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 test/test/test_meter.c | 194 +++++++++++++++++++++++++++++--------------------
 1 file changed, 115 insertions(+), 79 deletions(-)
diff mbox

Patch

diff --git a/test/test/test_meter.c b/test/test/test_meter.c
index 26b0565..b6d133a 100644
--- a/test/test/test_meter.c
+++ b/test/test/test_meter.c
@@ -82,43 +82,43 @@  static inline int
 tm_test_srtcm_config(void)
 {
 #define SRTCM_CFG_MSG "srtcm_config"
-	struct rte_meter_srtcm sm;
+	struct rte_meter_srtcm_profile sp;
 	struct  rte_meter_srtcm_params sparams1;
 
 	/* invalid parameter test */
-	if(rte_meter_srtcm_config(NULL, NULL) == 0)
+	if (rte_meter_srtcm_profile_config(NULL, NULL) == 0)
 		melog(SRTCM_CFG_MSG);
-	if(rte_meter_srtcm_config(&sm, NULL) == 0)
+	if (rte_meter_srtcm_profile_config(&sp, NULL) == 0)
 		melog(SRTCM_CFG_MSG);
-	if(rte_meter_srtcm_config(NULL, &sparams) == 0)
+	if (rte_meter_srtcm_profile_config(NULL, &sparams) == 0)
 		melog(SRTCM_CFG_MSG);
 
 	/* cbs and ebs can't both be zero */
 	sparams1 = sparams;
 	sparams1.cbs = 0;
 	sparams1.ebs = 0;
-	if(rte_meter_srtcm_config(&sm, &sparams1) == 0)
+	if (rte_meter_srtcm_profile_config(&sp, &sparams1) == 0)
 		melog(SRTCM_CFG_MSG);
 
 	/* cir should never be 0 */
 	sparams1 = sparams;
 	sparams1.cir = 0;
-	if(rte_meter_srtcm_config(&sm, &sparams1) == 0)
+	if (rte_meter_srtcm_profile_config(&sp, &sparams1) == 0)
 		melog(SRTCM_CFG_MSG);
 
 	/* one of ebs and cbs can be zero, should be successful */
 	sparams1 = sparams;
 	sparams1.ebs = 0;
-	if(rte_meter_srtcm_config(&sm, &sparams1) != 0)
+	if (rte_meter_srtcm_profile_config(&sp, &sparams1) != 0)
 		melog(SRTCM_CFG_MSG);
 
 	sparams1 = sparams;
 	sparams1.cbs = 0;
-	if(rte_meter_srtcm_config(&sm, &sparams1) != 0)
+	if (rte_meter_srtcm_profile_config(&sp, &sparams1) != 0)
 		melog(SRTCM_CFG_MSG);
 
 	/* usual parameter, should be successful */
-	if(rte_meter_srtcm_config(&sm, &sparams) != 0)
+	if (rte_meter_srtcm_profile_config(&sp, &sparams) != 0)
 		melog(SRTCM_CFG_MSG);
 
 	return 0;
@@ -131,47 +131,47 @@  tm_test_srtcm_config(void)
 static inline int
 tm_test_trtcm_config(void)
 {
-	struct rte_meter_trtcm tm;
+	struct rte_meter_trtcm_profile tp;
 	struct  rte_meter_trtcm_params tparams1;
 #define TRTCM_CFG_MSG "trtcm_config"
 
 	/* invalid parameter test */
-	if(rte_meter_trtcm_config(NULL, NULL) == 0)
+	if (rte_meter_trtcm_profile_config(NULL, NULL) == 0)
 		melog(TRTCM_CFG_MSG);
-	if(rte_meter_trtcm_config(&tm, NULL) == 0)
+	if (rte_meter_trtcm_profile_config(&tp, NULL) == 0)
 		melog(TRTCM_CFG_MSG);
-	if(rte_meter_trtcm_config(NULL, &tparams) == 0)
+	if (rte_meter_trtcm_profile_config(NULL, &tparams) == 0)
 		melog(TRTCM_CFG_MSG);
 
 	/* cir, cbs, pir and pbs never be zero */
 	tparams1 = tparams;
 	tparams1.cir = 0;
-	if(rte_meter_trtcm_config(&tm, &tparams1) == 0)
+	if (rte_meter_trtcm_profile_config(&tp, &tparams1) == 0)
 		melog(TRTCM_CFG_MSG);
 
 	tparams1 = tparams;
 	tparams1.cbs = 0;
-	if(rte_meter_trtcm_config(&tm, &tparams1) == 0)
+	if (rte_meter_trtcm_profile_config(&tp, &tparams1) == 0)
 		melog(TRTCM_CFG_MSG);
 
 	tparams1 = tparams;
 	tparams1.pbs = 0;
-	if(rte_meter_trtcm_config(&tm, &tparams1) == 0)
+	if (rte_meter_trtcm_profile_config(&tp, &tparams1) == 0)
 		melog(TRTCM_CFG_MSG);
 
 	tparams1 = tparams;
 	tparams1.pir = 0;
-	if(rte_meter_trtcm_config(&tm, &tparams1) == 0)
+	if (rte_meter_trtcm_profile_config(&tp, &tparams1) == 0)
 		melog(TRTCM_CFG_MSG);
 
 	/* pir should be greater or equal to cir */
 	tparams1 = tparams;
 	tparams1.pir = tparams1.cir - 1;
-	if(rte_meter_trtcm_config(&tm, &tparams1) == 0)
+	if (rte_meter_trtcm_profile_config(&tp, &tparams1) == 0)
 		melog(TRTCM_CFG_MSG" pir < cir test");
 
 	/* usual parameter, should be successful */
-	if(rte_meter_trtcm_config(&tm, &tparams) != 0)
+	if (rte_meter_trtcm_profile_config(&tp, &tparams) != 0)
 		melog(TRTCM_CFG_MSG);
 
 	return 0;
@@ -184,41 +184,50 @@  static inline int
 tm_test_srtcm_color_blind_check(void)
 {
 #define SRTCM_BLIND_CHECK_MSG "srtcm_blind_check"
+	struct rte_meter_srtcm_profile sp;
 	struct rte_meter_srtcm sm;
 	uint64_t time;
 	uint64_t hz = rte_get_tsc_hz();
 
 	/* Test green */
-	if(rte_meter_srtcm_config(&sm, &sparams) != 0)
+	if (rte_meter_srtcm_profile_config(&sp, &sparams) != 0)
+		melog(SRTCM_BLIND_CHECK_MSG);
+	if (rte_meter_srtcm_config(&sm, &sp) != 0)
 		melog(SRTCM_BLIND_CHECK_MSG);
 	time = rte_get_tsc_cycles() + hz;
-	if(rte_meter_srtcm_color_blind_check(
-		&sm, time, TM_TEST_SRTCM_CBS_DF - 1)
+	if (rte_meter_srtcm_color_blind_check(
+		&sm, &sp, time, TM_TEST_SRTCM_CBS_DF - 1)
 		!= e_RTE_METER_GREEN)
 		melog(SRTCM_BLIND_CHECK_MSG" GREEN");
 
 	/* Test yellow */
-	if(rte_meter_srtcm_config(&sm, &sparams) != 0)
+	if (rte_meter_srtcm_profile_config(&sp, &sparams) != 0)
+		melog(SRTCM_BLIND_CHECK_MSG);
+	if (rte_meter_srtcm_config(&sm, &sp) != 0)
 		melog(SRTCM_BLIND_CHECK_MSG);
 	time = rte_get_tsc_cycles() + hz;
-	if(rte_meter_srtcm_color_blind_check(
-		&sm, time, TM_TEST_SRTCM_CBS_DF + 1)
+	if (rte_meter_srtcm_color_blind_check(
+		&sm, &sp, time, TM_TEST_SRTCM_CBS_DF + 1)
 		!= e_RTE_METER_YELLOW)
 		melog(SRTCM_BLIND_CHECK_MSG" YELLOW");
 
-	if(rte_meter_srtcm_config(&sm, &sparams) != 0)
+	if (rte_meter_srtcm_profile_config(&sp, &sparams) != 0)
+		melog(SRTCM_BLIND_CHECK_MSG);
+	if (rte_meter_srtcm_config(&sm, &sp) != 0)
 		melog(SRTCM_BLIND_CHECK_MSG);
 	time = rte_get_tsc_cycles() + hz;
-	if(rte_meter_srtcm_color_blind_check(
-		&sm, time, (uint32_t)sm.ebs - 1) != e_RTE_METER_YELLOW)
+	if (rte_meter_srtcm_color_blind_check(
+		&sm, &sp, time, (uint32_t)sp.ebs - 1) != e_RTE_METER_YELLOW)
 		melog(SRTCM_BLIND_CHECK_MSG" YELLOW");
 
 	/* Test red */
-	if(rte_meter_srtcm_config(&sm, &sparams) != 0)
+	if (rte_meter_srtcm_profile_config(&sp, &sparams) != 0)
+		melog(SRTCM_BLIND_CHECK_MSG);
+	if (rte_meter_srtcm_config(&sm, &sp) != 0)
 		melog(SRTCM_BLIND_CHECK_MSG);
 	time = rte_get_tsc_cycles() + hz;
-	if(rte_meter_srtcm_color_blind_check(
-		&sm, time, TM_TEST_SRTCM_EBS_DF + 1)
+	if (rte_meter_srtcm_color_blind_check(
+		&sm, &sp, time, TM_TEST_SRTCM_EBS_DF + 1)
 		!= e_RTE_METER_RED)
 		melog(SRTCM_BLIND_CHECK_MSG" RED");
 
@@ -235,41 +244,50 @@  tm_test_trtcm_color_blind_check(void)
 #define TRTCM_BLIND_CHECK_MSG "trtcm_blind_check"
 
 	uint64_t time;
+	struct rte_meter_trtcm_profile tp;
 	struct rte_meter_trtcm tm;
 	uint64_t hz = rte_get_tsc_hz();
 
 	/* Test green */
-	if(rte_meter_trtcm_config(&tm, &tparams) != 0)
+	if (rte_meter_trtcm_profile_config(&tp, &tparams) != 0)
+		melog(TRTCM_BLIND_CHECK_MSG);
+	if (rte_meter_trtcm_config(&tm, &tp) != 0)
 		melog(TRTCM_BLIND_CHECK_MSG);
 	time = rte_get_tsc_cycles() + hz;
-	if(rte_meter_trtcm_color_blind_check(
-		&tm, time, TM_TEST_TRTCM_CBS_DF - 1)
+	if (rte_meter_trtcm_color_blind_check(
+		&tm, &tp, time, TM_TEST_TRTCM_CBS_DF - 1)
 		!= e_RTE_METER_GREEN)
 		melog(TRTCM_BLIND_CHECK_MSG" GREEN");
 
 	/* Test yellow */
-	if(rte_meter_trtcm_config(&tm, &tparams) != 0)
+	if (rte_meter_trtcm_profile_config(&tp, &tparams) != 0)
+		melog(TRTCM_BLIND_CHECK_MSG);
+	if (rte_meter_trtcm_config(&tm, &tp) != 0)
 		melog(TRTCM_BLIND_CHECK_MSG);
 	time = rte_get_tsc_cycles() + hz;
-	if(rte_meter_trtcm_color_blind_check(
-		&tm, time, TM_TEST_TRTCM_CBS_DF + 1)
+	if (rte_meter_trtcm_color_blind_check(
+		&tm, &tp, time, TM_TEST_TRTCM_CBS_DF + 1)
 		!= e_RTE_METER_YELLOW)
 		melog(TRTCM_BLIND_CHECK_MSG" YELLOW");
 
-	if(rte_meter_trtcm_config(&tm, &tparams) != 0)
+	if (rte_meter_trtcm_profile_config(&tp, &tparams) != 0)
+		melog(TRTCM_BLIND_CHECK_MSG);
+	if (rte_meter_trtcm_config(&tm, &tp) != 0)
 		melog(TRTCM_BLIND_CHECK_MSG);
 	time = rte_get_tsc_cycles() + hz;
-	if(rte_meter_trtcm_color_blind_check(
-		&tm, time, TM_TEST_TRTCM_PBS_DF - 1)
+	if (rte_meter_trtcm_color_blind_check(
+		&tm, &tp, time, TM_TEST_TRTCM_PBS_DF - 1)
 		!= e_RTE_METER_YELLOW)
 		melog(TRTCM_BLIND_CHECK_MSG" YELLOW");
 
 	/* Test red */
-	if(rte_meter_trtcm_config(&tm, &tparams) != 0)
+	if (rte_meter_trtcm_profile_config(&tp, &tparams) != 0)
+		melog(TRTCM_BLIND_CHECK_MSG);
+	if (rte_meter_trtcm_config(&tm, &tp) != 0)
 		melog(TRTCM_BLIND_CHECK_MSG);
 	time = rte_get_tsc_cycles() + hz;
-	if(rte_meter_trtcm_color_blind_check(
-		&tm, time, TM_TEST_TRTCM_PBS_DF + 1)
+	if (rte_meter_trtcm_color_blind_check(
+		&tm, &tp, time, TM_TEST_TRTCM_PBS_DF + 1)
 		!= e_RTE_METER_RED)
 		melog(TRTCM_BLIND_CHECK_MSG" RED");
 
@@ -291,36 +309,45 @@  tm_test_srtcm_aware_check
 (enum rte_meter_color in[4], enum rte_meter_color out[4])
 {
 #define SRTCM_AWARE_CHECK_MSG "srtcm_aware_check"
+	struct rte_meter_srtcm_profile sp;
 	struct rte_meter_srtcm sm;
 	uint64_t time;
 	uint64_t hz = rte_get_tsc_hz();
 
-	if(rte_meter_srtcm_config(&sm, &sparams) != 0)
+	if (rte_meter_srtcm_profile_config(&sp, &sparams) != 0)
+		melog(SRTCM_AWARE_CHECK_MSG);
+	if (rte_meter_srtcm_config(&sm, &sp) != 0)
 		melog(SRTCM_AWARE_CHECK_MSG);
 	time = rte_get_tsc_cycles() + hz;
-	if(rte_meter_srtcm_color_aware_check(
-		&sm, time, TM_TEST_SRTCM_CBS_DF - 1, in[0]) != out[0])
+	if (rte_meter_srtcm_color_aware_check(
+		&sm, &sp, time, TM_TEST_SRTCM_CBS_DF - 1, in[0]) != out[0])
 		melog(SRTCM_AWARE_CHECK_MSG" %u:%u", in[0], out[0]);
 
-	if(rte_meter_srtcm_config(&sm, &sparams) != 0)
+	if (rte_meter_srtcm_profile_config(&sp, &sparams) != 0)
+		melog(SRTCM_AWARE_CHECK_MSG);
+	if (rte_meter_srtcm_config(&sm, &sp) != 0)
 		melog(SRTCM_AWARE_CHECK_MSG);
 	time = rte_get_tsc_cycles() + hz;
-	if(rte_meter_srtcm_color_aware_check(
-		&sm, time, TM_TEST_SRTCM_CBS_DF + 1, in[1]) != out[1])
+	if (rte_meter_srtcm_color_aware_check(
+		&sm, &sp, time, TM_TEST_SRTCM_CBS_DF + 1, in[1]) != out[1])
 		melog(SRTCM_AWARE_CHECK_MSG" %u:%u", in[1], out[1]);
 
-	if(rte_meter_srtcm_config(&sm, &sparams) != 0)
+	if (rte_meter_srtcm_profile_config(&sp, &sparams) != 0)
+		melog(SRTCM_AWARE_CHECK_MSG);
+	if (rte_meter_srtcm_config(&sm, &sp) != 0)
 		melog(SRTCM_AWARE_CHECK_MSG);
 	time = rte_get_tsc_cycles() + hz;
-	if(rte_meter_srtcm_color_aware_check(
-		&sm, time, TM_TEST_SRTCM_EBS_DF - 1, in[2]) != out[2])
+	if (rte_meter_srtcm_color_aware_check(
+		&sm, &sp, time, TM_TEST_SRTCM_EBS_DF - 1, in[2]) != out[2])
 		melog(SRTCM_AWARE_CHECK_MSG" %u:%u", in[2], out[2]);
 
-	if(rte_meter_srtcm_config(&sm, &sparams) != 0)
+	if (rte_meter_srtcm_profile_config(&sp, &sparams) != 0)
+		melog(SRTCM_AWARE_CHECK_MSG);
+	if (rte_meter_srtcm_config(&sm, &sp) != 0)
 		melog(SRTCM_AWARE_CHECK_MSG);
 	time = rte_get_tsc_cycles() + hz;
-	if(rte_meter_srtcm_color_aware_check(
-		&sm, time, TM_TEST_SRTCM_EBS_DF + 1, in[3]) != out[3])
+	if (rte_meter_srtcm_color_aware_check(
+		&sm, &sp, time, TM_TEST_SRTCM_EBS_DF + 1, in[3]) != out[3])
 		melog(SRTCM_AWARE_CHECK_MSG" %u:%u", in[3], out[3]);
 
 	return 0;
@@ -346,7 +373,7 @@  tm_test_srtcm_color_aware_check(void)
 	out[1] = e_RTE_METER_YELLOW;
 	out[2] = e_RTE_METER_YELLOW;
 	out[3] = e_RTE_METER_RED;
-	if(tm_test_srtcm_aware_check(in, out) != 0)
+	if (tm_test_srtcm_aware_check(in, out) != 0)
 		return -1;
 
 	/**
@@ -358,7 +385,7 @@  tm_test_srtcm_color_aware_check(void)
 	out[1] = e_RTE_METER_YELLOW;
 	out[2] = e_RTE_METER_YELLOW;
 	out[3] = e_RTE_METER_RED;
-	if(tm_test_srtcm_aware_check(in, out) != 0)
+	if (tm_test_srtcm_aware_check(in, out) != 0)
 		return -1;
 
 	/**
@@ -370,7 +397,7 @@  tm_test_srtcm_color_aware_check(void)
 	out[1] = e_RTE_METER_RED;
 	out[2] = e_RTE_METER_RED;
 	out[3] = e_RTE_METER_RED;
-	if(tm_test_srtcm_aware_check(in, out) != 0)
+	if (tm_test_srtcm_aware_check(in, out) != 0)
 		return -1;
 
 	return 0;
@@ -389,36 +416,45 @@  tm_test_trtcm_aware_check
 (enum rte_meter_color in[4], enum rte_meter_color out[4])
 {
 #define TRTCM_AWARE_CHECK_MSG "trtcm_aware_check"
+	struct rte_meter_trtcm_profile tp;
 	struct rte_meter_trtcm tm;
 	uint64_t time;
 	uint64_t hz = rte_get_tsc_hz();
 
-	if(rte_meter_trtcm_config(&tm, &tparams) != 0)
+	if (rte_meter_trtcm_profile_config(&tp, &tparams) != 0)
+		melog(TRTCM_AWARE_CHECK_MSG);
+	if (rte_meter_trtcm_config(&tm, &tp) != 0)
 		melog(TRTCM_AWARE_CHECK_MSG);
 	time = rte_get_tsc_cycles() + hz;
-	if(rte_meter_trtcm_color_aware_check(
-		&tm, time, TM_TEST_TRTCM_CBS_DF - 1, in[0]) != out[0])
+	if (rte_meter_trtcm_color_aware_check(
+		&tm, &tp, time, TM_TEST_TRTCM_CBS_DF - 1, in[0]) != out[0])
 		melog(TRTCM_AWARE_CHECK_MSG" %u:%u", in[0], out[0]);
 
-	if(rte_meter_trtcm_config(&tm, &tparams) != 0)
+	if (rte_meter_trtcm_profile_config(&tp, &tparams) != 0)
+		melog(TRTCM_AWARE_CHECK_MSG);
+	if (rte_meter_trtcm_config(&tm, &tp) != 0)
 		melog(TRTCM_AWARE_CHECK_MSG);
 	time = rte_get_tsc_cycles() + hz;
-	if(rte_meter_trtcm_color_aware_check(
-		&tm, time, TM_TEST_TRTCM_CBS_DF + 1, in[1]) != out[1])
+	if (rte_meter_trtcm_color_aware_check(
+		&tm, &tp, time, TM_TEST_TRTCM_CBS_DF + 1, in[1]) != out[1])
 		melog(TRTCM_AWARE_CHECK_MSG" %u:%u", in[1], out[1]);
 
-	if(rte_meter_trtcm_config(&tm, &tparams) != 0)
+	if (rte_meter_trtcm_profile_config(&tp, &tparams) != 0)
+		melog(TRTCM_AWARE_CHECK_MSG);
+	if (rte_meter_trtcm_config(&tm, &tp) != 0)
 		melog(TRTCM_AWARE_CHECK_MSG);
 	time = rte_get_tsc_cycles() + hz;
-	if(rte_meter_trtcm_color_aware_check(
-		&tm, time, TM_TEST_TRTCM_PBS_DF - 1, in[2]) != out[2])
+	if (rte_meter_trtcm_color_aware_check(
+		&tm, &tp, time, TM_TEST_TRTCM_PBS_DF - 1, in[2]) != out[2])
 		melog(TRTCM_AWARE_CHECK_MSG" %u:%u", in[2], out[2]);
 
-	if(rte_meter_trtcm_config(&tm, &tparams) != 0)
+	if (rte_meter_trtcm_profile_config(&tp, &tparams) != 0)
+		melog(TRTCM_AWARE_CHECK_MSG);
+	if (rte_meter_trtcm_config(&tm, &tp) != 0)
 		melog(TRTCM_AWARE_CHECK_MSG);
 	time = rte_get_tsc_cycles() + hz;
-	if(rte_meter_trtcm_color_aware_check(
-		&tm, time, TM_TEST_TRTCM_PBS_DF + 1, in[3]) != out[3])
+	if (rte_meter_trtcm_color_aware_check(
+		&tm, &tp, time, TM_TEST_TRTCM_PBS_DF + 1, in[3]) != out[3])
 		melog(TRTCM_AWARE_CHECK_MSG" %u:%u", in[3], out[3]);
 
 	return 0;
@@ -444,7 +480,7 @@  tm_test_trtcm_color_aware_check(void)
 	out[1] = e_RTE_METER_YELLOW;
 	out[2] = e_RTE_METER_YELLOW;
 	out[3] = e_RTE_METER_RED;
-	if(tm_test_trtcm_aware_check(in, out) != 0)
+	if (tm_test_trtcm_aware_check(in, out) != 0)
 		return -1;
 
 	in[0] = in[1] = in[2] = in[3] = e_RTE_METER_YELLOW;
@@ -452,7 +488,7 @@  tm_test_trtcm_color_aware_check(void)
 	out[1] = e_RTE_METER_YELLOW;
 	out[2] = e_RTE_METER_YELLOW;
 	out[3] = e_RTE_METER_RED;
-	if(tm_test_trtcm_aware_check(in, out) != 0)
+	if (tm_test_trtcm_aware_check(in, out) != 0)
 		return -1;
 
 	in[0] = in[1] = in[2] = in[3] = e_RTE_METER_RED;
@@ -460,7 +496,7 @@  tm_test_trtcm_color_aware_check(void)
 	out[1] = e_RTE_METER_RED;
 	out[2] = e_RTE_METER_RED;
 	out[3] = e_RTE_METER_RED;
-	if(tm_test_trtcm_aware_check(in, out) != 0)
+	if (tm_test_trtcm_aware_check(in, out) != 0)
 		return -1;
 
 	return 0;
@@ -472,22 +508,22 @@  tm_test_trtcm_color_aware_check(void)
 static int
 test_meter(void)
 {
-	if(tm_test_srtcm_config() != 0 )
+	if (tm_test_srtcm_config() != 0)
 		return -1;
 
-	if(tm_test_trtcm_config() != 0 )
+	if (tm_test_trtcm_config() != 0)
 		return -1;
 
-	if(tm_test_srtcm_color_blind_check() != 0)
+	if (tm_test_srtcm_color_blind_check() != 0)
 		return -1;
 
-	if(tm_test_trtcm_color_blind_check()!= 0)
+	if (tm_test_trtcm_color_blind_check() != 0)
 		return -1;
 
-	if(tm_test_srtcm_color_aware_check()!= 0)
+	if (tm_test_srtcm_color_aware_check() != 0)
 		return -1;
 
-	if(tm_test_trtcm_color_aware_check()!= 0)
+	if (tm_test_trtcm_color_aware_check() != 0)
 		return -1;
 
 	return 0;