void stock_data(char *buff) { int i, j, k; i = 0; j = 0; k = 0; while (*(buff + i) != 0) { if (buff[i] == ';') { check_get(j); j++; k = 0; } else { if (j == 0) get_firstname(buff, k, i); if (j == 1) get_lastname(buff, k, i); if (j == 2) get_email(buff, k, i); if (j == 3) get_grade(buff, k, i); if (j == 4) get_city(buff, k, i); k++; } i++; } check_get(4); }
/** * generic acl checking for different methods (basic set of methods supported) * returns null if no err */ static dav_error *check_methods(request_rec *r, const dav_resource *resource, davacl_dir_cfg *conf) { const dav_hooks_repository *repos = REPOS(conf); if (repos == NULL || resource == NULL) return dav_acl_privilege_error(r, "unknown", NULL); switch (r->method_number) { default: if (r->method_number == iM_ACL) { return check_acl(r, resource, conf, repos); } else if (r->method_number == iM_HEAD) { return check_get(r, resource, conf, repos); } else { TRACE(r, "Unknown methdod:%d", r->method_number); return NULL; } break; case M_PUT: return check_put(r, resource, conf, repos); case M_PROPPATCH: return check_proppatch(r, resource, conf, repos); case M_MKCOL: return check_mkcol(r, resource, conf, repos); case M_PROPFIND: /* done with individual properties within dav_get_props() and * dav_get_allprops */ return NULL; case M_DELETE: return check_delete(r, resource, conf, repos); case M_OPTIONS: case M_GET: return check_get(r, resource, conf, repos); case M_COPY: return check_copy(r, resource, conf, repos); case M_MOVE: return check_move(r, resource, conf, repos); case M_LOCK: return check_lock(r, resource, conf, repos); case M_UNLOCK: return check_unlock(r, resource, conf, repos); } }
int main(int argc, char const *argv[]) { print< ::color::rgb< ::color::type::split422_t >::category_type >(); print< ::color::rgb< ::color::type::split242_t >::category_type >(); print< ::color::rgb< ::color::type::split224_t >::category_type >(); print< ::color::bgr< ::color::type::split422_t >::category_type >(); print< ::color::bgr< ::color::type::split242_t >::category_type >(); print< ::color::bgr< ::color::type::split224_t >::category_type >(); print< ::color::abgr< ::color::type::split2AAA_t >::category_type >(); print< ::color::bgra< ::color::type::splitAAA2_t >::category_type >(); print< ::color::rgba< ::color::type::splitAAA2_t >::category_type >(); print< ::color::argb< ::color::type::split2AAA_t >::category_type >(); sandbox_test(); extern void test_constant(); test_constant(); extern void check_sizeof(); check_sizeof(); void test_operation(); test_operation(); void image_conversion(); image_conversion(); test_pallete(); ctor_test(); void main_place(); main_place(); void check_get(); check_get(); extern int gray_test( int argc, char const *argv[] ); gray_test( argc, argv ); extern int decompose_test( int argc, char const *argv[] ); decompose_test( argc, argv ); extern void print_bound(); print_bound(); make_blue(); invoke(); extern void check_conversion(); check_conversion(); void make_test_gray_scale(); make_test_gray_scale(); void test_set_invoke(); test_set_invoke(); void test_get_invoke( double value ); test_get_invoke(0.5); return 0; }
static void test_supported_sizes(TW_IDENTITY *appid, TW_IDENTITY *source, TW_INT32 minimum_support) { TW_UINT16 rc; TW_STATUS status; TW_CAPABILITY cap; TW_UINT32 val; TW_UINT16 type; TW_INT32 actual_support; TW_UINT32 orig_value = TWSS_NONE; TW_UINT32 default_value = TWSS_NONE; TW_UINT32 new_value = TWSS_NONE; memset(&cap, 0, sizeof(cap)); cap.Cap = ICAP_SUPPORTEDSIZES; cap.ConType = TWON_DONTCARE16; rc = pDSM_Entry(appid, source, DG_CONTROL, DAT_CAPABILITY, MSG_QUERYSUPPORT, &cap); get_condition_code(appid, source, &status); ok(rc == TWRC_SUCCESS && status.ConditionCode == TWCC_SUCCESS, "Error [rc %d|cc %d] doing MSG_QUERYSUPPORT for ICAP_SUPPORTEDSIZES\n", rc, status.ConditionCode); if (rc != TWRC_SUCCESS) return; ok(get_onevalue(cap.hContainer, (TW_UINT32 *) &actual_support, NULL), "Returned cap.hContainer invalid for QuerySupport on ICAP_SUPPORTEDSIZES\n"); ok((actual_support & minimum_support) == minimum_support, "Error: minimum support 0x%x for ICAP_SUPPORTEDSIZES, got 0x%x\n", minimum_support, actual_support); if (actual_support & TWQC_GETCURRENT) { memset(&cap, 0, sizeof(cap)); cap.Cap = ICAP_SUPPORTEDSIZES; cap.ConType = TWON_DONTCARE16; rc = pDSM_Entry(appid, source, DG_CONTROL, DAT_CAPABILITY, MSG_GETCURRENT, &cap); get_condition_code(appid, source, &status); ok(rc == TWRC_SUCCESS && status.ConditionCode == TWCC_SUCCESS, "Error [rc %d|cc %d] doing MSG_GETCURRENT for ICAP_SUPPORTEDSIZES\n", rc, status.ConditionCode); if (rc == TWRC_SUCCESS) { get_onevalue(cap.hContainer, &val, &type); ok(type == TWTY_UINT16, "GETCURRENT for ICAP_SUPPORTEDSIZES is not type UINT16, is type %d\n", type); trace("Current size is %d\n", val); GlobalFree(cap.hContainer); orig_value = val; } } if (actual_support & TWQC_GETDEFAULT) { memset(&cap, 0, sizeof(cap)); cap.Cap = ICAP_SUPPORTEDSIZES; cap.ConType = TWON_DONTCARE16; rc = pDSM_Entry(appid, source, DG_CONTROL, DAT_CAPABILITY, MSG_GETDEFAULT, &cap); get_condition_code(appid, source, &status); ok(rc == TWRC_SUCCESS && status.ConditionCode == TWCC_SUCCESS, "Error [rc %d|cc %d] doing MSG_GETDEFAULT for ICAP_SUPPORTEDSIZES\n", rc, status.ConditionCode); if (rc == TWRC_SUCCESS) { get_onevalue(cap.hContainer, &val, &type); ok(type == TWTY_UINT16, "GETDEFAULT for PHYSICALXXX is not type TWTY_UINT16, is type %d\n", type); trace("Default size is %d\n", val); GlobalFree(cap.hContainer); default_value = val; } } if (actual_support & TWQC_GET) { memset(&cap, 0, sizeof(cap)); cap.Cap = ICAP_SUPPORTEDSIZES; cap.ConType = TWON_DONTCARE16; rc = pDSM_Entry(appid, source, DG_CONTROL, DAT_CAPABILITY, MSG_GET, &cap); get_condition_code(appid, source, &status); ok(rc == TWRC_SUCCESS && status.ConditionCode == TWCC_SUCCESS, "Error [rc %d|cc %d] doing MSG_GET for ICAP_SUPPORTEDSIZES\n", rc, status.ConditionCode); check_get(&cap, actual_support, orig_value, default_value, &new_value); } if (actual_support & TWQC_SET) { memset(&cap, 0, sizeof(cap)); cap.Cap = ICAP_SUPPORTEDSIZES; cap.ConType = TWON_ONEVALUE; cap.hContainer = alloc_and_set_onevalue(new_value, TWTY_UINT16); rc = pDSM_Entry(appid, source, DG_CONTROL, DAT_CAPABILITY, MSG_SET, &cap); get_condition_code(appid, source, &status); ok(rc == TWRC_SUCCESS && status.ConditionCode == TWCC_SUCCESS, "Error [rc %d|cc %d] doing MSG_SET for ICAP_SUPPORTEDSIZES\n", rc, status.ConditionCode); GlobalFree(cap.hContainer); } if (actual_support & TWQC_RESET) { memset(&cap, 0, sizeof(cap)); cap.Cap = ICAP_SUPPORTEDSIZES; cap.ConType = TWON_DONTCARE16; rc = pDSM_Entry(appid, source, DG_CONTROL, DAT_CAPABILITY, MSG_RESET, &cap); get_condition_code(appid, source, &status); ok(rc == TWRC_SUCCESS && status.ConditionCode == TWCC_SUCCESS, "Error [rc %d|cc %d] doing MSG_RESET for ICAP_SUPPORTEDSIZES\n", rc, status.ConditionCode); if (rc == TWRC_SUCCESS) GlobalFree(cap.hContainer); } }
static void test_onevalue_cap(TW_IDENTITY *appid, TW_IDENTITY *source, TW_UINT16 captype, TW_UINT16 type, TW_INT32 minimum_support) { TW_UINT16 rc; TW_UINT16 rtype; TW_STATUS status; TW_CAPABILITY cap; TW_UINT32 orig_value = 0; TW_UINT32 new_value; TW_UINT32 default_value = 0; TW_INT32 actual_support; memset(&cap, 0, sizeof(cap)); cap.Cap = captype; cap.ConType = TWON_DONTCARE16; rc = pDSM_Entry(appid, source, DG_CONTROL, DAT_CAPABILITY, MSG_QUERYSUPPORT, &cap); get_condition_code(appid, source, &status); ok(rc == TWRC_SUCCESS && status.ConditionCode == TWCC_SUCCESS, "Error [rc %d|cc %d] doing MSG_QUERYSUPPORT for type 0x%x\n", rc, status.ConditionCode, captype); if (rc != TWRC_SUCCESS) return; ok(get_onevalue(cap.hContainer, (TW_UINT32 *) &actual_support, NULL), "Returned cap.hContainer invalid for QuerySupport on type 0x%x\n", captype); ok((actual_support & minimum_support) == minimum_support, "Error: minimum support 0x%x for type 0x%x, got 0x%x\n", minimum_support, captype, actual_support); if (actual_support & TWQC_GETCURRENT) { memset(&cap, 0, sizeof(cap)); cap.Cap = captype; cap.ConType = TWON_DONTCARE16; rc = pDSM_Entry(appid, source, DG_CONTROL, DAT_CAPABILITY, MSG_GETCURRENT, &cap); get_condition_code(appid, source, &status); ok(rc == TWRC_SUCCESS && status.ConditionCode == TWCC_SUCCESS, "Error [rc %d|cc %d] doing MSG_GETCURRENT for type 0x%x\n", rc, status.ConditionCode, captype); if (rc == TWRC_SUCCESS) { ok(get_onevalue(cap.hContainer, &orig_value, &rtype), "Returned cap.hContainer invalid for GETCURRENT on type 0x%x\n", captype); ok(rtype == type, "Returned GETCURRENT type 0x%x for cap 0x%x is not expected 0x%x\n", rtype, captype, type); GlobalFree(cap.hContainer); } } if (actual_support & TWQC_GETDEFAULT) { memset(&cap, 0, sizeof(cap)); cap.Cap = captype; cap.ConType = TWON_DONTCARE16; rc = pDSM_Entry(appid, source, DG_CONTROL, DAT_CAPABILITY, MSG_GETDEFAULT, &cap); get_condition_code(appid, source, &status); ok(rc == TWRC_SUCCESS && status.ConditionCode == TWCC_SUCCESS, "Error [rc %d|cc %d] doing MSG_GETDEFAULT for type 0x%x\n", rc, status.ConditionCode, captype); if (rc == TWRC_SUCCESS) { ok(get_onevalue(cap.hContainer, &default_value, &rtype), "Returned cap.hContainer invalid for GETDEFAULT on type 0x%x\n", captype); ok(rtype == type, "Returned GETDEFAULT type 0x%x for cap 0x%x is not expected 0x%x\n", rtype, captype, type); GlobalFree(cap.hContainer); } } new_value = orig_value; if (actual_support & TWQC_GET) { memset(&cap, 0, sizeof(cap)); cap.Cap = captype; cap.ConType = TWON_DONTCARE16; rc = pDSM_Entry(appid, source, DG_CONTROL, DAT_CAPABILITY, MSG_GET, &cap); get_condition_code(appid, source, &status); ok(rc == TWRC_SUCCESS && status.ConditionCode == TWCC_SUCCESS, "Error [rc %d|cc %d] doing MSG_GET for type 0x%x\n", rc, status.ConditionCode, captype); check_get(&cap, actual_support, orig_value, default_value, &new_value); if (rc == TWRC_SUCCESS) GlobalFree(cap.hContainer); } if (actual_support & TWQC_SET) { memset(&cap, 0, sizeof(cap)); cap.Cap = captype; cap.ConType = TWON_ONEVALUE; cap.hContainer = alloc_and_set_onevalue(new_value, type); rc = pDSM_Entry(appid, source, DG_CONTROL, DAT_CAPABILITY, MSG_SET, &cap); get_condition_code(appid, source, &status); ok(rc == TWRC_SUCCESS && status.ConditionCode == TWCC_SUCCESS, "Error [rc %d|cc %d] doing MSG_SET for type 0x%x\n", rc, status.ConditionCode, captype); GlobalFree(cap.hContainer); } if (actual_support & TWQC_RESET) { memset(&cap, 0, sizeof(cap)); cap.Cap = captype; cap.ConType = TWON_DONTCARE16; rc = pDSM_Entry(appid, source, DG_CONTROL, DAT_CAPABILITY, MSG_RESET, &cap); get_condition_code(appid, source, &status); ok(rc == TWRC_SUCCESS && status.ConditionCode == TWCC_SUCCESS, "Error [rc %d|cc %d] doing MSG_RESET for type 0x%x\n", rc, status.ConditionCode, captype); if (rc == TWRC_SUCCESS) GlobalFree(cap.hContainer); } }
TEST(tagged_tuple, get) { check_get(); check_get<Y>("hello"); check_get<Z, X>('=', "world"); check_get<X, Y, Z>(5.6, 10, true); }