summaryrefslogtreecommitdiff
path: root/tests-clar/object/tree/frompath.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <carlos@cmartin.tk>2012-04-26 15:05:07 +0200
committerCarlos Martín Nieto <carlos@cmartin.tk>2012-04-26 15:38:42 +0200
commit3aa351ea0fa0d9e8d155801cdac1e83d3b1717c1 (patch)
tree9b2d8994245744ca0d2c2d07ef2d61e420451172 /tests-clar/object/tree/frompath.c
parenteb3d71a5bcd78cb4840e62194e8998141508af88 (diff)
downloadlibgit2-3aa351ea0fa0d9e8d155801cdac1e83d3b1717c1.tar.gz
error handling: move the missing parts over to the new error handling
Diffstat (limited to 'tests-clar/object/tree/frompath.c')
-rw-r--r--tests-clar/object/tree/frompath.c18
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);
}