extern "C" {
#endif
+void test__f_capability_ambient_get__fails(void **state) {
+
+ #if !defined(_di_libcap_) && !defined(_libcap_legacy_only_)
+ f_capability_value_t value = f_capability_value_t_initialize;
+ int ambient = 0;
+
+ {
+ will_return(__wrap_cap_get_ambient, true);
+
+ const f_status_t status = f_capability_ambient_get(value, &ambient);
+
+ assert_int_equal(F_status_set_fine(status), F_supported_not);
+ assert_int_equal(ambient, -1);
+ }
+ #endif // !defined(_di_libcap_) && !defined(_libcap_legacy_only_)
+}
+
+#ifndef _di_level_0_parameter_checking_
+ void test__f_capability_ambient_get__parameter_checking(void **state) {
+
+ const f_capability_value_t value = f_capability_value_t_initialize;
+
+ {
+ const f_status_t status = f_capability_ambient_get(value, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
void test__f_capability_ambient_get__works(void **state) {
- f_capability_value_t value = f_capability_value_t_initialize;
+ const f_capability_value_t value = f_capability_value_t_initialize;
int ambient = 0;
#if defined(_di_libcap_) || defined(_libcap_legacy_only_)
}
}
-void test__f_capability_ambient_get__fails(void **state) {
-
- #if !defined(_di_libcap_) && !defined(_libcap_legacy_only_)
- f_capability_value_t value = f_capability_value_t_initialize;
- int ambient = 0;
-
- {
- will_return(__wrap_cap_get_ambient, true);
-
- const f_status_t status = f_capability_ambient_get(value, &ambient);
-
- assert_int_equal(F_status_set_fine(status), F_supported_not);
- assert_int_equal(ambient, -1);
- }
- #endif // !defined(_di_libcap_) && !defined(_libcap_legacy_only_)
-}
-
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__ambient_get
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_ambient_get()
*/
-extern void test__f_capability_ambient_get__works(void **state);
+extern void test__f_capability_ambient_get__fails(void **state);
/**
- * Test that function fails.
+ * Test that parameter checking works as expected.
*
* @see f_capability_ambient_get()
*/
-extern void test__f_capability_ambient_get__fails(void **state);
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_capability_ambient_get__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
+/**
+ * Test that function works.
+ *
+ * @see f_capability_ambient_get()
+ */
+extern void test__f_capability_ambient_get__works(void **state);
#endif // _TEST__F_capability__ambient_get
extern "C" {
#endif
-void test__f_capability_ambient_reset__works(void **state) {
-
- #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
- printf("[ WARN ] f_capability_ambient_reset() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_get_ambient, false);
- #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
-
- {
- const f_status_t status = f_capability_ambient_reset();
-
- #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_int_equal(status, F_none);
- #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
- }
-}
-
void test__f_capability_ambient_reset__fails(void **state) {
#if !defined(_di_libcap_) && !defined(_libcap_legacy_only_)
#endif // !defined(_di_libcap_) && !defined(_libcap_legacy_only_)
}
+void test__f_capability_ambient_reset__works(void **state) {
+
+ #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
+ printf("[ WARN ] f_capability_ambient_reset() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_get_ambient, false);
+ #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
+
+ {
+ const f_status_t status = f_capability_ambient_reset();
+
+ #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_int_equal(status, F_none);
+ #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
+ }
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__ambient_reset
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_ambient_reset()
*/
-extern void test__f_capability_ambient_reset__works(void **state);
+extern void test__f_capability_ambient_reset__fails(void **state);
+
+// f_capability_ambient_reset() doesn't use parameter checking.
/**
- * Test that function fails.
+ * Test that function works.
*
* @see f_capability_ambient_reset()
*/
-extern void test__f_capability_ambient_reset__fails(void **state);
+extern void test__f_capability_ambient_reset__works(void **state);
#endif // _TEST__F_capability__ambient_reset
extern "C" {
#endif
-void test__f_capability_ambient_set__works(void **state) {
-
- f_capability_value_t value = f_capability_value_t_initialize;
- f_capability_flag_value_t flag_value = f_capability_flag_value_t_initialize;
-
- #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
- printf("[ WARN ] f_capability_ambient_set() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_get_ambient, false);
- #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
-
- {
- const f_status_t status = f_capability_ambient_set(value, flag_value);
-
- #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_int_equal(status, F_none);
- #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
- }
-}
-
void test__f_capability_ambient_set__fails(void **state) {
#if !defined(_di_libcap_) && !defined(_libcap_legacy_only_)
- f_capability_value_t value = f_capability_value_t_initialize;
+ const f_capability_value_t value = f_capability_value_t_initialize;
f_capability_flag_value_t flag_value = f_capability_flag_value_t_initialize;
int errnos[] = {
#endif // !defined(_di_libcap_) && !defined(_libcap_legacy_only_)
}
+void test__f_capability_ambient_set__works(void **state) {
+
+ const f_capability_value_t value = f_capability_value_t_initialize;
+ f_capability_flag_value_t flag_value = f_capability_flag_value_t_initialize;
+
+ #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
+ printf("[ WARN ] f_capability_ambient_set() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_get_ambient, false);
+ #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
+
+ {
+ const f_status_t status = f_capability_ambient_set(value, flag_value);
+
+ #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_int_equal(status, F_none);
+ #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
+ }
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__ambient_set
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_ambient_set()
*/
-extern void test__f_capability_ambient_set__works(void **state);
+extern void test__f_capability_ambient_set__fails(void **state);
+
+// f_capability_ambient_reset() doesn't use parameter checking.
/**
- * Test that function fails.
+ * Test that function works.
*
* @see f_capability_ambient_set()
*/
-extern void test__f_capability_ambient_set__fails(void **state);
+extern void test__f_capability_ambient_set__works(void **state);
#endif // _TEST__F_capability__ambient_set
extern "C" {
#endif
-void test__f_capability_clear__works(void **state) {
-
- f_capability_t capability = f_capability_t_initialize;
-
- #if defined(_di_libcap_)
- printf("[ WARN ] f_capability_clear() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_clear, false);
- #endif // defined(_di_libcap_)
-
- {
- const f_status_t status = f_capability_clear(&capability);
-
- #if defined(_di_libcap_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_int_equal(status, F_none);
- #endif // defined(_di_libcap_)
- }
-}
-
void test__f_capability_clear__fails(void **state) {
#if !defined(_di_libcap_)
#endif // !defined(_di_libcap_)
}
+#ifndef _di_level_0_parameter_checking_
+ void test__f_capability_clear__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_capability_clear(0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
+void test__f_capability_clear__works(void **state) {
+
+ f_capability_t capability = f_capability_t_initialize;
+
+ #if defined(_di_libcap_)
+ printf("[ WARN ] f_capability_clear() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_clear, false);
+ #endif // defined(_di_libcap_)
+
+ {
+ const f_status_t status = f_capability_clear(&capability);
+
+ #if defined(_di_libcap_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_int_equal(status, F_none);
+ #endif // defined(_di_libcap_)
+ }
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__clear
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_clear()
*/
-extern void test__f_capability_clear__works(void **state);
+extern void test__f_capability_clear__fails(void **state);
/**
- * Test that function fails.
+ * Test that parameter checking works as expected.
*
* @see f_capability_clear()
*/
-extern void test__f_capability_clear__fails(void **state);
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_capability_clear__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
+/**
+ * Test that function works.
+ *
+ * @see f_capability_clear()
+ */
+extern void test__f_capability_clear__works(void **state);
#endif // _TEST__F_capability__clear
extern "C" {
#endif
+#ifndef _di_level_0_parameter_checking_
+ void test__f_capability_clear_flag__parameter_checking(void **state) {
+
+ const f_capability_flag_value_t flag_value = f_capability_flag_value_t_initialize;
+
+ {
+ const f_status_t status = f_capability_clear_flag(flag_value, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
void test__f_capability_clear_flag__works(void **state) {
f_capability_t capability = f_capability_t_initialize;
- f_capability_flag_value_t flag_value = f_capability_flag_value_t_initialize;
+ const f_capability_flag_value_t flag_value = f_capability_flag_value_t_initialize;
#if defined(_di_libcap_)
printf("[ WARN ] f_capability_clear_flag() is not implemented and cannot be fully tested.\n");
#if !defined(_di_libcap_)
f_capability_t capability = f_capability_t_initialize;
- f_capability_flag_value_t flag_value = f_capability_flag_value_t_initialize;
+ const f_capability_flag_value_t flag_value = f_capability_flag_value_t_initialize;
int errnos[] = {
EINVAL,
#define _TEST__F_capability__clear_flag
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_clear_flag()
*/
-extern void test__f_capability_clear_flag__works(void **state);
+extern void test__f_capability_clear_flag__fails(void **state);
/**
- * Test that function fails.
+ * Test that parameter checking works as expected.
*
* @see f_capability_clear_flag()
*/
-extern void test__f_capability_clear_flag__fails(void **state);
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_capability_clear_flag__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
+/**
+ * Test that function works.
+ *
+ * @see f_capability_clear_flag()
+ */
+extern void test__f_capability_clear_flag__works(void **state);
#endif // _TEST__F_capability__clear_flag
extern "C" {
#endif
+void test__f_capability_compare__fails(void **state) {
+
+ #if !defined(_di_libcap_)
+ const f_capability_t capability_1 = f_capability_t_initialize;
+ const f_capability_t capability_2 = f_capability_t_initialize;
+ int flags = 0;
+
+ int errnos[] = {
+ EINVAL,
+ mock_errno_generic,
+ };
+
+ f_status_t statuss[] = {
+ F_parameter,
+ F_failure,
+ };
+
+ for (int i = 0; i < 2; ++i) {
+
+ will_return(__wrap_cap_compare, true);
+ will_return(__wrap_cap_compare, errnos[i]);
+
+ const f_status_t status = f_capability_compare(capability_1, capability_2, &flags);
+
+ assert_int_equal(F_status_set_fine(status), statuss[i]);
+ } // for
+ #endif // !defined(_di_libcap_)
+}
+
void test__f_capability_compare__works(void **state) {
- f_capability_t capability_1 = f_capability_t_initialize;
- f_capability_t capability_2 = f_capability_t_initialize;
+ const f_capability_t capability_1 = f_capability_t_initialize;
+ const f_capability_t capability_2 = f_capability_t_initialize;
int flags = 0;
#if defined(_di_libcap_)
#endif // defined(_di_libcap_)
}
-void test__f_capability_compare__fails(void **state) {
-
- #if !defined(_di_libcap_)
- f_capability_t capability_1 = f_capability_t_initialize;
- f_capability_t capability_2 = f_capability_t_initialize;
- int flags = 0;
-
- int errnos[] = {
- EINVAL,
- mock_errno_generic,
- };
-
- f_status_t statuss[] = {
- F_parameter,
- F_failure,
- };
-
- for (int i = 0; i < 2; ++i) {
-
- will_return(__wrap_cap_compare, true);
- will_return(__wrap_cap_compare, errnos[i]);
-
- const f_status_t status = f_capability_compare(capability_1, capability_2, &flags);
-
- assert_int_equal(F_status_set_fine(status), statuss[i]);
- } // for
- #endif // !defined(_di_libcap_)
-}
-
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__compare
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_compare()
*/
-extern void test__f_capability_compare__works(void **state);
+extern void test__f_capability_compare__fails(void **state);
+
+// f_capability_compare() doesn't use parameter checking.
/**
- * Test that function fails.
+ * Test that function works.
*
* @see f_capability_compare()
*/
-extern void test__f_capability_compare__fails(void **state);
+extern void test__f_capability_compare__works(void **state);
#endif // _TEST__F_capability__compare
extern "C" {
#endif
-void test__f_capability_copy__works(void **state) {
-
- f_capability_t capability_1 = f_capability_t_initialize;
- f_capability_t capability_2 = f_capability_t_initialize;
-
- #if defined(_di_libcap_)
- printf("[ WARN ] f_capability_copy() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_dup, false);
- #endif // defined(_di_libcap_)
-
- {
- const f_status_t status = f_capability_copy(capability_1, &capability_2);
-
- #if defined(_di_libcap_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_int_equal(status, F_none);
- assert_int_equal(capability_2, 1);
- #endif // defined(_di_libcap_)
- }
-}
-
void test__f_capability_copy__fails(void **state) {
#if !defined(_di_libcap_)
- f_capability_t capability_1 = f_capability_t_initialize;
+ const f_capability_t capability_1 = f_capability_t_initialize;
f_capability_t capability_2 = f_capability_t_initialize;
int errnos[] = {
#endif // !defined(_di_libcap_)
}
+#ifndef _di_level_0_parameter_checking_
+ void test__f_capability_copy__parameter_checking(void **state) {
+
+ const f_capability_t capability = f_capability_t_initialize;
+
+ {
+ const f_status_t status = f_capability_copy(capability, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
+void test__f_capability_copy__works(void **state) {
+
+ const f_capability_t capability_1 = f_capability_t_initialize;
+ f_capability_t capability_2 = f_capability_t_initialize;
+
+ #if defined(_di_libcap_)
+ printf("[ WARN ] f_capability_copy() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_dup, false);
+ #endif // defined(_di_libcap_)
+
+ {
+ const f_status_t status = f_capability_copy(capability_1, &capability_2);
+
+ #if defined(_di_libcap_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_int_equal(status, F_none);
+ assert_int_equal(capability_2, 1);
+ #endif // defined(_di_libcap_)
+ }
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__copy
/**
+ * Test that function fails.
+ *
+ * @see f_capability_copy()
+ */
+extern void test__f_capability_copy__fails(void **state);
+
+/**
* Test that function works.
*
* @see f_capability_copy()
extern void test__f_capability_copy__works(void **state);
/**
- * Test that function fails.
+ * Test that parameter checking works as expected.
*
* @see f_capability_copy()
*/
-extern void test__f_capability_copy__fails(void **state);
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_capability_copy__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
#endif // _TEST__F_capability__copy
extern "C" {
#endif
-void test__f_capability_copy_external__works(void **state) {
-
- f_capability_t capability = f_capability_t_initialize;
- ssize_t max = 0;
- int stub = 0;
- void *external = (void *) &stub;
- ssize_t size = 0;
-
- #if defined(_di_libcap_)
- printf("[ WARN ] f_capability_copy_external() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_copy_ext, false);
- #endif // defined(_di_libcap_)
-
- {
- const f_status_t status = f_capability_copy_external(capability, max, external, &size);
-
- #if defined(_di_libcap_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_int_equal(status, F_none);
- assert_int_equal(size, 1);
- #endif // defined(_di_libcap_)
- }
-}
-
void test__f_capability_copy_external__fails(void **state) {
#if !defined(_di_libcap_)
f_capability_t capability = f_capability_t_initialize;
- ssize_t max = 0;
+ const ssize_t max = 0;
int stub = 0;
void *external = (void *) &stub;
ssize_t size = 0;
#endif // !defined(_di_libcap_)
}
+#ifndef _di_level_0_parameter_checking_
+ void test__f_capability_copy_external__parameter_checking(void **state) {
+
+ f_capability_t capability = f_capability_t_initialize;
+
+ {
+ const f_status_t status = f_capability_copy_external(capability, 0, 0, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
+void test__f_capability_copy_external__works(void **state) {
+
+ f_capability_t capability = f_capability_t_initialize;
+ const ssize_t max = 0;
+ int stub = 0;
+ void *external = (void *) &stub;
+ ssize_t size = 0;
+
+ #if defined(_di_libcap_)
+ printf("[ WARN ] f_capability_copy_external() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_copy_ext, false);
+ #endif // defined(_di_libcap_)
+
+ {
+ const f_status_t status = f_capability_copy_external(capability, max, external, &size);
+
+ #if defined(_di_libcap_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_int_equal(status, F_none);
+ assert_int_equal(size, 1);
+ #endif // defined(_di_libcap_)
+ }
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__copy_external
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_copy_external()
*/
-extern void test__f_capability_copy_external__works(void **state);
+extern void test__f_capability_copy_external__fails(void **state);
/**
- * Test that function fails.
+ * Test that parameter checking works as expected.
*
* @see f_capability_copy_external()
*/
-extern void test__f_capability_copy_external__fails(void **state);
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_capability_copy_external__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
+/**
+ * Test that function works.
+ *
+ * @see f_capability_copy_external()
+ */
+extern void test__f_capability_copy_external__works(void **state);
#endif // _TEST__F_capability__copy_external
extern "C" {
#endif
-void test__f_capability_copy_internal__works(void **state) {
-
- f_capability_t capability = f_capability_t_initialize;
- int stub = 0;
- void *external = (void *) &stub;
-
- #if defined(_di_libcap_)
- printf("[ WARN ] f_capability_copy_internal() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_copy_int, false);
- #endif // defined(_di_libcap_)
-
- {
- const f_status_t status = f_capability_copy_internal(external, &capability);
-
- #if defined(_di_libcap_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_int_equal(status, F_none);
- assert_int_equal(capability, 1);
- #endif // defined(_di_libcap_)
- }
-}
-
void test__f_capability_copy_internal__fails(void **state) {
#if !defined(_di_libcap_)
#endif // !defined(_di_libcap_)
}
+#ifndef _di_level_0_parameter_checking_
+ void test__f_capability_copy_internal__parameter_checking(void **state) {
+
+ f_capability_t capability = f_capability_t_initialize;
+ int stub = 0;
+ void *external = (void *) &stub;
+
+ {
+ const f_status_t status = f_capability_copy_internal(0, &capability);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+
+ {
+ const f_status_t status = f_capability_copy_internal(external, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
+void test__f_capability_copy_internal__works(void **state) {
+
+ f_capability_t capability = f_capability_t_initialize;
+ int stub = 0;
+ void *external = (void *) &stub;
+
+ #if defined(_di_libcap_)
+ printf("[ WARN ] f_capability_copy_internal() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_copy_int, false);
+ #endif // defined(_di_libcap_)
+
+ {
+ const f_status_t status = f_capability_copy_internal(external, &capability);
+
+ #if defined(_di_libcap_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_int_equal(status, F_none);
+ assert_int_equal(capability, 1);
+ #endif // defined(_di_libcap_)
+ }
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__copy_internal
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_copy_internal()
*/
-extern void test__f_capability_copy_internal__works(void **state);
+extern void test__f_capability_copy_internal__fails(void **state);
/**
- * Test that function fails.
+ * Test that parameter checking works as expected.
*
* @see f_capability_copy_internal()
*/
-extern void test__f_capability_copy_internal__fails(void **state);
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_capability_copy_internal__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
+/**
+ * Test that function works.
+ *
+ * @see f_capability_copy_internal()
+ */
+extern void test__f_capability_copy_internal__works(void **state);
#endif // _TEST__F_capability__copy_internal
extern "C" {
#endif
-void test__f_capability_delete__works(void **state) {
-
- f_capability_t capability = f_capability_t_initialize;
-
- #if defined(_di_libcap_)
- printf("[ WARN ] f_capability_delete() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_free, false);
- #endif // defined(_di_libcap_)
-
- {
- const f_status_t status = f_capability_delete(&capability);
-
- #if defined(_di_libcap_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_int_equal(status, F_none);
- assert_int_equal(capability, 0);
- #endif // defined(_di_libcap_)
- }
-}
-
void test__f_capability_delete__fails(void **state) {
#if !defined(_di_libcap_)
#endif // !defined(_di_libcap_)
}
+#ifndef _di_level_0_parameter_checking_
+ void test__f_capability_delete__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_capability_delete(0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
+void test__f_capability_delete__works(void **state) {
+
+ f_capability_t capability = f_capability_t_initialize;
+
+ #if defined(_di_libcap_)
+ printf("[ WARN ] f_capability_delete() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_free, false);
+ #endif // defined(_di_libcap_)
+
+ {
+ const f_status_t status = f_capability_delete(&capability);
+
+ #if defined(_di_libcap_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_int_equal(status, F_none);
+ assert_int_equal(capability, 0);
+ #endif // defined(_di_libcap_)
+ }
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__delete
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_delete()
*/
-extern void test__f_capability_delete__works(void **state);
+extern void test__f_capability_delete__fails(void **state);
/**
- * Test that function fails.
+ * Test that parameter checking works as expected.
*
* @see f_capability_delete()
*/
-extern void test__f_capability_delete__fails(void **state);
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_capability_delete__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
+/**
+ * Test that function works.
+ *
+ * @see f_capability_delete()
+ */
+extern void test__f_capability_delete__works(void **state);
#endif // _TEST__F_capability__delete
extern "C" {
#endif
-void test__f_capability_file_descriptor_get__works(void **state) {
-
- int descriptor = 0;
- f_capability_t capability = f_capability_t_initialize;
-
- #if defined(_di_libcap_)
- printf("[ WARN ] f_capability_file_descriptor_get() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_get_fd, false);
- #endif // defined(_di_libcap_)
-
- {
- const f_status_t status = f_capability_file_descriptor_get(descriptor, &capability);
-
- #if defined(_di_libcap_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_int_equal(status, F_none);
- #endif // defined(_di_libcap_)
- }
-}
-
void test__f_capability_file_descriptor_get__fails(void **state) {
#if !defined(_di_libcap_)
- int descriptor = 0;
+ const int descriptor = 0;
f_capability_t capability = f_capability_t_initialize;
int errnos[] = {
#endif // !defined(_di_libcap_)
}
+#ifndef _di_level_0_parameter_checking_
+ void test__f_capability_file_descriptor_get__parameter_checking(void **state) {
+
+ const int descriptor = 0;
+
+ {
+ const f_status_t status = f_capability_file_descriptor_get(descriptor, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
+void test__f_capability_file_descriptor_get__works(void **state) {
+
+ const int descriptor = 0;
+ f_capability_t capability = f_capability_t_initialize;
+
+ #if defined(_di_libcap_)
+ printf("[ WARN ] f_capability_file_descriptor_get() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_get_fd, false);
+ #endif // defined(_di_libcap_)
+
+ {
+ const f_status_t status = f_capability_file_descriptor_get(descriptor, &capability);
+
+ #if defined(_di_libcap_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_int_equal(status, F_none);
+ #endif // defined(_di_libcap_)
+ }
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__file_descriptor_get
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_file_descriptor_get()
*/
-extern void test__f_capability_file_descriptor_get__works(void **state);
+extern void test__f_capability_file_descriptor_get__fails(void **state);
/**
- * Test that function fails.
+ * Test that parameter checking works as expected.
*
* @see f_capability_file_descriptor_get()
*/
-extern void test__f_capability_file_descriptor_get__fails(void **state);
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_capability_file_descriptor_get__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
+/**
+ * Test that function works.
+ *
+ * @see f_capability_file_descriptor_get()
+ */
+extern void test__f_capability_file_descriptor_get__works(void **state);
#endif // _TEST__F_capability__file_descriptor_get
extern "C" {
#endif
-void test__f_capability_file_descriptor_set__works(void **state) {
-
- int descriptor = 0;
- f_capability_t capability = f_capability_t_initialize;
-
- #if defined(_di_libcap_)
- printf("[ WARN ] f_capability_file_descriptor_set() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_set_fd, false);
- #endif // defined(_di_libcap_)
-
- {
- const f_status_t status = f_capability_file_descriptor_set(descriptor, capability);
-
- #if defined(_di_libcap_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_int_equal(status, F_none);
- #endif // defined(_di_libcap_)
- }
-}
-
void test__f_capability_file_descriptor_set__fails(void **state) {
#if !defined(_di_libcap_)
- int descriptor = 0;
+ const int descriptor = 0;
f_capability_t capability = f_capability_t_initialize;
int errnos[] = {
#endif // !defined(_di_libcap_)
}
+void test__f_capability_file_descriptor_set__works(void **state) {
+
+ const int descriptor = 0;
+ f_capability_t capability = f_capability_t_initialize;
+
+ #if defined(_di_libcap_)
+ printf("[ WARN ] f_capability_file_descriptor_set() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_set_fd, false);
+ #endif // defined(_di_libcap_)
+
+ {
+ const f_status_t status = f_capability_file_descriptor_set(descriptor, capability);
+
+ #if defined(_di_libcap_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_int_equal(status, F_none);
+ #endif // defined(_di_libcap_)
+ }
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__file_descriptor_set
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_file_descriptor_set()
*/
-extern void test__f_capability_file_descriptor_set__works(void **state);
+extern void test__f_capability_file_descriptor_set__fails(void **state);
+
+// f_capability_file_descriptor_set() doesn't use parameter checking.
/**
- * Test that function fails.
+ * Test that function works.
*
* @see f_capability_file_descriptor_set()
*/
-extern void test__f_capability_file_descriptor_set__fails(void **state);
+extern void test__f_capability_file_descriptor_set__works(void **state);
#endif // _TEST__F_capability__file_descriptor_set
extern "C" {
#endif
-void test__f_capability_file_get__works(void **state) {
-
- f_string_t path = f_string_t_initialize;
- f_capability_t capability = f_capability_t_initialize;
-
- #if defined(_di_libcap_)
- printf("[ WARN ] f_capability_file_get() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_get_file, false);
- #endif // defined(_di_libcap_)
-
- {
- const f_status_t status = f_capability_file_get(path, &capability);
-
- #if defined(_di_libcap_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_int_equal(status, F_none);
- #endif // defined(_di_libcap_)
- }
-}
-
void test__f_capability_file_get__fails(void **state) {
#if !defined(_di_libcap_)
- f_string_t path = f_string_t_initialize;
+ const f_string_t path = f_string_t_initialize;
f_capability_t capability = f_capability_t_initialize;
int errnos[] = {
#endif // !defined(_di_libcap_)
}
+#ifndef _di_level_0_parameter_checking_
+ void test__f_capability_file_get__parameter_checking(void **state) {
+
+ const f_string_t path = f_string_t_initialize;
+
+ {
+ const f_status_t status = f_capability_file_get(path, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
+void test__f_capability_file_get__works(void **state) {
+
+ const f_string_t path = f_string_t_initialize;
+ f_capability_t capability = f_capability_t_initialize;
+
+ #if defined(_di_libcap_)
+ printf("[ WARN ] f_capability_file_get() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_get_file, false);
+ #endif // defined(_di_libcap_)
+
+ {
+ const f_status_t status = f_capability_file_get(path, &capability);
+
+ #if defined(_di_libcap_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_int_equal(status, F_none);
+ #endif // defined(_di_libcap_)
+ }
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__file_get
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_file_get()
*/
-extern void test__f_capability_file_get__works(void **state);
+extern void test__f_capability_file_get__fails(void **state);
/**
- * Test that function fails.
+ * Test that parameter checking works as expected.
*
* @see f_capability_file_get()
*/
-extern void test__f_capability_file_get__fails(void **state);
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_capability_file_get__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
+/**
+ * Test that function works.
+ *
+ * @see f_capability_file_get()
+ */
+extern void test__f_capability_file_get__works(void **state);
#endif // _TEST__F_capability__file_get
extern "C" {
#endif
-void test__f_capability_file_set__works(void **state) {
-
- f_string_t path = f_string_t_initialize;
- f_capability_t capability = f_capability_t_initialize;
-
- #if defined(_di_libcap_)
- printf("[ WARN ] f_capability_file_set() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_set_file, false);
- #endif // defined(_di_libcap_)
-
- {
- const f_status_t status = f_capability_file_set(path, capability);
-
- #if defined(_di_libcap_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_int_equal(status, F_none);
- #endif // defined(_di_libcap_)
- }
-}
-
void test__f_capability_file_set__fails(void **state) {
#if !defined(_di_libcap_)
- f_string_t path = f_string_t_initialize;
+ const f_string_t path = f_string_t_initialize;
f_capability_t capability = f_capability_t_initialize;
int errnos[] = {
#endif // !defined(_di_libcap_)
}
+void test__f_capability_file_set__works(void **state) {
+
+ const f_string_t path = f_string_t_initialize;
+ f_capability_t capability = f_capability_t_initialize;
+
+ #if defined(_di_libcap_)
+ printf("[ WARN ] f_capability_file_set() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_set_file, false);
+ #endif // defined(_di_libcap_)
+
+ {
+ const f_status_t status = f_capability_file_set(path, capability);
+
+ #if defined(_di_libcap_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_int_equal(status, F_none);
+ #endif // defined(_di_libcap_)
+ }
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__file_set
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_file_set()
*/
-extern void test__f_capability_file_set__works(void **state);
+extern void test__f_capability_file_set__fails(void **state);
+
+// f_capability_file_set() doesn't use parameter checking.
/**
- * Test that function fails.
+ * Test that function works.
*
* @see f_capability_file_set()
*/
-extern void test__f_capability_file_set__fails(void **state);
+extern void test__f_capability_file_set__works(void **state);
#endif // _TEST__F_capability__file_set
extern "C" {
#endif
-void test__f_capability_flag_get__works(void **state) {
-
- f_capability_flag_t flag = f_capability_flag_t_initialize;
- f_capability_flag_value_t value = f_capability_flag_value_t_initialize;
- f_capability_t capability = f_capability_t_initialize;
- f_capability_value_t capability_value = f_capability_value_t_initialize;
-
- #if defined(_di_libcap_)
- printf("[ WARN ] f_capability_flag_get() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_get_flag, false);
- #endif // defined(_di_libcap_)
-
- {
- const f_status_t status = f_capability_flag_get(capability, capability_value, flag, &value);
-
- #if defined(_di_libcap_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_int_equal(status, F_none);
- #endif // defined(_di_libcap_)
- }
-}
-
void test__f_capability_flag_get__fails(void **state) {
#if !defined(_di_libcap_)
- f_capability_flag_t flag = f_capability_flag_t_initialize;
+ const f_capability_flag_t flag = f_capability_flag_t_initialize;
+ const f_capability_t capability = f_capability_t_initialize;
+ const f_capability_value_t capability_value = f_capability_value_t_initialize;
f_capability_flag_value_t value = f_capability_flag_value_t_initialize;
- f_capability_t capability = f_capability_t_initialize;
- f_capability_value_t capability_value = f_capability_value_t_initialize;
int errnos[] = {
EINVAL,
#endif // !defined(_di_libcap_)
}
+#ifndef _di_level_0_parameter_checking_
+ void test__f_capability_flag_get__parameter_checking(void **state) {
+
+ const f_capability_flag_t flag = f_capability_flag_t_initialize;
+ const f_capability_t capability = f_capability_t_initialize;
+ const f_capability_value_t capability_value = f_capability_value_t_initialize;
+
+ {
+ const f_status_t status = f_capability_flag_get(capability, capability_value, flag, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
+void test__f_capability_flag_get__works(void **state) {
+
+ const f_capability_flag_t flag = f_capability_flag_t_initialize;
+ const f_capability_t capability = f_capability_t_initialize;
+ const f_capability_value_t capability_value = f_capability_value_t_initialize;
+ f_capability_flag_value_t value = f_capability_flag_value_t_initialize;
+
+ #if defined(_di_libcap_)
+ printf("[ WARN ] f_capability_flag_get() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_get_flag, false);
+ #endif // defined(_di_libcap_)
+
+ {
+ const f_status_t status = f_capability_flag_get(capability, capability_value, flag, &value);
+
+ #if defined(_di_libcap_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_int_equal(status, F_none);
+ #endif // defined(_di_libcap_)
+ }
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__flag_get
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_flag_get()
*/
-extern void test__f_capability_flag_get__works(void **state);
+extern void test__f_capability_flag_get__fails(void **state);
/**
- * Test that function fails.
+ * Test that parameter checking works as expected.
*
* @see f_capability_flag_get()
*/
-extern void test__f_capability_flag_get__fails(void **state);
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_capability_flag_get__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
+/**
+ * Test that function works.
+ *
+ * @see f_capability_flag_get()
+ */
+extern void test__f_capability_flag_get__works(void **state);
#endif // _TEST__F_capability__flag_get
extern "C" {
#endif
-void test__f_capability_flag_set__works(void **state) {
-
- f_capability_flag_t flag = f_capability_flag_t_initialize;
- f_capability_flag_value_t value = f_capability_flag_value_t_initialize;
- f_int32s_t codes = f_int32s_t_initialize;
- f_capability_t capability = f_capability_t_initialize;
-
- #if defined(_di_libcap_)
- printf("[ WARN ] f_capability_flag_set() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_set_flag, false);
- #endif // defined(_di_libcap_)
-
- {
- const f_status_t status = f_capability_flag_set(flag, value, codes, &capability);
-
- #if defined(_di_libcap_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_int_equal(status, F_none);
- #endif // defined(_di_libcap_)
- }
-}
-
void test__f_capability_flag_set__fails(void **state) {
#if !defined(_di_libcap_)
- f_capability_flag_t flag = f_capability_flag_t_initialize;
- f_capability_flag_value_t value = f_capability_flag_value_t_initialize;
- f_int32s_t codes = f_int32s_t_initialize;
+ const f_capability_flag_t flag = f_capability_flag_t_initialize;
+ const f_capability_flag_value_t value = f_capability_flag_value_t_initialize;
+ const f_int32s_t codes = f_int32s_t_initialize;
f_capability_t capability = f_capability_t_initialize;
int errnos[] = {
#endif // !defined(_di_libcap_)
}
+#ifndef _di_level_0_parameter_checking_
+ void test__f_capability_flag_set__parameter_checking(void **state) {
+
+ const f_capability_flag_t flag = f_capability_flag_t_initialize;
+ const f_capability_flag_value_t value = f_capability_flag_value_t_initialize;
+ const f_int32s_t codes = f_int32s_t_initialize;
+
+ {
+ const f_status_t status = f_capability_flag_set(flag, value, codes, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
+void test__f_capability_flag_set__works(void **state) {
+
+ const f_capability_flag_t flag = f_capability_flag_t_initialize;
+ const f_capability_flag_value_t value = f_capability_flag_value_t_initialize;
+ const f_int32s_t codes = f_int32s_t_initialize;
+ f_capability_t capability = f_capability_t_initialize;
+
+ #if defined(_di_libcap_)
+ printf("[ WARN ] f_capability_flag_set() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_set_flag, false);
+ #endif // defined(_di_libcap_)
+
+ {
+ const f_status_t status = f_capability_flag_set(flag, value, codes, &capability);
+
+ #if defined(_di_libcap_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_int_equal(status, F_none);
+ #endif // defined(_di_libcap_)
+ }
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__flag_set
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_flag_set()
*/
-extern void test__f_capability_flag_set__works(void **state);
+extern void test__f_capability_flag_set__fails(void **state);
/**
- * Test that function fails.
+ * Test that parameter checking works as expected.
*
* @see f_capability_flag_set()
*/
-extern void test__f_capability_flag_set__fails(void **state);
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_capability_flag_set__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
+/**
+ * Test that function works.
+ *
+ * @see f_capability_flag_set()
+ */
+extern void test__f_capability_flag_set__works(void **state);
#endif // _TEST__F_capability__flag_set
extern "C" {
#endif
-void test__f_capability_from_name__works(void **state) {
-
- f_string_t name = f_string_t_initialize;
- f_capability_value_t capability_value = f_capability_value_t_initialize;
-
- #if defined(_di_libcap_)
- printf("[ WARN ] f_capability_from_name() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_from_name, false);
- #endif // defined(_di_libcap_)
-
- {
- const f_status_t status = f_capability_from_name(name, &capability_value);
-
- #if defined(_di_libcap_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_int_equal(status, F_none);
- #endif // defined(_di_libcap_)
- }
-}
-
void test__f_capability_from_name__fails(void **state) {
#if !defined(_di_libcap_)
- f_string_t name = f_string_t_initialize;
+ const f_string_t name = f_string_t_initialize;
f_capability_value_t capability_value = f_capability_value_t_initialize;
int errnos[] = {
#endif // !defined(_di_libcap_)
}
+#ifndef _di_level_0_parameter_checking_
+ void test__f_capability_from_name__parameter_checking(void **state) {
+
+ const f_string_t name = f_string_t_initialize;
+
+ {
+ const f_status_t status = f_capability_from_name(name, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
+void test__f_capability_from_name__works(void **state) {
+
+ const f_string_t name = f_string_t_initialize;
+ f_capability_value_t capability_value = f_capability_value_t_initialize;
+
+ #if defined(_di_libcap_)
+ printf("[ WARN ] f_capability_from_name() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_from_name, false);
+ #endif // defined(_di_libcap_)
+
+ {
+ const f_status_t status = f_capability_from_name(name, &capability_value);
+
+ #if defined(_di_libcap_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_int_equal(status, F_none);
+ #endif // defined(_di_libcap_)
+ }
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__from_name
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_from_name()
*/
-extern void test__f_capability_from_name__works(void **state);
+extern void test__f_capability_from_name__fails(void **state);
/**
- * Test that function fails.
+ * Test that parameter checking works as expected.
*
* @see f_capability_from_name()
*/
-extern void test__f_capability_from_name__fails(void **state);
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_capability_from_name__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
+/**
+ * Test that function works.
+ *
+ * @see f_capability_from_name()
+ */
+extern void test__f_capability_from_name__works(void **state);
#endif // _TEST__F_capability__from_name
extern "C" {
#endif
-void test__f_capability_from_text__works(void **state) {
-
- f_string_t text = f_string_t_initialize;
- f_capability_t capability = f_capability_t_initialize;
-
- #if defined(_di_libcap_)
- printf("[ WARN ] f_capability_from_text() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_from_text, false);
- #endif // defined(_di_libcap_)
-
- {
- const f_status_t status = f_capability_from_text(text, &capability);
-
- #if defined(_di_libcap_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_int_equal(status, F_none);
- #endif // defined(_di_libcap_)
- }
-}
-
void test__f_capability_from_text__fails(void **state) {
#if !defined(_di_libcap_)
- f_string_t text = f_string_t_initialize;
+ const f_string_t text = f_string_t_initialize;
f_capability_t capability = f_capability_t_initialize;
int errnos[] = {
#endif // !defined(_di_libcap_)
}
+#ifndef _di_level_0_parameter_checking_
+ void test__f_capability_from_text__parameter_checking(void **state) {
+
+ const f_string_t text = f_string_t_initialize;
+
+ {
+ const f_status_t status = f_capability_from_text(text, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
+void test__f_capability_from_text__works(void **state) {
+
+ const f_string_t text = f_string_t_initialize;
+ f_capability_t capability = f_capability_t_initialize;
+
+ #if defined(_di_libcap_)
+ printf("[ WARN ] f_capability_from_text() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_from_text, false);
+ #endif // defined(_di_libcap_)
+
+ {
+ const f_status_t status = f_capability_from_text(text, &capability);
+
+ #if defined(_di_libcap_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_int_equal(status, F_none);
+ #endif // defined(_di_libcap_)
+ }
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__from_text
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_from_text()
*/
-extern void test__f_capability_from_text__works(void **state);
+extern void test__f_capability_from_text__fails(void **state);
/**
- * Test that function fails.
+ * Test that parameter checking works as expected.
*
* @see f_capability_from_text()
*/
-extern void test__f_capability_from_text__fails(void **state);
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_capability_from_text__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
+/**
+ * Test that function works.
+ *
+ * @see f_capability_from_text()
+ */
+extern void test__f_capability_from_text__works(void **state);
#endif // _TEST__F_capability__from_text
extern "C" {
#endif
-void test__f_capability_groups_set__works(void **state) {
-
- gid_t group;
- size_t total = 2;
- gid_t groups[total];
-
- #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
- printf("[ WARN ] f_capability_groups_set() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_setgroups, false);
- #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
-
- {
- const f_status_t status = f_capability_groups_set(group, total, groups);
-
- #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_int_equal(status, F_none);
- #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
- }
-}
-
void test__f_capability_groups_set__fails(void **state) {
#if !defined(_di_libcap_) && !defined(_libcap_legacy_only_)
- gid_t group;
- size_t total = 2;
- gid_t groups[total];
+ const gid_t group = 1;
+ const size_t total = 2;
+ const gid_t groups[] = { 3, 4 };
int errnos[] = {
EINVAL,
#endif // !defined(_di_libcap_) && !defined(_libcap_legacy_only_)
}
+void test__f_capability_groups_set__works(void **state) {
+
+ const gid_t group = 1;
+ const size_t total = 2;
+ const gid_t groups[] = { 3, 4 };
+
+ #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
+ printf("[ WARN ] f_capability_groups_set() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_setgroups, false);
+ #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
+
+ {
+ const f_status_t status = f_capability_groups_set(group, total, groups);
+
+ #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_int_equal(status, F_none);
+ #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
+ }
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__groups_set
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_groups_set()
*/
-extern void test__f_capability_groups_set__works(void **state);
+extern void test__f_capability_groups_set__fails(void **state);
+
+// f_capability_groups_set() doesn't use parameter checking.
/**
- * Test that function fails.
+ * Test that function works.
*
* @see f_capability_groups_set()
*/
-extern void test__f_capability_groups_set__fails(void **state);
+extern void test__f_capability_groups_set__works(void **state);
#endif // _TEST__F_capability__groups_set
extern "C" {
#endif
-void test__f_capability_initialize__works(void **state) {
-
- f_capability_t capability = f_capability_t_initialize;
-
- #if defined(_di_libcap_)
- printf("[ WARN ] f_capability_initialize() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_init, false);
- #endif // defined(_di_libcap_)
-
- {
- const f_status_t status = f_capability_initialize(&capability);
-
- #if defined(_di_libcap_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_int_equal(status, F_none);
- #endif // defined(_di_libcap_)
- }
-}
-
void test__f_capability_initialize__fails(void **state) {
#if !defined(_di_libcap_)
#endif // !defined(_di_libcap_)
}
+#ifndef _di_level_0_parameter_checking_
+ void test__f_capability_initialize__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_capability_initialize(0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
+void test__f_capability_initialize__works(void **state) {
+
+ f_capability_t capability = f_capability_t_initialize;
+
+ #if defined(_di_libcap_)
+ printf("[ WARN ] f_capability_initialize() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_init, false);
+ #endif // defined(_di_libcap_)
+
+ {
+ const f_status_t status = f_capability_initialize(&capability);
+
+ #if defined(_di_libcap_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_int_equal(status, F_none);
+ #endif // defined(_di_libcap_)
+ }
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__initialize
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_initialize()
*/
-extern void test__f_capability_initialize__works(void **state);
+extern void test__f_capability_initialize__fails(void **state);
/**
- * Test that function fails.
+ * Test that parameter checking works as expected.
*
* @see f_capability_initialize()
*/
-extern void test__f_capability_initialize__fails(void **state);
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_capability_initialize__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
+/**
+ * Test that function works.
+ *
+ * @see f_capability_initialize()
+ */
+extern void test__f_capability_initialize__works(void **state);
#endif // _TEST__F_capability__initialize
extern "C" {
#endif
+#ifndef _di_level_0_parameter_checking_
+ void test__f_capability_mode_get__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_capability_mode_get(0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
void test__f_capability_mode_get__works(void **state) {
f_capability_mode_t mode = f_capability_mode_t_initialize;
#ifndef _TEST__F_capability__mode_get
#define _TEST__F_capability__mode_get
+// cap_get_mode() doesn't return failure.
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_capability_mode_get()
+ */
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_capability_mode_get__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
/**
* Test that function works.
*
*/
extern void test__f_capability_mode_get__works(void **state);
-// cap_get_mode() doesn't return failure.
-
#endif // _TEST__F_capability__mode_get
extern "C" {
#endif
+#ifndef _di_level_0_parameter_checking_
+ void test__f_capability_mode_get_name__parameter_checking(void **state) {
+
+ const f_capability_mode_t mode = f_capability_mode_t_initialize;
+
+ {
+ const f_status_t status = f_capability_mode_get_name(mode, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
void test__f_capability_mode_get_name__works(void **state) {
- f_capability_mode_t mode = f_capability_mode_t_initialize;
+ const f_capability_mode_t mode = f_capability_mode_t_initialize;
f_string_constant_t constant = f_string_constant_t_initialize;
#if defined(_di_libcap_) || defined(_libcap_legacy_only_)
#ifndef _TEST__F_capability__mode_get_name
#define _TEST__F_capability__mode_get_name
+// cap_mode_name() doesn't return failure.
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_capability_mode_get_name()
+ */
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_capability_mode_get_name__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
/**
* Test that function works.
*
*/
extern void test__f_capability_mode_get_name__works(void **state);
-// cap_mode_name() doesn't return failure.
-
#endif // _TEST__F_capability__mode_get_name
extern "C" {
#endif
-void test__f_capability_mode_set__works(void **state) {
-
- f_capability_mode_t mode = f_capability_mode_t_initialize;
-
- #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
- printf("[ WARN ] f_capability_mode_set() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_mode_set, false);
- #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
-
- {
- const f_status_t status = f_capability_mode_set(mode);
-
- #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_int_equal(status, F_none);
- #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
- }
-}
-
void test__f_capability_mode_set__fails(void **state) {
#if !defined(_di_libcap_) && !defined(_libcap_legacy_only_)
- f_capability_mode_t mode = f_capability_mode_t_initialize;
+ const f_capability_mode_t mode = f_capability_mode_t_initialize;
int errnos[] = {
EINVAL,
#endif // !defined(_di_libcap_) && !defined(_libcap_legacy_only_)
}
+void test__f_capability_mode_set__works(void **state) {
+
+ const f_capability_mode_t mode = f_capability_mode_t_initialize;
+
+ #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
+ printf("[ WARN ] f_capability_mode_set() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_mode_set, false);
+ #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
+
+ {
+ const f_status_t status = f_capability_mode_set(mode);
+
+ #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_int_equal(status, F_none);
+ #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
+ }
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__mode_set
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_mode_set()
*/
-extern void test__f_capability_mode_set__works(void **state);
+extern void test__f_capability_mode_set__fails(void **state);
+
+// f_capability_mode_set() doesn't use parameter checking.
/**
- * Test that function fails.
+ * Test that function works.
*
* @see f_capability_mode_set()
*/
-extern void test__f_capability_mode_set__fails(void **state);
+extern void test__f_capability_mode_set__works(void **state);
#endif // _TEST__F_capability__mode_set
extern "C" {
#endif
+#ifndef _di_level_0_parameter_checking_
+ void test__f_capability_owner_get__parameter_checking(void **state) {
+
+ const f_capability_t capability = f_capability_t_initialize;
+
+ {
+ const f_status_t status = f_capability_owner_get(capability, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
void test__f_capability_owner_get__works(void **state) {
- f_capability_t capability = f_capability_t_initialize;
+ const f_capability_t capability = f_capability_t_initialize;
uid_t id;
#if defined(_di_libcap_) || defined(_libcap_legacy_only_)
#ifndef _TEST__F_capability__owner_get
#define _TEST__F_capability__owner_get
+// cap_mode_name() doesn't return failure.
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_capability_owner_get()
+ */
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_capability_owner_get__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
/**
* Test that function works.
*
*/
extern void test__f_capability_owner_get__works(void **state);
-// cap_mode_name() doesn't return failure.
-
#endif // _TEST__F_capability__owner_get
extern "C" {
#endif
-void test__f_capability_owner_set__works(void **state) {
-
- f_capability_t capability = f_capability_t_initialize;
- uid_t id;
-
- #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
- printf("[ WARN ] f_capability_owner_set() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_set_nsowner, false);
- #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
-
- {
- const f_status_t status = f_capability_owner_set(capability, id);
-
- #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_int_equal(status, F_none);
- #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
- }
-}
-
void test__f_capability_owner_set__fails(void **state) {
#if !defined(_di_libcap_) && !defined(_libcap_legacy_only_)
- f_capability_t capability = f_capability_t_initialize;
- uid_t id;
+ const f_capability_t capability = f_capability_t_initialize;
+ const uid_t id;
int errnos[] = {
EACCES,
#endif // !defined(_di_libcap_) && !defined(_libcap_legacy_only_)
}
+void test__f_capability_owner_set__works(void **state) {
+
+ const f_capability_t capability = f_capability_t_initialize;
+ const uid_t id;
+
+ #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
+ printf("[ WARN ] f_capability_owner_set() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_set_nsowner, false);
+ #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
+
+ {
+ const f_status_t status = f_capability_owner_set(capability, id);
+
+ #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_int_equal(status, F_none);
+ #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
+ }
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__owner_set
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_owner_set()
*/
-extern void test__f_capability_owner_set__works(void **state);
+extern void test__f_capability_owner_set__fails(void **state);
+
+// f_capability_owner_set() doesn't use parameter checking.
/**
- * Test that function fails.
+ * Test that function works.
*
* @see f_capability_owner_set()
*/
-extern void test__f_capability_owner_set__fails(void **state);
+extern void test__f_capability_owner_set__works(void **state);
#endif // _TEST__F_capability__owner_set
extern "C" {
#endif
-void test__f_capability_process_bound_drop__works(void **state) {
-
- f_capability_value_t value = f_capability_value_t_initialize;
- int bound = 0;
-
- #if defined(_di_libcap_)
- printf("[ WARN ] f_capability_process_bound_drop() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_drop_bound, false);
- #endif // defined(_di_libcap_)
-
- {
- const f_status_t status = f_capability_process_bound_drop(value, &bound);
-
- #if defined(_di_libcap_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_int_equal(status, F_none);
- assert_int_equal(bound, 1);
- #endif // defined(_di_libcap_)
- }
-}
-
void test__f_capability_process_bound_drop__fails(void **state) {
#if !defined(_di_libcap_)
- f_capability_value_t value = f_capability_value_t_initialize;
+ const f_capability_value_t value = f_capability_value_t_initialize;
int bound = 0;
int errnos[] = {
#endif // !defined(_di_libcap_)
}
+#ifndef _di_level_0_parameter_checking_
+ void test__f_capability_process_bound_drop__parameter_checking(void **state) {
+
+ const f_capability_value_t value = f_capability_value_t_initialize;
+
+ {
+ const f_status_t status = f_capability_process_bound_drop(value, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
+void test__f_capability_process_bound_drop__works(void **state) {
+
+ const f_capability_value_t value = f_capability_value_t_initialize;
+ int bound = 0;
+
+ #if defined(_di_libcap_)
+ printf("[ WARN ] f_capability_process_bound_drop() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_drop_bound, false);
+ #endif // defined(_di_libcap_)
+
+ {
+ const f_status_t status = f_capability_process_bound_drop(value, &bound);
+
+ #if defined(_di_libcap_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_int_equal(status, F_none);
+ assert_int_equal(bound, 1);
+ #endif // defined(_di_libcap_)
+ }
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__process_bound_drop
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_process_bound_drop()
*/
-extern void test__f_capability_process_bound_drop__works(void **state);
+extern void test__f_capability_process_bound_drop__fails(void **state);
/**
- * Test that function fails.
+ * Test that parameter checking works as expected.
*
* @see f_capability_process_bound_drop()
*/
-extern void test__f_capability_process_bound_drop__fails(void **state);
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_capability_process_bound_drop__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
+/**
+ * Test that function works.
+ *
+ * @see f_capability_process_bound_drop()
+ */
+extern void test__f_capability_process_bound_drop__works(void **state);
#endif // _TEST__F_capability__process_bound_drop
extern "C" {
#endif
-void test__f_capability_process_bound_get__works(void **state) {
-
- f_capability_value_t value = f_capability_value_t_initialize;
- int bound = 0;
-
- #if defined(_di_libcap_)
- printf("[ WARN ] f_capability_process_bound_get() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_get_bound, false);
- #endif // defined(_di_libcap_)
-
- {
- const f_status_t status = f_capability_process_bound_get(value, &bound);
-
- #if defined(_di_libcap_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_int_equal(status, F_none);
- assert_int_equal(bound, 1);
- #endif // defined(_di_libcap_)
- }
-}
-
void test__f_capability_process_bound_get__fails(void **state) {
#if !defined(_di_libcap_)
- f_capability_value_t value = f_capability_value_t_initialize;
+ const f_capability_value_t value = f_capability_value_t_initialize;
int bound = 0;
int errnos[] = {
#endif // !defined(_di_libcap_)
}
+#ifndef _di_level_0_parameter_checking_
+ void test__f_capability_process_bound_get__parameter_checking(void **state) {
+
+ const f_capability_value_t value = f_capability_value_t_initialize;
+
+ {
+ const f_status_t status = f_capability_process_bound_get(value, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
+void test__f_capability_process_bound_get__works(void **state) {
+
+ const f_capability_value_t value = f_capability_value_t_initialize;
+ int bound = 0;
+
+ #if defined(_di_libcap_)
+ printf("[ WARN ] f_capability_process_bound_get() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_get_bound, false);
+ #endif // defined(_di_libcap_)
+
+ {
+ const f_status_t status = f_capability_process_bound_get(value, &bound);
+
+ #if defined(_di_libcap_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_int_equal(status, F_none);
+ assert_int_equal(bound, 1);
+ #endif // defined(_di_libcap_)
+ }
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__process_bound_get
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_process_bound_get()
*/
-extern void test__f_capability_process_bound_get__works(void **state);
+extern void test__f_capability_process_bound_get__fails(void **state);
/**
- * Test that function fails.
+ * Test that parameter checking works as expected.
*
* @see f_capability_process_bound_get()
*/
-extern void test__f_capability_process_bound_get__fails(void **state);
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_capability_process_bound_get__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
+/**
+ * Test that function works.
+ *
+ * @see f_capability_process_bound_get()
+ */
+extern void test__f_capability_process_bound_get__works(void **state);
#endif // _TEST__F_capability__process_bound_get
extern "C" {
#endif
-void test__f_capability_process_get__works(void **state) {
-
- f_capability_t capability = f_capability_t_initialize;
-
- #if defined(_di_libcap_)
- printf("[ WARN ] f_capability_process_get() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_get_proc, false);
- #endif // defined(_di_libcap_)
-
- {
- const f_status_t status = f_capability_process_get(&capability);
-
- #if defined(_di_libcap_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_int_equal(status, F_none);
- #endif // defined(_di_libcap_)
- }
-}
-
void test__f_capability_process_get__fails(void **state) {
#if !defined(_di_libcap_)
#endif // !defined(_di_libcap_)
}
+#ifndef _di_level_0_parameter_checking_
+ void test__f_capability_process_get__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_capability_process_get(0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
+void test__f_capability_process_get__works(void **state) {
+
+ f_capability_t capability = f_capability_t_initialize;
+
+ #if defined(_di_libcap_)
+ printf("[ WARN ] f_capability_process_get() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_get_proc, false);
+ #endif // defined(_di_libcap_)
+
+ {
+ const f_status_t status = f_capability_process_get(&capability);
+
+ #if defined(_di_libcap_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_int_equal(status, F_none);
+ #endif // defined(_di_libcap_)
+ }
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__process_get
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_process_get()
*/
-extern void test__f_capability_process_get__works(void **state);
+extern void test__f_capability_process_get__fails(void **state);
/**
- * Test that function fails.
+ * Test that parameter checking works as expected.
*
* @see f_capability_process_get()
*/
-extern void test__f_capability_process_get__fails(void **state);
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_capability_process_get__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
+/**
+ * Test that function works.
+ *
+ * @see f_capability_process_get()
+ */
+extern void test__f_capability_process_get__works(void **state);
#endif // _TEST__F_capability__process_get
extern "C" {
#endif
-void test__f_capability_process_get_by_id__works(void **state) {
-
- f_capability_t capability = f_capability_t_initialize;
- pid_t pid;
-
- #if defined(_di_libcap_)
- printf("[ WARN ] f_capability_process_get_by_id() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_get_pid, false);
- #endif // defined(_di_libcap_)
-
- {
- const f_status_t status = f_capability_process_get_by_id(pid, &capability);
-
- #if defined(_di_libcap_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_int_equal(status, F_none);
- assert_int_equal(capability, 1);
- #endif // defined(_di_libcap_)
- }
-}
-
void test__f_capability_process_get_by_id__fails(void **state) {
#if !defined(_di_libcap_)
f_capability_t capability = f_capability_t_initialize;
- pid_t pid;
+ const pid_t pid = 0;
int errnos[] = {
mock_errno_generic,
#endif // !defined(_di_libcap_)
}
+#ifndef _di_level_0_parameter_checking_
+ void test__f_capability_process_get_by_id__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_capability_process_get_by_id(0, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
+void test__f_capability_process_get_by_id__works(void **state) {
+
+ f_capability_t capability = f_capability_t_initialize;
+ const pid_t pid = 0;
+
+ #if defined(_di_libcap_)
+ printf("[ WARN ] f_capability_process_get_by_id() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_get_pid, false);
+ #endif // defined(_di_libcap_)
+
+ {
+ const f_status_t status = f_capability_process_get_by_id(pid, &capability);
+
+ #if defined(_di_libcap_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_int_equal(status, F_none);
+ assert_int_equal(capability, 1);
+ #endif // defined(_di_libcap_)
+ }
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__process_get_by_id
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_process_get_by_id()
*/
-extern void test__f_capability_process_get_by_id__works(void **state);
+extern void test__f_capability_process_get_by_id__fails(void **state);
/**
- * Test that function fails.
+ * Test that parameter checking works as expected.
*
* @see f_capability_process_get_by_id()
*/
-extern void test__f_capability_process_get_by_id__fails(void **state);
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_capability_process_get_by_id__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
+/**
+ * Test that function works.
+ *
+ * @see f_capability_process_get_by_id()
+ */
+extern void test__f_capability_process_get_by_id__works(void **state);
#endif // _TEST__F_capability__process_get_by_id
extern "C" {
#endif
-void test__f_capability_process_set__works(void **state) {
-
- f_capability_t capability = f_capability_t_initialize;
-
- #if defined(_di_libcap_)
- printf("[ WARN ] f_capability_process_set() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_set_proc, false);
- #endif // defined(_di_libcap_)
-
- {
- const f_status_t status = f_capability_process_set(capability);
-
- #if defined(_di_libcap_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_int_equal(status, F_none);
- #endif // defined(_di_libcap_)
- }
-}
-
void test__f_capability_process_set__fails(void **state) {
#if !defined(_di_libcap_)
- f_capability_t capability = f_capability_t_initialize;
+ const f_capability_t capability = f_capability_t_initialize;
int errnos[] = {
EINVAL,
#endif // !defined(_di_libcap_)
}
+void test__f_capability_process_set__works(void **state) {
+
+ const f_capability_t capability = f_capability_t_initialize;
+
+ #if defined(_di_libcap_)
+ printf("[ WARN ] f_capability_process_set() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_set_proc, false);
+ #endif // defined(_di_libcap_)
+
+ {
+ const f_status_t status = f_capability_process_set(capability);
+
+ #if defined(_di_libcap_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_int_equal(status, F_none);
+ #endif // defined(_di_libcap_)
+ }
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__process_set
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_process_set()
*/
-extern void test__f_capability_process_set__works(void **state);
+extern void test__f_capability_process_set__fails(void **state);
+
+// f_capability_process_set() doesn't use parameter checking.
/**
- * Test that function fails.
+ * Test that function works.
*
* @see f_capability_process_set()
*/
-extern void test__f_capability_process_set__fails(void **state);
+extern void test__f_capability_process_set__works(void **state);
#endif // _TEST__F_capability__process_set
extern "C" {
#endif
-void test__f_capability_security_bits_get__works(void **state) {
-
- f_capability_bits_t bits = f_capability_bits_t_initialize;
-
- #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
- printf("[ WARN ] f_capability_security_bits_get() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_get_secbits, false);
- #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
-
- {
- const f_status_t status = f_capability_security_bits_get(&bits);
-
- #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_int_equal(status, F_none);
- #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
- }
-}
-
void test__f_capability_security_bits_get__fails(void **state) {
#if !defined(_di_libcap_) && !defined(_libcap_legacy_only_)
#endif // !defined(_di_libcap_) && !defined(_libcap_legacy_only_)
}
+#ifndef _di_level_0_parameter_checking_
+ void test__f_capability_security_bits_get__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_capability_security_bits_get(0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
+void test__f_capability_security_bits_get__works(void **state) {
+
+ f_capability_bits_t bits = f_capability_bits_t_initialize;
+
+ #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
+ printf("[ WARN ] f_capability_security_bits_get() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_get_secbits, false);
+ #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
+
+ {
+ const f_status_t status = f_capability_security_bits_get(&bits);
+
+ #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_int_equal(status, F_none);
+ #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
+ }
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__security_bits_get
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_security_bits_get()
*/
-extern void test__f_capability_security_bits_get__works(void **state);
+extern void test__f_capability_security_bits_get__fails(void **state);
/**
- * Test that function fails.
+ * Test that parameter checking works as expected.
*
* @see f_capability_security_bits_get()
*/
-extern void test__f_capability_security_bits_get__fails(void **state);
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_capability_security_bits_get__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
+/**
+ * Test that function works.
+ *
+ * @see f_capability_security_bits_get()
+ */
+extern void test__f_capability_security_bits_get__works(void **state);
#endif // _TEST__F_capability__security_bits_get
extern "C" {
#endif
-void test__f_capability_security_bits_set__works(void **state) {
-
- f_capability_bits_t bits = f_capability_bits_t_initialize;
-
- #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
- printf("[ WARN ] f_capability_security_bits_set() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_set_secbits, false);
- #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
-
- {
- const f_status_t status = f_capability_security_bits_set(bits);
-
- #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_int_equal(status, F_none);
- #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
- }
-}
-
void test__f_capability_security_bits_set__fails(void **state) {
#if !defined(_di_libcap_) && !defined(_libcap_legacy_only_)
- f_capability_bits_t bits = f_capability_bits_t_initialize;
+ const f_capability_bits_t bits = f_capability_bits_t_initialize;
int errnos[] = {
EACCES,
#endif // !defined(_di_libcap_) && !defined(_libcap_legacy_only_)
}
+void test__f_capability_security_bits_set__works(void **state) {
+
+ const f_capability_bits_t bits = f_capability_bits_t_initialize;
+
+ #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
+ printf("[ WARN ] f_capability_security_bits_set() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_set_secbits, false);
+ #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
+
+ {
+ const f_status_t status = f_capability_security_bits_set(bits);
+
+ #if defined(_di_libcap_) || defined(_libcap_legacy_only_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_int_equal(status, F_none);
+ #endif // defined(_di_libcap_) || defined(_libcap_legacy_only_)
+ }
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__security_bits_set
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_security_bits_set()
*/
-extern void test__f_capability_security_bits_set__works(void **state);
+extern void test__f_capability_security_bits_set__fails(void **state);
+
+// f_capability_security_bits_set() doesn't use parameter checking.
/**
- * Test that function fails.
+ * Test that function works.
*
* @see f_capability_security_bits_set()
*/
-extern void test__f_capability_security_bits_set__fails(void **state);
+extern void test__f_capability_security_bits_set__works(void **state);
#endif // _TEST__F_capability__security_bits_set
extern "C" {
#endif
-void test__f_capability_size__works(void **state) {
-
- f_capability_t capability = f_capability_t_initialize;
- ssize_t size = 0;
-
- #if defined(_di_libcap_)
- printf("[ WARN ] f_capability_size() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_size, false);
- #endif // defined(_di_libcap_)
-
- {
- const f_status_t status = f_capability_size(capability, &size);
-
- #if defined(_di_libcap_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_int_equal(status, F_none);
- assert_int_equal(size, 1);
- #endif // defined(_di_libcap_)
- }
-}
-
void test__f_capability_size__fails(void **state) {
#if !defined(_di_libcap_)
- f_capability_t capability = f_capability_t_initialize;
+ const f_capability_t capability = f_capability_t_initialize;
ssize_t size = 0;
int errnos[] = {
#endif // !defined(_di_libcap_)
}
+#ifndef _di_level_0_parameter_checking_
+ void test__f_capability_size__parameter_checking(void **state) {
+
+ const f_capability_t capability = f_capability_t_initialize;
+
+ {
+ const f_status_t status = f_capability_size(capability, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
+void test__f_capability_size__works(void **state) {
+
+ const f_capability_t capability = f_capability_t_initialize;
+ ssize_t size = 0;
+
+ #if defined(_di_libcap_)
+ printf("[ WARN ] f_capability_size() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_size, false);
+ #endif // defined(_di_libcap_)
+
+ {
+ const f_status_t status = f_capability_size(capability, &size);
+
+ #if defined(_di_libcap_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_int_equal(status, F_none);
+ assert_int_equal(size, 1);
+ #endif // defined(_di_libcap_)
+ }
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__size
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_size()
*/
-extern void test__f_capability_size__works(void **state);
+extern void test__f_capability_size__fails(void **state);
/**
- * Test that function fails.
+ * Test that parameter checking works as expected.
*
* @see f_capability_size()
*/
-extern void test__f_capability_size__fails(void **state);
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_capability_size__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
+/**
+ * Test that function works.
+ *
+ * @see f_capability_size()
+ */
+extern void test__f_capability_size__works(void **state);
#endif // _TEST__F_capability__size
#ifndef _TEST__F_capability__supported
#define _TEST__F_capability__supported
+// f_capability_supported() doesn't return failure.
+
+// f_capability_supported() doesn't use parameter checking.
+
/**
* Test that function works.
*
*/
extern void test__f_capability_supported__works(void **state);
-// f_capability_supported() doesn't return failure.
-
#endif // _TEST__F_capability__supported
#ifndef _TEST__F_capability__supported_ambient
#define _TEST__F_capability__supported_ambient
+// f_capability_supported_ambient() doesn't return failure.
+
+// f_capability_supported_ambient() doesn't use parameter checking.
+
/**
* Test that function works.
*
*/
extern void test__f_capability_supported_ambient__works(void **state);
-// f_capability_supported_ambient() doesn't return failure.
-
#endif // _TEST__F_capability__supported_ambient
void test__f_capability_supported_code__works(void **state) {
- f_capability_value_t value = f_capability_value_t_initialize;
+ const f_capability_value_t value = f_capability_value_t_initialize;
#if defined(_di_libcap_)
{
#ifndef _TEST__F_capability__supported_code
#define _TEST__F_capability__supported_code
+// f_capability_supported_code() doesn't return failure.
+
+// f_capability_supported_code() doesn't use parameter checking.
+
/**
* Test that function works.
*
*/
extern void test__f_capability_supported_code__works(void **state);
-// f_capability_supported_code() doesn't return failure.
-
#endif // _TEST__F_capability__supported_code
extern "C" {
#endif
-void test__f_capability_to_name__works(void **state) {
-
- int code = CAP_CHOWN;
- char string[] = "CAP_CHOWN";
- f_string_dynamic_t name = f_string_dynamic_t_initialize;
-
- #if defined(_di_libcap_)
- printf("[ WARN ] f_capability_to_name() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_to_name, false);
- will_return(__wrap_cap_to_name, string);
- will_return(__wrap_cap_free, false);
- #endif // defined(_di_libcap_)
-
- {
- const f_status_t status = f_capability_to_name(code, &name);
-
- #if defined(_di_libcap_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_string_equal(name.string, string);
- assert_int_equal(name.used, 9);
- #endif // defined(_di_libcap_)
- }
-
- f_string_dynamic_resize(0, &name);
-}
-
void test__f_capability_to_name__fails(void **state) {
#if !defined(_di_libcap_)
- int code = CAP_CHOWN;
+ const int code = CAP_CHOWN;
f_string_dynamic_t name = f_string_dynamic_t_initialize;
int errnos[] = {
#endif // !defined(_di_libcap_)
}
+#ifndef _di_level_0_parameter_checking_
+ void test__f_capability_to_name__parameter_checking(void **state) {
+
+ const int code = CAP_CHOWN;
+
+ {
+ const f_status_t status = f_capability_to_name(code, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
+void test__f_capability_to_name__works(void **state) {
+
+ const int code = CAP_CHOWN;
+ char string[] = "CAP_CHOWN";
+ f_string_dynamic_t name = f_string_dynamic_t_initialize;
+
+ #if defined(_di_libcap_)
+ printf("[ WARN ] f_capability_to_name() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_to_name, false);
+ will_return(__wrap_cap_to_name, string);
+ will_return(__wrap_cap_free, false);
+ #endif // defined(_di_libcap_)
+
+ {
+ const f_status_t status = f_capability_to_name(code, &name);
+
+ #if defined(_di_libcap_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_string_equal(name.string, string);
+ assert_int_equal(name.used, 9);
+ #endif // defined(_di_libcap_)
+ }
+
+ f_string_dynamic_resize(0, &name);
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__to_name
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_to_name()
*/
-extern void test__f_capability_to_name__works(void **state);
+extern void test__f_capability_to_name__fails(void **state);
/**
- * Test that function fails.
+ * Test that parameter checking works as expected.
*
* @see f_capability_to_name()
*/
-extern void test__f_capability_to_name__fails(void **state);
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_capability_to_name__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
+/**
+ * Test that function works.
+ *
+ * @see f_capability_to_name()
+ */
+extern void test__f_capability_to_name__works(void **state);
#endif // _TEST__F_capability__to_name
extern "C" {
#endif
-void test__f_capability_to_text__works(void **state) {
-
- f_capability_t capability = f_capability_t_initialize;
- char string[] = "CAP_CHOWN";
- f_string_dynamic_t text = f_string_dynamic_t_initialize;
-
- #if defined(_di_libcap_)
- printf("[ WARN ] f_capability_to_text() is not implemented and cannot be fully tested.\n");
- #else
- will_return(__wrap_cap_to_text, false);
- will_return(__wrap_cap_to_text, 9);
- will_return(__wrap_cap_to_text, string);
- will_return(__wrap_cap_free, false);
- #endif // defined(_di_libcap_)
-
- {
- const f_status_t status = f_capability_to_text(capability, &text);
-
- #if defined(_di_libcap_)
- assert_int_equal(F_status_set_fine(status), F_implemented_not);
- #else
- assert_string_equal(text.string, string);
- assert_int_equal(text.used, 9);
- #endif // defined(_di_libcap_)
- }
-
- f_string_dynamic_resize(0, &text);
-}
-
void test__f_capability_to_text__fails(void **state) {
#if !defined(_di_libcap_)
- f_capability_t capability = f_capability_t_initialize;
+ const f_capability_t capability = f_capability_t_initialize;
f_string_dynamic_t text = f_string_dynamic_t_initialize;
int errnos[] = {
#endif // !defined(_di_libcap_)
}
+#ifndef _di_level_0_parameter_checking_
+ void test__f_capability_to_text__parameter_checking(void **state) {
+
+ const f_capability_t capability = f_capability_t_initialize;
+
+ {
+ const f_status_t status = f_capability_to_text(capability, 0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
+void test__f_capability_to_text__works(void **state) {
+
+ const f_capability_t capability = f_capability_t_initialize;
+ char string[] = "CAP_CHOWN";
+ f_string_dynamic_t text = f_string_dynamic_t_initialize;
+
+ #if defined(_di_libcap_)
+ printf("[ WARN ] f_capability_to_text() is not implemented and cannot be fully tested.\n");
+ #else
+ will_return(__wrap_cap_to_text, false);
+ will_return(__wrap_cap_to_text, 9);
+ will_return(__wrap_cap_to_text, string);
+ will_return(__wrap_cap_free, false);
+ #endif // defined(_di_libcap_)
+
+ {
+ const f_status_t status = f_capability_to_text(capability, &text);
+
+ #if defined(_di_libcap_)
+ assert_int_equal(F_status_set_fine(status), F_implemented_not);
+ #else
+ assert_string_equal(text.string, string);
+ assert_int_equal(text.used, 9);
+ #endif // defined(_di_libcap_)
+ }
+
+ f_string_dynamic_resize(0, &text);
+}
+
#ifdef __cplusplus
} // extern "C"
#endif
#define _TEST__F_capability__to_text
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_to_text()
*/
-extern void test__f_capability_to_text__works(void **state);
+extern void test__f_capability_to_text__fails(void **state);
/**
- * Test that function fails.
+ * Test that parameter checking works as expected.
*
* @see f_capability_to_text()
*/
-extern void test__f_capability_to_text__fails(void **state);
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_capability_to_text__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
+/**
+ * Test that function works.
+ *
+ * @see f_capability_to_text()
+ */
+extern void test__f_capability_to_text__works(void **state);
#endif // _TEST__F_capability__to_text
void test__f_capability_user_set__works(void **state) {
- uid_t uid;
+ const uid_t uid = 0;
#if defined(_di_libcap_) || defined(_libcap_legacy_only_)
printf("[ WARN ] f_capability_user_set() is not implemented and cannot be fully tested.\n");
void test__f_capability_user_set__fails(void **state) {
#if !defined(_di_libcap_) && !defined(_libcap_legacy_only_)
- uid_t uid;
+ const uid_t uid = 0;
int errnos[] = {
EINVAL,
#define _TEST__F_capability__user_set
/**
- * Test that function works.
+ * Test that function fails.
*
* @see f_capability_user_set()
*/
-extern void test__f_capability_user_set__works(void **state);
+extern void test__f_capability_user_set__fails(void **state);
+
+// f_capability_user_set() doesn't use parameter checking.
/**
- * Test that function fails.
+ * Test that function works.
*
* @see f_capability_user_set()
*/
-extern void test__f_capability_user_set__fails(void **state);
+extern void test__f_capability_user_set__works(void **state);
#endif // _TEST__F_capability__user_set
int main(void) {
const struct CMUnitTest tests[] = {
- cmocka_unit_test(test__f_capability_ambient_get__works),
cmocka_unit_test(test__f_capability_ambient_get__fails),
+ cmocka_unit_test(test__f_capability_ambient_get__works),
- cmocka_unit_test(test__f_capability_ambient_reset__works),
cmocka_unit_test(test__f_capability_ambient_reset__fails),
+ cmocka_unit_test(test__f_capability_ambient_reset__works),
- cmocka_unit_test(test__f_capability_ambient_set__works),
cmocka_unit_test(test__f_capability_ambient_set__fails),
+ cmocka_unit_test(test__f_capability_ambient_set__works),
- cmocka_unit_test(test__f_capability_clear__works),
cmocka_unit_test(test__f_capability_clear__fails),
+ cmocka_unit_test(test__f_capability_clear__works),
- cmocka_unit_test(test__f_capability_clear_flag__works),
cmocka_unit_test(test__f_capability_clear_flag__fails),
+ cmocka_unit_test(test__f_capability_clear_flag__works),
- cmocka_unit_test(test__f_capability_compare__works),
cmocka_unit_test(test__f_capability_compare__fails),
+ cmocka_unit_test(test__f_capability_compare__works),
- cmocka_unit_test(test__f_capability_copy__works),
cmocka_unit_test(test__f_capability_copy__fails),
+ cmocka_unit_test(test__f_capability_copy__works),
- cmocka_unit_test(test__f_capability_copy_external__works),
cmocka_unit_test(test__f_capability_copy_external__fails),
+ cmocka_unit_test(test__f_capability_copy_external__works),
- cmocka_unit_test(test__f_capability_copy_internal__works),
cmocka_unit_test(test__f_capability_copy_internal__fails),
+ cmocka_unit_test(test__f_capability_copy_internal__works),
- cmocka_unit_test(test__f_capability_delete__works),
cmocka_unit_test(test__f_capability_delete__fails),
+ cmocka_unit_test(test__f_capability_delete__works),
- cmocka_unit_test(test__f_capability_file_descriptor_get__works),
cmocka_unit_test(test__f_capability_file_descriptor_get__fails),
+ cmocka_unit_test(test__f_capability_file_descriptor_get__works),
- cmocka_unit_test(test__f_capability_file_descriptor_set__works),
cmocka_unit_test(test__f_capability_file_descriptor_set__fails),
+ cmocka_unit_test(test__f_capability_file_descriptor_set__works),
- cmocka_unit_test(test__f_capability_file_get__works),
cmocka_unit_test(test__f_capability_file_get__fails),
+ cmocka_unit_test(test__f_capability_file_get__works),
- cmocka_unit_test(test__f_capability_file_set__works),
cmocka_unit_test(test__f_capability_file_set__fails),
+ cmocka_unit_test(test__f_capability_file_set__works),
- cmocka_unit_test(test__f_capability_flag_get__works),
cmocka_unit_test(test__f_capability_flag_get__fails),
+ cmocka_unit_test(test__f_capability_flag_get__works),
- cmocka_unit_test(test__f_capability_flag_set__works),
cmocka_unit_test(test__f_capability_flag_set__fails),
+ cmocka_unit_test(test__f_capability_flag_set__works),
- cmocka_unit_test(test__f_capability_from_name__works),
cmocka_unit_test(test__f_capability_from_name__fails),
+ cmocka_unit_test(test__f_capability_from_name__works),
- cmocka_unit_test(test__f_capability_from_text__works),
cmocka_unit_test(test__f_capability_from_text__fails),
+ cmocka_unit_test(test__f_capability_from_text__works),
- cmocka_unit_test(test__f_capability_groups_set__works),
cmocka_unit_test(test__f_capability_groups_set__fails),
+ cmocka_unit_test(test__f_capability_groups_set__works),
- cmocka_unit_test(test__f_capability_initialize__works),
cmocka_unit_test(test__f_capability_initialize__fails),
+ cmocka_unit_test(test__f_capability_initialize__works),
- cmocka_unit_test(test__f_capability_mode_get__works),
// cap_get_mode() doesn't return failure.
+ cmocka_unit_test(test__f_capability_mode_get__works),
- cmocka_unit_test(test__f_capability_mode_get_name__works),
// cap_mode_name() doesn't return failure.
+ cmocka_unit_test(test__f_capability_mode_get_name__works),
- cmocka_unit_test(test__f_capability_mode_set__works),
cmocka_unit_test(test__f_capability_mode_set__fails),
+ cmocka_unit_test(test__f_capability_mode_set__works),
- cmocka_unit_test(test__f_capability_owner_get__works),
// cap_get_nsowner() doesn't return failure.
+ cmocka_unit_test(test__f_capability_owner_get__works),
- cmocka_unit_test(test__f_capability_owner_set__works),
cmocka_unit_test(test__f_capability_owner_set__fails),
+ cmocka_unit_test(test__f_capability_owner_set__works),
- cmocka_unit_test(test__f_capability_process_bound_drop__works),
cmocka_unit_test(test__f_capability_process_bound_drop__fails),
+ cmocka_unit_test(test__f_capability_process_bound_drop__works),
- cmocka_unit_test(test__f_capability_process_bound_get__works),
cmocka_unit_test(test__f_capability_process_bound_get__fails),
+ cmocka_unit_test(test__f_capability_process_bound_get__works),
- cmocka_unit_test(test__f_capability_process_get_by_id__works),
cmocka_unit_test(test__f_capability_process_get_by_id__fails),
+ cmocka_unit_test(test__f_capability_process_get_by_id__works),
- cmocka_unit_test(test__f_capability_process_get__works),
cmocka_unit_test(test__f_capability_process_get__fails),
+ cmocka_unit_test(test__f_capability_process_get__works),
- cmocka_unit_test(test__f_capability_process_set__works),
cmocka_unit_test(test__f_capability_process_set__fails),
+ cmocka_unit_test(test__f_capability_process_set__works),
- cmocka_unit_test(test__f_capability_security_bits_get__works),
cmocka_unit_test(test__f_capability_security_bits_get__fails),
+ cmocka_unit_test(test__f_capability_security_bits_get__works),
- cmocka_unit_test(test__f_capability_security_bits_set__works),
cmocka_unit_test(test__f_capability_security_bits_set__fails),
+ cmocka_unit_test(test__f_capability_security_bits_set__works),
- cmocka_unit_test(test__f_capability_size__works),
cmocka_unit_test(test__f_capability_size__fails),
+ cmocka_unit_test(test__f_capability_size__works),
- cmocka_unit_test(test__f_capability_supported__works),
// f_capability_supported() doesn't return failure.
+ cmocka_unit_test(test__f_capability_supported__works),
- cmocka_unit_test(test__f_capability_supported_ambient__works),
// f_capability_supported_ambient() doesn't return failure.
+ cmocka_unit_test(test__f_capability_supported_ambient__works),
- cmocka_unit_test(test__f_capability_supported_code__works),
// f_capability_supported_code() doesn't return failure.
+ cmocka_unit_test(test__f_capability_supported_code__works),
- cmocka_unit_test(test__f_capability_to_name__works),
cmocka_unit_test(test__f_capability_to_name__fails),
+ cmocka_unit_test(test__f_capability_to_name__works),
- cmocka_unit_test(test__f_capability_to_text__works),
cmocka_unit_test(test__f_capability_to_text__fails),
+ cmocka_unit_test(test__f_capability_to_text__works),
- cmocka_unit_test(test__f_capability_user_set__works),
cmocka_unit_test(test__f_capability_user_set__fails),
+ cmocka_unit_test(test__f_capability_user_set__works),
+
+ #ifndef _di_level_0_parameter_checking_
+ cmocka_unit_test(test__f_capability_ambient_get__parameter_checking),
+ // f_capability_ambient_reset() doesn't use parameter checking.
+ // f_capability_ambient_set() doesn't use parameter checking.
+ cmocka_unit_test(test__f_capability_clear__parameter_checking),
+ cmocka_unit_test(test__f_capability_clear_flag__parameter_checking),
+ // f_capability_compare() doesn't use parameter checking.
+ cmocka_unit_test(test__f_capability_copy__parameter_checking),
+ cmocka_unit_test(test__f_capability_copy_external__parameter_checking),
+ cmocka_unit_test(test__f_capability_copy_internal__parameter_checking),
+ cmocka_unit_test(test__f_capability_delete__parameter_checking),
+ cmocka_unit_test(test__f_capability_file_descriptor_get__parameter_checking),
+ // f_capability_file_descriptor_set() doesn't use parameter checking.
+ cmocka_unit_test(test__f_capability_file_get__parameter_checking),
+ // f_capability_file_set() doesn't use parameter checking.
+ cmocka_unit_test(test__f_capability_flag_get__parameter_checking),
+ cmocka_unit_test(test__f_capability_flag_set__parameter_checking),
+ cmocka_unit_test(test__f_capability_from_name__parameter_checking),
+ cmocka_unit_test(test__f_capability_from_text__parameter_checking),
+ // f_capability_groups_set() doesn't use parameter checking.
+ cmocka_unit_test(test__f_capability_initialize__parameter_checking),
+ cmocka_unit_test(test__f_capability_mode_get__parameter_checking),
+ cmocka_unit_test(test__f_capability_mode_get_name__parameter_checking),
+ // f_capability_mode_set() doesn't use parameter checking.
+ cmocka_unit_test(test__f_capability_owner_get__parameter_checking),
+ // f_capability_owner_set() doesn't use parameter checking.
+ cmocka_unit_test(test__f_capability_process_bound_drop__parameter_checking),
+ cmocka_unit_test(test__f_capability_process_bound_get__parameter_checking),
+ cmocka_unit_test(test__f_capability_process_get_by_id__parameter_checking),
+ cmocka_unit_test(test__f_capability_process_get__parameter_checking),
+ // f_capability_process_set() doesn't use parameter checking.
+ cmocka_unit_test(test__f_capability_security_bits_get__parameter_checking),
+ // f_capability_security_bits_set() doesn't use parameter checking.
+ cmocka_unit_test(test__f_capability_size__parameter_checking),
+ // f_capability_supported() doesn't use parameter checking.
+ // f_capability_supported_ambient() doesn't use parameter checking.
+ // f_capability_supported_code() doesn't use parameter checking.
+ cmocka_unit_test(test__f_capability_to_name__parameter_checking),
+ cmocka_unit_test(test__f_capability_to_text__parameter_checking),
+ // f_capability_user_set() doesn't use parameter checking.
+ #endif // _di_level_0_parameter_checking_
};
return cmocka_run_group_tests(tests, setup, setdown);