7
7
void test_object_raw_type2string__convert_type_to_string (void )
8
8
{
9
9
cl_assert_equal_s (git_object_type2string (GIT_OBJECT_INVALID ), "" );
10
- cl_assert_equal_s (git_object_type2string (0 ), "" ); /* EXT1 */
10
+ cl_assert_equal_s (git_object_type2string (0 ), "" ); /* unused */
11
11
cl_assert_equal_s (git_object_type2string (GIT_OBJECT_COMMIT ), "commit" );
12
12
cl_assert_equal_s (git_object_type2string (GIT_OBJECT_TREE ), "tree" );
13
13
cl_assert_equal_s (git_object_type2string (GIT_OBJECT_BLOB ), "blob" );
14
14
cl_assert_equal_s (git_object_type2string (GIT_OBJECT_TAG ), "tag" );
15
- cl_assert_equal_s (git_object_type2string (5 ), "" ); /* EXT2 */
16
- cl_assert_equal_s (git_object_type2string (GIT_OBJECT_OFS_DELTA ), "OFS_DELTA " );
17
- cl_assert_equal_s (git_object_type2string (GIT_OBJECT_REF_DELTA ), "REF_DELTA " );
15
+ cl_assert_equal_s (git_object_type2string (5 ), "" ); /* unused */
16
+ cl_assert_equal_s (git_object_type2string (6 ), "" ); /* packfile offset delta */
17
+ cl_assert_equal_s (git_object_type2string (7 ), "" ); /* packfile ref delta */
18
18
19
19
cl_assert_equal_s (git_object_type2string (-2 ), "" );
20
20
cl_assert_equal_s (git_object_type2string (8 ), "" );
@@ -29,26 +29,26 @@ void test_object_raw_type2string__convert_string_to_type(void)
29
29
cl_assert (git_object_string2type ("tree" ) == GIT_OBJECT_TREE );
30
30
cl_assert (git_object_string2type ("blob" ) == GIT_OBJECT_BLOB );
31
31
cl_assert (git_object_string2type ("tag" ) == GIT_OBJECT_TAG );
32
- cl_assert (git_object_string2type ("OFS_DELTA" ) == GIT_OBJECT_OFS_DELTA );
33
- cl_assert (git_object_string2type ("REF_DELTA" ) == GIT_OBJECT_REF_DELTA );
32
+ cl_assert (git_object_string2type ("OFS_DELTA" ) == GIT_OBJECT_INVALID );
33
+ cl_assert (git_object_string2type ("REF_DELTA" ) == GIT_OBJECT_INVALID );
34
34
35
35
cl_assert (git_object_string2type ("CoMmIt" ) == GIT_OBJECT_INVALID );
36
36
cl_assert (git_object_string2type ("hohoho" ) == GIT_OBJECT_INVALID );
37
37
}
38
38
39
- void test_object_raw_type2string__check_type_is_loose (void )
39
+ void test_object_raw_type2string__check_type_is_valid (void )
40
40
{
41
- cl_assert (git_object_typeisloose (GIT_OBJECT_INVALID ) == 0 );
42
- cl_assert (git_object_typeisloose (0 ) == 0 ); /* EXT1 */
43
- cl_assert (git_object_typeisloose (GIT_OBJECT_COMMIT ) == 1 );
44
- cl_assert (git_object_typeisloose (GIT_OBJECT_TREE ) == 1 );
45
- cl_assert (git_object_typeisloose (GIT_OBJECT_BLOB ) == 1 );
46
- cl_assert (git_object_typeisloose (GIT_OBJECT_TAG ) == 1 );
47
- cl_assert (git_object_typeisloose (5 ) == 0 ); /* EXT2 */
48
- cl_assert (git_object_typeisloose ( GIT_OBJECT_OFS_DELTA ) == 0 );
49
- cl_assert (git_object_typeisloose ( GIT_OBJECT_REF_DELTA ) == 0 );
50
-
51
- cl_assert (git_object_typeisloose (-2 ) == 0 );
52
- cl_assert (git_object_typeisloose (8 ) == 0 );
53
- cl_assert (git_object_typeisloose (1234 ) == 0 );
41
+ cl_assert (git_object_type_is_valid (GIT_OBJECT_INVALID ) == 0 );
42
+ cl_assert (git_object_type_is_valid (0 ) == 0 ); /* unused */
43
+ cl_assert (git_object_type_is_valid (GIT_OBJECT_COMMIT ) == 1 );
44
+ cl_assert (git_object_type_is_valid (GIT_OBJECT_TREE ) == 1 );
45
+ cl_assert (git_object_type_is_valid (GIT_OBJECT_BLOB ) == 1 );
46
+ cl_assert (git_object_type_is_valid (GIT_OBJECT_TAG ) == 1 );
47
+ cl_assert (git_object_type_is_valid (5 ) == 0 ); /* unused */
48
+ cl_assert (git_object_type_is_valid ( 6 ) == 0 ); /* packfile offset delta */
49
+ cl_assert (git_object_type_is_valid ( 7 ) == 0 ); /* packfile ref delta */
50
+
51
+ cl_assert (git_object_type_is_valid (-2 ) == 0 );
52
+ cl_assert (git_object_type_is_valid (8 ) == 0 );
53
+ cl_assert (git_object_type_is_valid (1234 ) == 0 );
54
54
}
0 commit comments