1
1

* bunch of header file and constant changes to make test tree run

"make check" after the opal/orte/ompi constants renames

This commit was SVN r6951.
Этот коммит содержится в:
Brian Barrett 2005-08-21 19:21:09 +00:00
родитель ecf3921ace
Коммит eeeaa7f162
7 изменённых файлов: 74 добавлений и 68 удалений

Просмотреть файл

@ -3,10 +3,12 @@
*/
#include "ompi_config.h"
#include <stdio.h>
#include "support.h"
#include "class/ompi_bitmap.h"
#include "include/constants.h"
#include "ompi/class/ompi_bitmap.h"
#include "ompi/include/constants.h"
#define BSIZE 26
#define SIZE_OF_CHAR (sizeof(char) * 8)

Просмотреть файл

@ -1,11 +1,13 @@
#include "ompi_config.h"
#include <stdio.h>
#include <time.h>
#include "support.h"
#include "include/constants.h"
#include "opal/include/constants.h"
#include "opal/threads/threads.h"
#include "opal/threads/condition.h"
#include "include/sys/atomic.h"
#include "opal/include/sys/atomic.h"
#if !OMPI_HAVE_THREAD_SUPPORT
@ -87,17 +89,17 @@ int main(int argc, char** argv)
thr2->t_run = thr2_run;
rc = opal_thread_start(thr1);
test_verify_int(OMPI_SUCCESS, rc);
test_verify_int(OPAL_SUCCESS, rc);
rc = opal_thread_start(thr2);
test_verify_int(OMPI_SUCCESS, rc);
test_verify_int(OPAL_SUCCESS, rc);
rc = opal_thread_join(thr1, NULL);
test_verify_int(OMPI_SUCCESS, rc);
test_verify_int(OPAL_SUCCESS, rc);
test_verify_int(TEST_COUNT, thr1_count);
rc = opal_thread_join(thr2, NULL);
test_verify_int(OMPI_SUCCESS, rc);
test_verify_int(OPAL_SUCCESS, rc);
test_verify_int(TEST_COUNT, thr2_count);
return test_finalize();

Просмотреть файл

@ -1,8 +1,9 @@
#include "ompi_config.h"
#include "support.h"
#include "include/constants.h"
#include "opal/include/constants.h"
#include "opal/threads/threads.h"
#include "include/sys/atomic.h"
#include "opal/include/sys/atomic.h"
#if !OMPI_HAVE_THREAD_SUPPORT
@ -50,16 +51,16 @@ int main(int argc, char** argv)
thr2.t_run = thr2_run;
rc = opal_thread_start(&thr1);
test_verify_int(OMPI_SUCCESS, rc);
test_verify_int(OPAL_SUCCESS, rc);
rc = opal_thread_start(&thr2);
test_verify_int(OMPI_SUCCESS, rc);
test_verify_int(OPAL_SUCCESS, rc);
rc = opal_thread_join(&thr1, NULL);
test_verify_int(OMPI_SUCCESS, rc);
test_verify_int(OPAL_SUCCESS, rc);
rc = opal_thread_join(&thr2, NULL);
test_verify_int(OMPI_SUCCESS, rc);
test_verify_int(OPAL_SUCCESS, rc);
test_verify_int(3, count);
return test_finalize();

Просмотреть файл

@ -20,7 +20,7 @@
#include <stdlib.h>
#include "support.h"
#include "include/constants.h"
#include "opal/include/constants.h"
#include "opal/util/argv.h"
static bool test1(void);
@ -100,7 +100,7 @@ static bool test1(void)
value. */
for (i = 0; a[i] != NULL; ++i) {
if (opal_argv_append(&argc, &argv, a[i]) != OMPI_SUCCESS) {
if (opal_argv_append(&argc, &argv, a[i]) != OPAL_SUCCESS) {
return false;
}
for (j = 0; j <= i; ++j) {
@ -142,7 +142,7 @@ static bool test2(void)
b[i] = NULL;
for (i = 0; b[i] != NULL; ++i) {
if (opal_argv_append(&argc, &argv, b[i]) != OMPI_SUCCESS) {
if (opal_argv_append(&argc, &argv, b[i]) != OPAL_SUCCESS) {
return false;
}
++b[i][0];
@ -186,7 +186,7 @@ static bool test3(void)
tries to free it, we should get a seg fault. */
for (i = 0; a[i] != NULL; ++i) {
if (opal_argv_append(&argc, &argv, a[i]) != OMPI_SUCCESS) {
if (opal_argv_append(&argc, &argv, a[i]) != OPAL_SUCCESS) {
return false;
}
}
@ -202,7 +202,7 @@ static bool test3(void)
}
b[i] = NULL;
for (i = 0; b[i] != NULL; ++i) {
if (opal_argv_append(&argc, &argv, b[i]) != OMPI_SUCCESS) {
if (opal_argv_append(&argc, &argv, b[i]) != OPAL_SUCCESS) {
return false;
}
}
@ -365,14 +365,14 @@ static bool test9(void)
/* bozo cases */
if (OMPI_SUCCESS != opal_argv_delete(NULL, NULL, 0, 0)) {
if (OPAL_SUCCESS != opal_argv_delete(NULL, NULL, 0, 0)) {
return false;
}
a = NULL;
argc = 0;
opal_argv_append(&argc, &a, "foo");
if (OMPI_SUCCESS != opal_argv_delete(&argc, &a, 7, 1) ||
if (OPAL_SUCCESS != opal_argv_delete(&argc, &a, 7, 1) ||
1 != opal_argv_count(a)) {
return false;
}
@ -381,7 +381,7 @@ static bool test9(void)
a = NULL;
argc = 0;
opal_argv_append(&argc, &a, "foo");
if (OMPI_SUCCESS != opal_argv_delete(&argc, &a, 0, 0) ||
if (OPAL_SUCCESS != opal_argv_delete(&argc, &a, 0, 0) ||
1 != opal_argv_count(a)) {
return false;
}
@ -398,7 +398,7 @@ static bool test9(void)
opal_argv_append(&argc, &a, "d");
opal_argv_append(&argc, &a, "e");
opal_argv_append(&argc, &a, "f");
if (OMPI_SUCCESS != opal_argv_delete(&argc, &a, 0, 1) ||
if (OPAL_SUCCESS != opal_argv_delete(&argc, &a, 0, 1) ||
5 != opal_argv_count(a) ||
0 != strcmp(a[0], "b") ||
0 != strcmp(a[1], "c") ||
@ -419,7 +419,7 @@ static bool test9(void)
opal_argv_append(&argc, &a, "d");
opal_argv_append(&argc, &a, "e");
opal_argv_append(&argc, &a, "f");
if (OMPI_SUCCESS != opal_argv_delete(&argc, &a, 0, 2) ||
if (OPAL_SUCCESS != opal_argv_delete(&argc, &a, 0, 2) ||
4 != opal_argv_count(a) ||
0 != strcmp(a[0], "c") ||
0 != strcmp(a[1], "d") ||
@ -439,7 +439,7 @@ static bool test9(void)
opal_argv_append(&argc, &a, "d");
opal_argv_append(&argc, &a, "e");
opal_argv_append(&argc, &a, "f");
if (OMPI_SUCCESS != opal_argv_delete(&argc, &a, 1, 1) ||
if (OPAL_SUCCESS != opal_argv_delete(&argc, &a, 1, 1) ||
5 != opal_argv_count(a) ||
0 != strcmp(a[0], "a") ||
0 != strcmp(a[1], "c") ||
@ -460,7 +460,7 @@ static bool test9(void)
opal_argv_append(&argc, &a, "d");
opal_argv_append(&argc, &a, "e");
opal_argv_append(&argc, &a, "f");
if (OMPI_SUCCESS != opal_argv_delete(&argc, &a, 1, 2) ||
if (OPAL_SUCCESS != opal_argv_delete(&argc, &a, 1, 2) ||
4 != opal_argv_count(a) ||
0 != strcmp(a[0], "a") ||
0 != strcmp(a[1], "d") ||
@ -476,7 +476,7 @@ static bool test9(void)
argc = 0;
opal_argv_append(&argc, &a, "a");
opal_argv_append(&argc, &a, "b");
if (OMPI_SUCCESS != opal_argv_delete(&argc, &a, 0, 99) ||
if (OPAL_SUCCESS != opal_argv_delete(&argc, &a, 0, 99) ||
0 != opal_argv_count(a)) {
return false;
}
@ -488,7 +488,7 @@ static bool test9(void)
argc = 0;
opal_argv_append(&argc, &a, "a");
opal_argv_append(&argc, &a, "b");
if (OMPI_SUCCESS != opal_argv_delete(&argc, &a, 1, 99) ||
if (OPAL_SUCCESS != opal_argv_delete(&argc, &a, 1, 99) ||
1 != opal_argv_count(a) ||
0 != strcmp(a[0], "a")) {
return false;
@ -514,14 +514,14 @@ static bool test10(void)
insert = NULL;
i = 0;
opal_argv_append(&i, &insert, "insert a");
if (OMPI_SUCCESS == opal_argv_insert(NULL, 0, insert)) {
if (OPAL_SUCCESS == opal_argv_insert(NULL, 0, insert)) {
return false;
}
opal_argv_append(&o, &orig, "orig a");
if (OMPI_SUCCESS != opal_argv_insert(&orig, 0, NULL)) {
if (OPAL_SUCCESS != opal_argv_insert(&orig, 0, NULL)) {
return false;
}
if (OMPI_SUCCESS == opal_argv_insert(&orig, -1, insert)) {
if (OPAL_SUCCESS == opal_argv_insert(&orig, -1, insert)) {
return false;
}
opal_argv_free(orig);
@ -539,7 +539,7 @@ static bool test10(void)
opal_argv_append(&o, &orig, "orig a");
opal_argv_append(&o, &orig, "orig b");
opal_argv_append(&o, &orig, "orig c");
if (OMPI_SUCCESS != opal_argv_insert(&orig, 99, insert) ||
if (OPAL_SUCCESS != opal_argv_insert(&orig, 99, insert) ||
6 != opal_argv_count(orig) ||
0 != strcmp(orig[0], "orig a") ||
0 != strcmp(orig[1], "orig b") ||
@ -564,7 +564,7 @@ static bool test10(void)
opal_argv_append(&o, &orig, "orig a");
opal_argv_append(&o, &orig, "orig b");
opal_argv_append(&o, &orig, "orig c");
if (OMPI_SUCCESS != opal_argv_insert(&orig, 0, insert) ||
if (OPAL_SUCCESS != opal_argv_insert(&orig, 0, insert) ||
6 != opal_argv_count(orig) ||
0 != strcmp(orig[3], "orig a") ||
0 != strcmp(orig[4], "orig b") ||
@ -589,7 +589,7 @@ static bool test10(void)
opal_argv_append(&o, &orig, "orig a");
opal_argv_append(&o, &orig, "orig b");
opal_argv_append(&o, &orig, "orig c");
if (OMPI_SUCCESS != opal_argv_insert(&orig, 1, insert) ||
if (OPAL_SUCCESS != opal_argv_insert(&orig, 1, insert) ||
6 != opal_argv_count(orig) ||
0 != strcmp(orig[0], "orig a") ||
0 != strcmp(orig[4], "orig b") ||
@ -617,7 +617,7 @@ static bool test10(void)
opal_argv_append(&o, &orig, "orig d");
opal_argv_append(&o, &orig, "orig e");
opal_argv_append(&o, &orig, "orig f");
if (OMPI_SUCCESS != opal_argv_insert(&orig, 1, insert) ||
if (OPAL_SUCCESS != opal_argv_insert(&orig, 1, insert) ||
9 != opal_argv_count(orig) ||
0 != strcmp(orig[0], "orig a") ||
0 != strcmp(orig[4], "orig b") ||

Просмотреть файл

@ -32,11 +32,10 @@
#include <netdb.h>
#endif
#include "runtime/runtime.h"
#include "support.h"
#include "opal/runtime/opal.h"
#include "opal/util/if.h"
#include "support.h"
#include "include/constants.h"
#include "opal/include/constants.h"
static bool
@ -48,7 +47,7 @@ test_ifaddrtoname(char *addr)
ret = opal_ifaddrtoname(addr, addrname, len);
if (ret == OMPI_SUCCESS) {
if (ret == OPAL_SUCCESS) {
return true;
} else {
return false;

Просмотреть файл

@ -15,6 +15,7 @@
*/
#include "orte_config.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@ -26,11 +27,11 @@
#endif
#include <sys/stat.h>
#include "include/constants.h"
#include "util/sys_info.h"
#include "support.h"
#include "opal/include/constants.h"
#include "opal/util/sys_info.h"
#include "opal/util/os_path.h"
#include "opal/util/os_create_dirpath.h"
#include "support.h"
static bool test1(void); /* trivial test */
static bool test2(void); /* test existing path, both with and without correct mode */
@ -75,9 +76,9 @@ int main(int argc, char* argv[])
static bool test1(void)
{
/* Test trivial functionality. Program should return OMPI_ERROR when called with NULL path. */
/* Test trivial functionality. Program should return OPAL_ERROR when called with NULL path. */
if (OMPI_ERROR != opal_os_create_dirpath(NULL, S_IRWXU))
if (OPAL_ERROR != opal_os_create_dirpath(NULL, S_IRWXU))
return(false);
return true;
@ -99,14 +100,14 @@ static bool test2(void)
return(false);
}
if (OMPI_ERROR == opal_os_create_dirpath(tmp, S_IRWXU)) {
if (OPAL_ERROR == opal_os_create_dirpath(tmp, S_IRWXU)) {
rmdir(tmp);
return(false);
}
chmod(tmp, S_IRUSR);
if (OMPI_ERROR == opal_os_create_dirpath(tmp, S_IRWXU)) {
if (OPAL_ERROR == opal_os_create_dirpath(tmp, S_IRWXU)) {
rmdir(tmp);
return(false);
}
@ -134,7 +135,7 @@ static bool test3(void)
}
out = opal_os_path(true, a[0], a[1], a[2], NULL);
if (OMPI_ERROR == opal_os_create_dirpath(out, S_IRWXU)) {
if (OPAL_ERROR == opal_os_create_dirpath(out, S_IRWXU)) {
out = opal_os_path(true, a[0], a[1], a[2], NULL);
if (0 == stat(out, &buf))
rmdir(out);

Просмотреть файл

@ -15,6 +15,7 @@
*/
#include "orte_config.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@ -29,20 +30,20 @@
#endif
#include <sys/stat.h>
#include "include/orte_constants.h"
#include "mca/ns/ns_types.h"
#include "util/proc_info.h"
#include "util/sys_info.h"
#include "support.h"
#include "orte/include/orte_constants.h"
#include "orte/mca/ns/ns_types.h"
#include "orte/util/proc_info.h"
#include "opal/util/sys_info.h"
#include "opal/util/os_path.h"
#include "opal/util/os_create_dirpath.h"
#include "util/session_dir.h"
#include "util/proc_info.h"
#include "runtime/runtime.h"
#include "support.h"
#include "orte/util/session_dir.h"
#include "orte/util/proc_info.h"
#include "orte/runtime/runtime.h"
static bool test1(void); /* given prefix, both one that works and one that fails */
static bool test2(void); /* no prefix given, OMPI_PREFIX_ENV set, one good and one bad */
static bool test2(void); /* no prefix given, ORTE_PREFIX_ENV set, one good and one bad */
static bool test3(void); /* no prefix given, TMPDIR set, one good and one bad */
static bool test4(void); /* no prefix given, TMP set, one good and one bad */
static bool test5(void); /* no prefix given, HOME set, one good and one bad */
@ -160,14 +161,14 @@ static bool test1(void)
clear_proc_info();
prefix = opal_os_path(false, "tmp", NULL);
if (OMPI_ERROR == orte_session_dir(true, prefix, orte_system_info.user, NULL, NULL, "test-universe", NULL, NULL)) {
if (ORTE_ERROR == orte_session_dir(true, prefix, orte_system_info.user, NULL, NULL, "test-universe", NULL, NULL)) {
fprintf(test_out, "test1 - couldn't create specified path\n");
free(prefix);
return(false);
}
/* see if it can access an existing path */
if (OMPI_ERROR == orte_session_dir(false, prefix, orte_system_info.user, NULL, NULL, "test-universe", NULL, NULL)) {
if (ORTE_ERROR == orte_session_dir(false, prefix, orte_system_info.user, NULL, NULL, "test-universe", NULL, NULL)) {
fprintf(test_out, "test1 - couldn't access existing path\n");
free(prefix);
return(false);
@ -185,11 +186,11 @@ static bool test2(void)
{
clear_proc_info();
/* use the OMPI_PREFIX_ENV variable */
/* use the ORTE_PREFIX_ENV variable */
setenv("OMPI_PREFIX_ENV", "/tmp/trythis", 1);
if (OMPI_ERROR == orte_session_dir(true, NULL, orte_system_info.user, NULL, NULL, "test-universe", NULL, NULL)) {
if (ORTE_ERROR == orte_session_dir(true, NULL, orte_system_info.user, NULL, NULL, "test-universe", NULL, NULL)) {
unsetenv("OMPI_PREFIX_ENV");
return(false);
}
@ -210,7 +211,7 @@ static bool test3(void)
setenv("TMPDIR", "/tmp/trythis", 1);
if (OMPI_ERROR == orte_session_dir(true, NULL, orte_system_info.user, NULL, NULL, "test-universe", NULL, NULL)) {
if (ORTE_ERROR == orte_session_dir(true, NULL, orte_system_info.user, NULL, NULL, "test-universe", NULL, NULL)) {
unsetenv("TMPDIR");
return(false);
}
@ -231,7 +232,7 @@ static bool test4(void)
setenv("TMP", "/tmp/trythis", 1);
if (OMPI_ERROR == orte_session_dir(true, NULL, orte_system_info.user, NULL, NULL, "test-universe", NULL, NULL)) {
if (ORTE_ERROR == orte_session_dir(true, NULL, orte_system_info.user, NULL, NULL, "test-universe", NULL, NULL)) {
unsetenv("TMP");
return(false);
}
@ -252,7 +253,7 @@ static bool test5(void)
setenv("HOME", "/tmp/trythis", 1);
if (OMPI_ERROR == orte_session_dir(true, NULL, orte_system_info.user, NULL, NULL, "test-universe", NULL, NULL)) {
if (ORTE_ERROR == orte_session_dir(true, NULL, orte_system_info.user, NULL, NULL, "test-universe", NULL, NULL)) {
unsetenv("HOME");
return(false);
}
@ -274,7 +275,7 @@ static bool test6(void)
* Program should turn to default of /tmp (where "/" is whatever
* top-level directory is appropriate for given system)
*/
if (OMPI_ERROR == orte_session_dir(true, NULL, orte_system_info.user, NULL, NULL, "test-universe", NULL, NULL)) {
if (ORTE_ERROR == orte_session_dir(true, NULL, orte_system_info.user, NULL, NULL, "test-universe", NULL, NULL)) {
return(false);
}
@ -292,7 +293,7 @@ static bool test7(void)
clear_proc_info();
/* create test proc session directory tree */
if (OMPI_ERROR == orte_session_dir(true, NULL, orte_system_info.user, "localhost", NULL, "test-universe", "test-job", "test-proc")) {
if (ORTE_ERROR == orte_session_dir(true, NULL, orte_system_info.user, "localhost", NULL, "test-universe", "test-job", "test-proc")) {
return(false);
}
@ -318,7 +319,7 @@ static bool test7(void)
fprintf(fp, "ss");
fclose(fp);
if (OMPI_ERROR == orte_session_dir_finalize(orte_process_info.my_name)) {
if (ORTE_ERROR == orte_session_dir_finalize(orte_process_info.my_name)) {
return(false);
}
@ -337,7 +338,7 @@ static bool test8(void)
clear_proc_info();
/* create test proc session directory tree */
if (OMPI_ERROR == orte_session_dir(true, NULL, orte_system_info.user, "localhost", NULL, "test-universe2", "test-job2", "test-proc2")) {
if (ORTE_ERROR == orte_session_dir(true, NULL, orte_system_info.user, "localhost", NULL, "test-universe2", "test-job2", "test-proc2")) {
return(false);
}
@ -364,7 +365,7 @@ static bool test8(void)
fclose(fp);
if (OMPI_ERROR == orte_session_dir_finalize(orte_process_info.my_name)) {
if (ORTE_ERROR == orte_session_dir_finalize(orte_process_info.my_name)) {
return(false);
}