* destination is specified.
* @param tag [i] The tag node to want to acquire the MAXLENGTH attribute
* is specified.
- * @param r [i] To use POOL, the pointer to request_rec is specified.
+ * @param pool [i] To use POOL.
* @return The value of the MAXLENGTH attribute is returned. NULL is
* returned when not is.
*/
* destination is specified.
* @param tag [i] The tag node to want to acquire the CHECKBOX attribute
* is specified.
- * @param r [i] To use POOL, the pointer to request_rec is specified.
+ * @param pool [i] To use POOL.
* @return 1 is returned when it is CHECKED and, additionally, 0 is returned.
*/
int
-qs_is_checked_checkbox_attr(Doc *doc, Node *tag, request_rec *UNUSED(r))
+qs_is_checked_checkbox_attr(Doc *doc, Node *tag, apr_pool_t *UNUSED(pool))
{
Attr *attr;
for (attr = qs_get_attr(doc,tag);
void test_qs_get_istyle_attr_005();
void test_qs_get_istyle_attr_006();
/*===========================================================================*/
-/* qs_get_maxlength_attr() */
+/* qs_get_maxlength_attr() */
/*===========================================================================*/
void test_qs_get_maxlength_attr_001();
void test_qs_get_maxlength_attr_002();
void test_qs_get_maxlength_attr_004();
void test_qs_get_maxlength_attr_005();
void test_qs_get_maxlength_attr_006();
+/*===========================================================================*/
+/* qs_is_checked_checkbox_attr() */
+/*===========================================================================*/
+void test_qs_is_checked_checkbox_attr_001();
+void test_qs_is_checked_checkbox_attr_002();
+void test_qs_is_checked_checkbox_attr_003();
/* pend */
void test_log_rerror(const char *file, int line, int level, apr_status_t status, const request_rec *r, const char *fmt, ...)
CU_add_test(str_util_suite, "qs_get_istyle_attr() 005", test_qs_get_istyle_attr_005);
CU_add_test(str_util_suite, "qs_get_istyle_attr() 006", test_qs_get_istyle_attr_006);
/*=========================================================================*/
- /* qs_get_maxlength_attr() */
+ /* qs_get_maxlength_attr() */
/*=========================================================================*/
CU_add_test(str_util_suite, "qs_get_maxlength_attr() 001", test_qs_get_maxlength_attr_001);
CU_add_test(str_util_suite, "qs_get_maxlength_attr() 002", test_qs_get_maxlength_attr_002);
CU_add_test(str_util_suite, "qs_get_maxlength_attr() 004", test_qs_get_maxlength_attr_004);
CU_add_test(str_util_suite, "qs_get_maxlength_attr() 005", test_qs_get_maxlength_attr_005);
CU_add_test(str_util_suite, "qs_get_maxlength_attr() 006", test_qs_get_maxlength_attr_006);
+ /*=========================================================================*/
+ /* qs_is_checked_checkbox_attr() */
+ /*=========================================================================*/
+ CU_add_test(str_util_suite, "qs_is_checked_checkbox_attr() 001", test_qs_is_checked_checkbox_attr_001);
+ CU_add_test(str_util_suite, "qs_is_checked_checkbox_attr() 002", test_qs_is_checked_checkbox_attr_002);
+ CU_add_test(str_util_suite, "qs_is_checked_checkbox_attr() 003", test_qs_is_checked_checkbox_attr_003);
/* aend */
CU_basic_run_tests();
#undef RESULT_STRING
#undef TEST_STRING
}
+/*===========================================================================*/
+/* qs_is_checked_checkbox_attr() */
+/*===========================================================================*/
+void test_qs_is_checked_checkbox_attr_001()
+{
+#define TEST_STRING "<input checked>"
+ Node *node;
+ int ret;
+ APR_INIT;
+
+ node = qs_parse_string(&doc, TEST_STRING, sizeof(TEST_STRING));
+ ret = qs_is_checked_checkbox_attr(&doc, node->child, p);
+ CU_ASSERT(ret == 1);
+
+ APR_TERM;
+#undef TEST_STRING
+}
+void test_qs_is_checked_checkbox_attr_002()
+{
+#define TEST_STRING "<input checked=''>"
+ Node *node;
+ int ret;
+ APR_INIT;
+
+ node = qs_parse_string(&doc, TEST_STRING, sizeof(TEST_STRING));
+ ret = qs_is_checked_checkbox_attr(&doc, node->child, p);
+ CU_ASSERT(ret == 1);
+
+ APR_TERM;
+#undef TEST_STRING
+}
+void test_qs_is_checked_checkbox_attr_003()
+{
+#define TEST_STRING "<input>"
+ Node *node;
+ int ret;
+ APR_INIT;
+
+ node = qs_parse_string(&doc, TEST_STRING, sizeof(TEST_STRING));
+ ret = qs_is_checked_checkbox_attr(&doc, node->child, p);
+ CU_ASSERT(ret == 0);
+
+ APR_TERM;
+#undef TEST_STRING
+}
/*
* vim:ts=2 et
*/