Fix a few glitches in the new version of put. Updated unit test to comply with changes.
This commit was SVN r2229.
Этот коммит содержится в:
родитель
56a3fd8f36
Коммит
8fd9c65362
@ -38,7 +38,7 @@ int gpr_replica_define_segment(char *segment)
|
|||||||
int response;
|
int response;
|
||||||
|
|
||||||
response = gpr_replica_define_key(segment, NULL);
|
response = gpr_replica_define_key(segment, NULL);
|
||||||
if (0 > response) { /* got some kind of error code */
|
if (0 > response && OMPI_EXISTS != response) { /* got some kind of error code */
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,7 +74,6 @@ mca_gpr_registry_segment_t *gpr_replica_find_seg(char *segment)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NULL; /* segment in dictionary, but can't locate it */
|
|
||||||
}
|
}
|
||||||
/* didn't find the dictionary entry */
|
/* didn't find the dictionary entry */
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -352,13 +351,11 @@ bool gpr_replica_check_key_list(ompi_registry_mode_t mode, ompi_list_t *key_list
|
|||||||
/* take care of trivial cases that don't require search */
|
/* take care of trivial cases that don't require search */
|
||||||
if ((OMPI_REGISTRY_XAND & mode) &&
|
if ((OMPI_REGISTRY_XAND & mode) &&
|
||||||
(num_keys_search != num_keys_entry)) { /* can't possibly turn out "true" */
|
(num_keys_search != num_keys_entry)) { /* can't possibly turn out "true" */
|
||||||
ompi_output(mca_gpr_base_output, "xand violation");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((OMPI_REGISTRY_AND & mode) &&
|
if ((OMPI_REGISTRY_AND & mode) &&
|
||||||
(num_keys_search > num_keys_entry)) { /* can't find enough matches */
|
(num_keys_search > num_keys_entry)) { /* can't find enough matches */
|
||||||
ompi_output(mca_gpr_base_output, "and violation");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -419,7 +416,7 @@ ompi_list_t *gpr_replica_test_internals(int level)
|
|||||||
ompi_registry_internal_test_results_t *result;
|
ompi_registry_internal_test_results_t *result;
|
||||||
char name[30], name2[30];
|
char name[30], name2[30];
|
||||||
char *name3[30];
|
char *name3[30];
|
||||||
int i, j;
|
int i, j, k;
|
||||||
mca_gpr_replica_key_t segkey, key;
|
mca_gpr_replica_key_t segkey, key;
|
||||||
mca_gpr_registry_segment_t *seg;
|
mca_gpr_registry_segment_t *seg;
|
||||||
mca_gpr_keytable_t *dict_entry;
|
mca_gpr_keytable_t *dict_entry;
|
||||||
@ -431,7 +428,7 @@ ompi_list_t *gpr_replica_test_internals(int level)
|
|||||||
success = true;
|
success = true;
|
||||||
result = OBJ_NEW(ompi_registry_internal_test_results_t);
|
result = OBJ_NEW(ompi_registry_internal_test_results_t);
|
||||||
result->test = strdup("test-create-segment");
|
result->test = strdup("test-create-segment");
|
||||||
for (i=0; i<5; i++) {
|
for (i=0; i<5 && success; i++) {
|
||||||
sprintf(name, "test-def-seg%d", i);
|
sprintf(name, "test-def-seg%d", i);
|
||||||
if (OMPI_SUCCESS != gpr_replica_define_segment(name)) {
|
if (OMPI_SUCCESS != gpr_replica_define_segment(name)) {
|
||||||
success = false;
|
success = false;
|
||||||
@ -448,10 +445,10 @@ ompi_list_t *gpr_replica_test_internals(int level)
|
|||||||
success = true;
|
success = true;
|
||||||
result = OBJ_NEW(ompi_registry_internal_test_results_t);
|
result = OBJ_NEW(ompi_registry_internal_test_results_t);
|
||||||
result->test = strdup("test-define-key-uniqueness");
|
result->test = strdup("test-define-key-uniqueness");
|
||||||
for (i=0; i<5; i++) {
|
for (i=0; i<5 && success; i++) {
|
||||||
sprintf(name, "test-def-seg%d", i);
|
sprintf(name, "test-def-seg%d", i);
|
||||||
key = gpr_replica_define_key(name, NULL);
|
key = gpr_replica_define_key(name, NULL);
|
||||||
if (MCA_GPR_REPLICA_KEY_MAX != key) { /* got an error */
|
if (OMPI_EXISTS != key) { /* got an error */
|
||||||
success = false;
|
success = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -466,7 +463,7 @@ ompi_list_t *gpr_replica_test_internals(int level)
|
|||||||
success = true;
|
success = true;
|
||||||
result = OBJ_NEW(ompi_registry_internal_test_results_t);
|
result = OBJ_NEW(ompi_registry_internal_test_results_t);
|
||||||
result->test = strdup("test-get-seg-key");
|
result->test = strdup("test-get-seg-key");
|
||||||
for (i=0; i<5; i++) {
|
for (i=0; i<5 && success; i++) {
|
||||||
sprintf(name, "test-def-seg%d", i);
|
sprintf(name, "test-def-seg%d", i);
|
||||||
key = gpr_replica_get_key(name, NULL);
|
key = gpr_replica_get_key(name, NULL);
|
||||||
if (MCA_GPR_REPLICA_KEY_MAX == key) { /* got an error */
|
if (MCA_GPR_REPLICA_KEY_MAX == key) { /* got an error */
|
||||||
@ -506,8 +503,8 @@ ompi_list_t *gpr_replica_test_internals(int level)
|
|||||||
sprintf(name, "test-def-seg%d", i);
|
sprintf(name, "test-def-seg%d", i);
|
||||||
for (j=0; j<10 && success; j++) {
|
for (j=0; j<10 && success; j++) {
|
||||||
sprintf(name2, "test-key%d", j);
|
sprintf(name2, "test-key%d", j);
|
||||||
key = gpr_replica_define_key(name, name2);
|
k = gpr_replica_define_key(name, name2);
|
||||||
if (MCA_GPR_REPLICA_KEY_MAX == key) { /* got an error */
|
if (0 > k) { /* got an error */
|
||||||
success = false;
|
success = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -91,18 +91,6 @@ int main(int argc, char **argv)
|
|||||||
test_success();
|
test_success();
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr, "testing define segment\n");
|
|
||||||
/* try to define a segment */
|
|
||||||
if (OMPI_SUCCESS != (response = ompi_registry.define_segment("test-segment"))) {
|
|
||||||
fprintf(test_out, "GPR replica: could not define segment - error code %d\n", response);
|
|
||||||
test_failure("test_gpr_replica define_segment failed");
|
|
||||||
test_finalize();
|
|
||||||
exit(1);
|
|
||||||
} else {
|
|
||||||
fprintf(test_out, "GPR test segment defined\n");
|
|
||||||
test_success();
|
|
||||||
}
|
|
||||||
|
|
||||||
fprintf(stderr, "testing get index\n");
|
fprintf(stderr, "testing get index\n");
|
||||||
/* check index */
|
/* check index */
|
||||||
test_list = ompi_registry.index(NULL);
|
test_list = ompi_registry.index(NULL);
|
||||||
@ -184,6 +172,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* test the put overwrite function */
|
/* test the put overwrite function */
|
||||||
|
success = true;
|
||||||
for (i=0; i<5 && success; i++) {
|
for (i=0; i<5 && success; i++) {
|
||||||
sprintf(name, "test-def-seg%d", i);
|
sprintf(name, "test-def-seg%d", i);
|
||||||
if (10 % i) {
|
if (10 % i) {
|
||||||
@ -213,6 +202,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
fprintf(stderr, "testing get\n");
|
fprintf(stderr, "testing get\n");
|
||||||
/* test the get function */
|
/* test the get function */
|
||||||
|
success = true;
|
||||||
for (i=0; i<5 && success; i++) {
|
for (i=0; i<5 && success; i++) {
|
||||||
sprintf(name, "test-def-seg%d", i);
|
sprintf(name, "test-def-seg%d", i);
|
||||||
if (10 % i) {
|
if (10 % i) {
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user