Changeset 2347 for box/trunk/test


Ignore:
Timestamp:
11/10/2008 22:00:18 (4 years ago)
Author:
chris
Message:

Add missing extern "C" on intercept function definitions in
testbbackupd.

Fix assignment of string constants to non-const char pointers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/test/bbackupd/testbbackupd.cpp

    r2320 r2347  
    758758// We set up the next intercept for the same directory by passing NULL. 
    759759 
    760 struct dirent *readdir_test_hook_2(DIR *dir); 
     760extern "C" struct dirent *readdir_test_hook_2(DIR *dir); 
    761761 
    762762#ifdef LINUX_WEIRD_LSTAT 
    763 int lstat_test_hook(int ver, const char *file_name, struct stat *buf); 
     763extern "C" int lstat_test_hook(int ver, const char *file_name, struct stat *buf); 
    764764#else 
    765 int lstat_test_hook(const char *file_name, struct stat *buf); 
     765extern "C" int lstat_test_hook(const char *file_name, struct stat *buf); 
    766766#endif 
    767767 
    768 struct dirent *readdir_test_hook_1(DIR *dir) 
     768extern "C" struct dirent *readdir_test_hook_1(DIR *dir) 
    769769{ 
    770770#ifndef PLATFORM_CLIB_FNS_INTERCEPTION_IMPOSSIBLE 
     
    777777// new filenames until the timer expires, then disables the intercept. 
    778778 
    779 struct dirent *readdir_test_hook_2(DIR *dir) 
     779extern "C" struct dirent *readdir_test_hook_2(DIR *dir) 
    780780{ 
    781781        if (time(NULL) >= readdir_stop_time) 
     
    813813 
    814814#ifdef LINUX_WEIRD_LSTAT 
    815 int lstat_test_hook(int ver, const char *file_name, struct stat *buf) 
     815extern "C" int lstat_test_hook(int ver, const char *file_name, struct stat *buf) 
    816816#else 
    817 int lstat_test_hook(const char *file_name, struct stat *buf) 
     817extern "C" int lstat_test_hook(const char *file_name, struct stat *buf) 
    818818#endif 
    819819{ 
     
    16671667                // create a new file to force an upload 
    16681668 
    1669                 char* new_file = "testfiles/TestDir1/force-upload-2"; 
     1669                const char* new_file = "testfiles/TestDir1/force-upload-2"; 
    16701670                int fd = open(new_file,  
    16711671                        O_CREAT | O_EXCL | O_WRONLY, 0700); 
     
    16761676                TEST_THAT(fd > 0); 
    16771677         
    1678                 char* control_string = "whee!\n"; 
     1678                const char* control_string = "whee!\n"; 
    16791679                TEST_THAT(write(fd, control_string,  
    16801680                        strlen(control_string)) == 
     
    24192419                        // runs the SyncAllowScript again. 
    24202420 
    2421                         char* sync_control_file = "testfiles"  
     2421                        const char* sync_control_file = "testfiles"  
    24222422                                DIRECTORY_SEPARATOR "syncallowscript.control"; 
    24232423                        int fd = open(sync_control_file,  
     
    24292429                        TEST_THAT(fd > 0); 
    24302430                 
    2431                         char* control_string = "10\n"; 
     2431                        const char* control_string = "10\n"; 
    24322432                        TEST_THAT(write(fd, control_string,  
    24332433                                strlen(control_string)) == 
     
    24382438                        // every 10 seconds to see if they are allowed again. 
    24392439 
    2440                         char* new_test_file = "testfiles" 
     2440                        const char* new_test_file = "testfiles" 
    24412441                                DIRECTORY_SEPARATOR "TestDir1" 
    24422442                                DIRECTORY_SEPARATOR "Added_During_Pause"; 
Note: See TracChangeset for help on using the changeset viewer.