mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-08 09:02:55 +00:00

This migrates odb.c, odb_loose.c, odb_pack.c and pack.c to the new style of error handling. Also got the unix and win32 versions of map.c. There are some minor changes to other files but no others were completely converted. This also contains an update to filebuf so that a zeroed out filebuf will not think that the fd (== 0) is actually open (and inadvertently call close() on fd 0 if cleaned up). Lastly, this was built and tested on win32 and contains a bunch of fixes for the win32 build which was pretty broken.
43 lines
709 B
C
43 lines
709 B
C
#ifndef __CLAR_TEST_ATTR_EXPECT__
|
|
#define __CLAR_TEST_ATTR_EXPECT__
|
|
|
|
enum attr_expect_t {
|
|
EXPECT_FALSE,
|
|
EXPECT_TRUE,
|
|
EXPECT_UNDEFINED,
|
|
EXPECT_STRING
|
|
};
|
|
|
|
struct attr_expected {
|
|
const char *path;
|
|
const char *attr;
|
|
enum attr_expect_t expected;
|
|
const char *expected_str;
|
|
};
|
|
|
|
GIT_INLINE(void) attr_check_expected(
|
|
enum attr_expect_t expected,
|
|
const char *expected_str,
|
|
const char *value)
|
|
{
|
|
switch (expected) {
|
|
case EXPECT_TRUE:
|
|
cl_assert(GIT_ATTR_TRUE(value));
|
|
break;
|
|
|
|
case EXPECT_FALSE:
|
|
cl_assert(GIT_ATTR_FALSE(value));
|
|
break;
|
|
|
|
case EXPECT_UNDEFINED:
|
|
cl_assert(GIT_ATTR_UNSPECIFIED(value));
|
|
break;
|
|
|
|
case EXPECT_STRING:
|
|
cl_assert_strequal(expected_str, value);
|
|
break;
|
|
}
|
|
}
|
|
|
|
#endif
|