diff options
Diffstat (limited to 'tests-clar/object/tree/frompath.c')
| -rw-r--r-- | tests-clar/object/tree/frompath.c | 18 | 
1 files changed, 12 insertions, 6 deletions
diff --git a/tests-clar/object/tree/frompath.c b/tests-clar/object/tree/frompath.c index 523a0b99e..15f0e917d 100644 --- a/tests-clar/object/tree/frompath.c +++ b/tests-clar/object/tree/frompath.c @@ -40,6 +40,12 @@ static void assert_tree_from_path(git_tree *root, const char *path, int expected  	git_tree_free(containing_tree);  } +static void assert_tree_from_path_klass(git_tree *root, const char *path, int expected_result, const char *expected_raw_oid) +{ +	assert_tree_from_path(root, path, GIT_ERROR, expected_raw_oid); +	cl_assert(git_error_last()->klass == expected_result); +} +  void test_object_tree_frompath__retrieve_tree_from_path_to_treeentry(void)  {  	/* Will return self if given a one path segment... */ @@ -66,10 +72,10 @@ void test_object_tree_frompath__fail_when_processing_an_unknown_tree_segment(voi  void test_object_tree_frompath__fail_when_processing_an_invalid_path(void)  { -	assert_tree_from_path(tree, "/", GIT_EINVALIDPATH, NULL); -	assert_tree_from_path(tree, "/ab", GIT_EINVALIDPATH, NULL); -	assert_tree_from_path(tree, "/ab/de", GIT_EINVALIDPATH, NULL); -	assert_tree_from_path(tree, "ab/", GIT_EINVALIDPATH, NULL); -	assert_tree_from_path(tree, "ab//de", GIT_EINVALIDPATH, NULL); -	assert_tree_from_path(tree, "ab/de/", GIT_EINVALIDPATH, NULL); +	assert_tree_from_path_klass(tree, "/", GITERR_INVALID, NULL); +	assert_tree_from_path_klass(tree, "/ab", GITERR_INVALID, NULL); +	assert_tree_from_path_klass(tree, "/ab/de", GITERR_INVALID, NULL); +	assert_tree_from_path_klass(tree, "ab/", GITERR_INVALID, NULL); +	assert_tree_from_path_klass(tree, "ab//de", GITERR_INVALID, NULL); +	assert_tree_from_path_klass(tree, "ab/de/", GITERR_INVALID, NULL);  }  | 
