summaryrefslogtreecommitdiffstatsci
diff options
context:
space:
mode:
authorBryce Harrington <b.harrington@samsung.com>2014-06-06 19:15:03 -0700
committerBryce Harrington <b.harrington@samsung.com>2014-06-12 13:51:36 -0700
commiteab0fa01a9bfd1d84b445a2f03c44aaa881f3146 (patch)
tree17ef59e5502a1a7ae315ca162e1855dcd1c22a51
parentf17244b9db9752b4b9b053c9f8cd94173a36bbce (diff)
caskbench: Group the skia and cairo test determination codes
Also improve error messages so they're not redundant
-rw-r--r--src/caskbench.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/caskbench.cpp b/src/caskbench.cpp
index eb5c8b8..4f7b191 100644
--- a/src/caskbench.cpp
+++ b/src/caskbench.cpp
@@ -443,26 +443,27 @@ void populate_user_tests (const char** tests, int& num_tests, int* test_ids)
return;
while (tests[i] != NULL) {
if (strlen(tests[i]) >= MAX_BUFFER)
- errx (0, "Incorrect test case, please check the test case provided as input \n");
+ errx (0, "Invalid test case: test name is too long\n");
- /* We can assume no more that skia test will be next to cairo */
- cairo_test[6] = skia_test[5] = '\0';
+#ifdef USE_CAIRO
+ cairo_test[6] = '\0';
strncat(cairo_test, tests[i], strlen(tests[i]));
- strncat(skia_test, tests[i], strlen(tests[i]));
-#ifdef USE_CAIRO
/* Add cairo test index to the test list */
id = convertToTestId (cairo_test);
if (id < 0)
- errx (0, "Incorrect test case, please check the test case provided as input \n");
+ errx (0, "Unrecognized cairo test case '%s'\n", cairo_test);
test_ids[test_index++] = id;
num_tests = num_tests + 1;
#endif
#ifdef USE_SKIA
+ skia_test[5] = '\0';
+ strncat(skia_test, tests[i], strlen(tests[i]));
+
/* Add skia test index to the test list */
id = convertToTestId (skia_test);
if (id < 0)
- errx (0, "Incorrect test case, please check the test case provided as input \n");
+ errx (0, "Unrecognized skia test case '%s'\n", skia_test);
test_ids[test_index++] = id;
num_tests = num_tests + 1;
#endif