Navigation


Changeset 676:684f9e0e0c96 in freeDiameter for tests/testloadext.c


Ignore:
Timestamp:
Jan 18, 2011, 10:11:52 AM (13 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Clean termination of tests when possible

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/testloadext.c

    r669 r676  
    6060       
    6161        /* Find all extensions which have been compiled along the test */
    62         if (test_verbo > 0) {
    63                 printf("Loading from: '%s'\n", BUILD_DIR "/extensions");
    64         }
     62        TRACE_DEBUG(INFO, "Loading from: '%s'\n", BUILD_DIR "/extensions");
    6563        CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 );
    6664        pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
     65       
    6766        while ((dp = readdir (dir)) != NULL) {
    6867                char * dot = strrchr(dp->d_name, '.');
     
    7372                        snprintf(fullname + pathlen, sizeof(fullname) - pathlen, "%s", dp->d_name);
    7473                       
    75                         if (test_verbo > 0) {
    76                                 printf("Extension: '%s'\n", dp->d_name);
    77                         }
     74                        TRACE_DEBUG(INFO, "Extension: '%s'\n", dp->d_name);
    7875                       
    7976                        /* load */
    8077                        hdl = dlopen(fullname, RTLD_NOW | RTLD_GLOBAL);
    8178                        if (!hdl) {
    82                                 printf("Unable to load '%s': %s.\n", fullname, dlerror());
     79                                TRACE_DEBUG(INFO, "Unable to load '%s': %s.\n", fullname, dlerror());
    8380                        }
    8481                        CHECK( 0, hdl == NULL ? 1 : 0 );
     
    8784                        ep = dlsym( hdl, "fd_ext_init" );
    8885                        if (!ep) {
    89                                 printf("No 'fd_ext_init' entry point in '%s': %s.\n", fullname, dlerror());
     86                                TRACE_DEBUG(INFO, "No 'fd_ext_init' entry point in '%s': %s.\n", fullname, dlerror());
    9087                        }
    9188                        CHECK( 0, ep == NULL ? 1 : 0 );
     
    9491                        r = dlclose(hdl);
    9592                        if (r) {
    96                                 printf("Unable to dlclose '%s': %s.\n", fullname, dlerror());
     93                                TRACE_DEBUG(INFO, "Unable to dlclose '%s': %s.\n", fullname, dlerror());
    9794                        }
    9895                        CHECK( 0, r );
Note: See TracChangeset for help on using the changeset viewer.