mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-11 18:17:54 +00:00
attr: Add missing header to test suite
This commit is contained in:
parent
97da3eaec8
commit
d377fe80b1
42
tests-clar/attr/attr_expect.h
Normal file
42
tests-clar/attr/attr_expect.h
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
#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;
|
||||||
|
};
|
||||||
|
|
||||||
|
static 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
|
Loading…
Reference in New Issue
Block a user