Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicent Martí <tanoku@gmail.com>2012-03-03 01:12:46 +0400
committerVicent Martí <tanoku@gmail.com>2012-03-03 01:12:46 +0400
commitd377fe80b1396b82f8af7bfcd76f869410865001 (patch)
tree56f11b12aebdfd8ba9849ea8765ce749e6350e6a /tests-clar/attr
parent97da3eaec806c542467ca2c3ec9011475c87b8d5 (diff)
attr: Add missing header to test suite
Diffstat (limited to 'tests-clar/attr')
-rw-r--r--tests-clar/attr/attr_expect.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests-clar/attr/attr_expect.h b/tests-clar/attr/attr_expect.h
new file mode 100644
index 000000000..bea562457
--- /dev/null
+++ b/tests-clar/attr/attr_expect.h
@@ -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