#include <ndb_global.h>#include "NdbOut.hpp"#include "NdbThread.h"#include "NdbMutex.h"#include "NdbCondition.h"#include "NdbSleep.h"#include "NdbTick.h"#include "NdbEnv.h"#include "NdbHost.h"#include "NdbMain.h"Include dependency graph for NdbPortLibTest.cpp:

Go to the source code of this file.
Defines | |
| #define | T2_THREADS 10 |
| #define | T3_THREADS 10 |
Functions | |
| static void | fail (const char *test, const char *cause) |
| void * | thread1func (void *arg) |
| void * | test2func (void *arg) |
| void * | testfunc (void *arg) |
| void * | testTryLockfunc (void *arg) |
| void | testMicros (int count) |
| Uint64 | time_diff (Uint64 s1, Uint64 s2, Uint32 m1, Uint32 m2) |
| NDB_COMMAND (PortLibTest,"portlibtest","portlibtest","Test the portable function layer", 4096) | |
Variables | |
| int | TestHasFailed |
| int | verbose = 0 |
| NdbMutex * | test2mutex |
| NdbMutex * | testmutex |
| NdbCondition * | testcond |
| int | testthreadsdone |
| #define T2_THREADS 10 |
Referenced by NDB_COMMAND().
| #define T3_THREADS 10 |
Referenced by NDB_COMMAND().
| static void fail | ( | const char * | test, | |
| const char * | cause | |||
| ) | [static] |
Definition at line 38 of file NdbPortLibTest.cpp.
References ndbout(), and TestHasFailed.
Referenced by ac_trie_prepare(), Dbtup::addTuxEntries(), compare(), NDB_COMMAND(), test2func(), testfunc(), testTryLockfunc(), and thread1func().
00039 { 00040 TestHasFailed = 1; 00041 ndbout << test << " failed, " << cause << endl; 00042 }
Here is the call graph for this function:

Here is the caller graph for this function:

| NDB_COMMAND | ( | PortLibTest | , | |
| "portlibtest" | , | |||
| "portlibtest" | , | |||
| "Test the portable function layer" | , | |||
| 4096 | ||||
| ) |
Definition at line 173 of file NdbPortLibTest.cpp.
References args, buf, fail(), NDB_THREAD_PRIO_MEAN, NdbCondition_Create(), NdbCondition_Destroy(), NdbCondition_Wait(), NdbCondition_WaitTimeout(), NdbEnv_GetEnv(), NdbHost_GetHostName(), NdbMutex_Create(), NdbMutex_Destroy(), NdbMutex_Lock(), NdbMutex_Unlock(), ndbout(), NdbSleep_MilliSleep(), NdbThread_Create(), NdbThread_Destroy(), NdbThread_WaitFor(), NdbTick_CurrentMicrosecond(), NdbTick_CurrentMillisecond(), NULL, status, strcmp(), T2_THREADS, T3_THREADS, test2func(), test2mutex, testcond, testfunc(), TestHasFailed, testMicros(), testmutex, testthreadsdone, testTryLockfunc(), thread1func(), threads, and time_diff().
00173 { 00174 00175 ndbout << "= TESTING ARGUMENT PASSING ============" << endl; 00176 ndbout << "ARGC: " << argc << endl; 00177 for(int i = 1; i < argc; i++){ 00178 ndbout << " ARGV"<<i<<": " << (char*)argv[i] << endl; 00179 } 00180 ndbout << endl << endl; 00181 00182 00183 struct NdbThread* thread1var; 00184 void *status = 0; 00185 int arg = 7; 00186 00187 TestHasFailed = 0; 00188 // create one thread and wait for it to return 00189 ndbout << "= TEST1 ===============================" << endl; 00190 00191 thread1var = NdbThread_Create(thread1func, // Function 00192 (void**)&arg,// Arg 00193 2048, // Stacksize 00194 (char*)"thread1", // Thread name 00195 NDB_THREAD_PRIO_MEAN); // Thread priority 00196 00197 00198 if(NdbThread_WaitFor(thread1var, &status) != 0) 00199 fail("TEST1", "NdbThread_WaitFor failed"); 00200 // NOTE! thread return value is not yet used in Ndb and thus not tested(does not work) 00201 //ndbout << "thread1 returned, status = " << status << endl; 00202 //if (status != 8) 00203 // fail("TEST1", "Wrong status"); 00204 ndbout << "TEST1 completed" << endl; 00205 00206 00207 NdbThread_Destroy(&thread1var); 00208 00209 // Create 10 threads that will wait for a mutex before printing it's message to screen 00210 ndbout << "= TEST2 ===============================" << endl; 00211 #define T2_THREADS 10 00212 NdbThread* threads[T2_THREADS]; 00213 int args[T2_THREADS]; 00214 void *status2 = 0; 00215 test2mutex = NdbMutex_Create(); 00216 NdbMutex_Lock(test2mutex); 00217 00218 for (int i = 0; i < T2_THREADS; i++) 00219 { 00220 args[i] = i; 00221 threads[i] = NdbThread_Create(test2func, // Function 00222 (void**)&args[i],// Arg 00223 2048, // Stacksize 00224 (char*)"test2thread", // Thread name 00225 NDB_THREAD_PRIO_MEAN); // Thread priority 00226 if (threads[i] == NULL) 00227 fail("TEST2", "NdbThread_Create failed"); 00228 } 00229 00230 ndbout << "All threads created" << endl; 00231 00232 NdbMutex_Unlock(test2mutex); 00233 00234 for (int i = 0; i < T2_THREADS; i++) 00235 { 00236 if (NdbThread_WaitFor(threads[i], &status2)) 00237 fail("TEST2", "NdbThread_WaitFor failed"); 00238 00239 NdbThread_Destroy(&threads[i]); 00240 // Don't test return values 00241 // ndbout << "thread" << i << " returned, status = " << status2 << endl; 00242 // if (status2 != i) 00243 // fail("TEST2", "Wrong status"); 00244 } 00245 00246 if (NdbMutex_Lock(test2mutex) != 0) 00247 fail("TEST2", "NdbMutex_Lock failed"); 00248 if (NdbMutex_Unlock(test2mutex) != 0) 00249 fail("TEST2", "NdbMutex_Unlock failed"); 00250 if (NdbMutex_Destroy(test2mutex) != 0) 00251 fail("TEST2", "NdbMutex_Destroy failed"); 00252 ndbout << "TEST2 completed" << endl; 00253 00254 ndbout << "= TEST3 ===============================" << endl; 00255 // Create 10 threads that will by synchronised by a condition 00256 // When they are awakened and have the mutex they will increment a global variable 00257 #define T3_THREADS 10 00258 NdbThread* t3threads[T3_THREADS]; 00259 int t3args[T3_THREADS]; 00260 void *status3 = 0; 00261 00262 testmutex = NdbMutex_Create(); 00263 testcond = NdbCondition_Create(); 00264 testthreadsdone = 0; 00265 00266 for (int i = 0; i < T3_THREADS; i++) 00267 { 00268 t3args[i] = i; 00269 t3threads[i] = NdbThread_Create(testfunc, // Function 00270 (void**)&t3args[i],// Arg 00271 2048, // Stacksize 00272 (char*)"test3thread", // Thread name 00273 NDB_THREAD_PRIO_MEAN); // Thread priority 00274 } 00275 00276 ndbout << "All threads created" << endl; 00277 00278 if (NdbMutex_Lock(testmutex) != 0) 00279 fail("TEST3", "NdbMutex_Lock failed"); 00280 00281 while (testthreadsdone < T3_THREADS*10) 00282 { 00283 if(NdbCondition_Wait(testcond, testmutex) != 0) 00284 fail("TEST3", "NdbCondition_Wait failed"); 00285 ndbout << "Condition signaled, there are " << testthreadsdone << " completed threads" << endl; 00286 } 00287 if (NdbMutex_Unlock(testmutex) != 0) 00288 fail("TEST3", "NdbMutex_Unlock failed"); 00289 00290 for (int i = 0; i < T3_THREADS; i++) 00291 { 00292 if (NdbThread_WaitFor(t3threads[i], &status3) != 0) 00293 fail("TEST3", "NdbThread_WaitFor failed"); 00294 00295 NdbThread_Destroy(&t3threads[i]); 00296 //ndbout << "thread" << i << " returned, status = " << status3 << endl; 00297 //if (status3 != i) 00298 // fail("TEST3", "Wrong status"); 00299 } 00300 00301 NdbMutex_Destroy(testmutex); 00302 NdbCondition_Destroy(testcond); 00303 ndbout << "TEST3 completed" << endl; 00304 00305 ndbout << "= TEST4 ===============================" << endl; 00306 // Check tick functions 00307 00308 //#if 0 00309 00310 int sleeptimes[] = {78, 12, 199, 567, 899}; 00311 00312 00313 for (int i = 0; i < 5; i++) 00314 { 00315 ndbout << "*------------------------------- Measure" << i << endl; 00316 00317 NDB_TICKS millisec_now; 00318 NDB_TICKS millisec_now2; 00319 00320 millisec_now = NdbTick_CurrentMillisecond(); 00321 NdbSleep_MilliSleep(sleeptimes[i]); 00322 millisec_now2 = NdbTick_CurrentMillisecond(); 00323 00324 ndbout << " Time before sleep = " << millisec_now << endl; 00325 ndbout << " Time after sleep = " << millisec_now2 << endl; 00326 ndbout << " Tried to sleep "<<sleeptimes[i]<<" milliseconds." << endl; 00327 ndbout << " Sleep time was " << millisec_now2 -millisec_now <<" milliseconds." << endl; 00328 00329 } 00330 00331 ndbout << "TEST4 completed" << endl; 00332 00333 ndbout << "= TEST5 ===============================" << endl; 00334 // Check NdbOut 00335 00336 ndbout << "Testing hex and dec functions of NdbOut" << endl; 00337 00338 for (int i = 0; i<= 0xFF; i++) 00339 { 00340 ndbout << i << "=" <<hex << i << "="<<dec << i << ", "; 00341 } 00342 00343 ndbout << endl<< "Testing that hex is reset to dec by endl" << endl; 00344 ndbout << hex << 67 << endl; 00345 ndbout << 67 << endl; 00346 00347 ndbout << "TEST5 completed" << endl; 00348 00349 00350 ndbout << "= TEST6 ===============================" << endl; 00351 const char* theEnvHostNamePtr; 00352 char buf[255]; 00353 char theHostHostName[256]; 00354 theEnvHostNamePtr = NdbEnv_GetEnv("HOSTNAME", buf, 255); 00355 if(theEnvHostNamePtr == NULL) 00356 fail("TEST6", "Could not get HOSTNAME from env"); 00357 else{ 00358 ndbout << "HOSTNAME from GetEnv" << theEnvHostNamePtr << endl; 00359 00360 NdbHost_GetHostName(theHostHostName); 00361 00362 ndbout << "HOSTNAME from GetHostName" <<theHostHostName << endl; 00363 00364 if (strcmp(theEnvHostNamePtr, theHostHostName) != 0) 00365 fail("TEST6", "NdbHost_GetHostName or NdbEnv_GetEnv failed"); 00366 } 00367 00368 ndbout << "= TEST7 ===============================" << endl; 00369 00370 testmutex = NdbMutex_Create(); 00371 testcond = NdbCondition_Create(); 00372 testthreadsdone = 0; 00373 00374 for (int i = 0; i < T3_THREADS; i++) 00375 { 00376 t3args[i] = i; 00377 t3threads[i] = NdbThread_Create(testfunc, // Function 00378 (void**)&t3args[i],// Arg 00379 2048, // Stacksize 00380 (char*)"test7thread", // Thread name 00381 NDB_THREAD_PRIO_MEAN); // Thread priority 00382 } 00383 00384 ndbout << "All threads created" << endl; 00385 00386 if (NdbMutex_Lock(testmutex) != 0) 00387 fail("TEST7", "NdbMutex_Lock failed"); 00388 00389 while (testthreadsdone < T3_THREADS*10) 00390 { 00391 // just testing the functionality without timing out, therefor 20 sec. 00392 if(NdbCondition_WaitTimeout(testcond, testmutex, 20000) != 0) 00393 fail("TEST7", "NdbCondition_WaitTimeout failed"); 00394 ndbout << "Condition signaled, there are " << testthreadsdone << " completed threads" << endl; 00395 } 00396 if (NdbMutex_Unlock(testmutex) != 0) 00397 fail("TEST7", "NdbMutex_Unlock failed"); 00398 00399 for (int i = 0; i < T3_THREADS; i++) 00400 { 00401 if (NdbThread_WaitFor(t3threads[i], &status3) != 0) 00402 fail("TEST7", "NdbThread_WaitFor failed"); 00403 00404 NdbThread_Destroy(&t3threads[i]); 00405 } 00406 00407 NdbMutex_Destroy(testmutex); 00408 NdbCondition_Destroy(testcond); 00409 00410 ndbout << "TEST7 completed" << endl; 00411 00412 00413 ndbout << "= TEST8 ===============================" << endl; 00414 ndbout << " NdbCondition_WaitTimeout" << endl; 00415 testmutex = NdbMutex_Create(); 00416 testcond = NdbCondition_Create(); 00417 00418 for (int i = 0; i < 5; i++) 00419 { 00420 ndbout << "*------------------------------- Measure" << i << endl; 00421 00422 NDB_TICKS millisec_now; 00423 NDB_TICKS millisec_now2; 00424 00425 millisec_now = NdbTick_CurrentMillisecond(); 00426 if (NdbCondition_WaitTimeout(testcond, testmutex, sleeptimes[i]) != 0) 00427 fail("TEST8", "NdbCondition_WaitTimeout failed"); 00428 millisec_now2 = NdbTick_CurrentMillisecond(); 00429 00430 ndbout << " Time before WaitTimeout = " << millisec_now << endl; 00431 ndbout << " Time after WaitTimeout = " << millisec_now2 << endl; 00432 ndbout << " Tried to wait "<<sleeptimes[i]<<" milliseconds." << endl; 00433 ndbout << " Wait time was " << millisec_now2 -millisec_now <<" milliseconds." << endl; 00434 00435 } 00436 00437 ndbout << "TEST8 completed" << endl; 00438 00439 00440 ndbout << "= TEST9 ===============================" << endl; 00441 ndbout << " NdbTick_CurrentXXXXXsecond compare" << endl; 00442 00443 for (int i = 0; i < 5; i++) 00444 { 00445 ndbout << "*------------------------------- Measure" << i << endl; 00446 00447 NDB_TICKS millisec_now; 00448 NDB_TICKS millisec_now2; 00449 Uint32 usec_now, usec_now2; 00450 Uint64 msec_now, msec_now2; 00451 00452 00453 millisec_now = NdbTick_CurrentMillisecond(); 00454 NdbTick_CurrentMicrosecond( &msec_now, &usec_now); 00455 00456 NdbSleep_MilliSleep(sleeptimes[i]); 00457 00458 millisec_now2 = NdbTick_CurrentMillisecond(); 00459 NdbTick_CurrentMicrosecond( &msec_now2, &usec_now2); 00460 00461 Uint64 usecdiff = time_diff(msec_now,msec_now2,usec_now,usec_now2); 00462 NDB_TICKS msecdiff = millisec_now2 -millisec_now; 00463 00464 ndbout << " Slept "<<sleeptimes[i]<<" milliseconds." << endl; 00465 ndbout << " Measured " << msecdiff <<" milliseconds with milli function ." << endl; 00466 ndbout << " Measured " << usecdiff/1000 << "," << usecdiff%1000<<" milliseconds with micro function ." << endl; 00467 } 00468 00469 ndbout << "TEST9 completed" << endl; 00470 00471 00472 const int iter = 20; 00473 ndbout << "Testing microsecond timer - " << iter << " iterations" << endl; 00474 testMicros(iter); 00475 ndbout << "Testing microsecond timer - COMPLETED" << endl; 00476 00477 #if defined NDB_OSE || defined NDB_SOFTOSE 00478 ndbout << "system_tick() = " << system_tick() << " us per tick" << endl; 00479 #endif 00480 00481 00482 ndbout << "= TEST10 ===============================" << endl; 00483 00484 testmutex = NdbMutex_Create(); 00485 testcond = NdbCondition_Create(); 00486 testthreadsdone = 0; 00487 00488 for (int i = 0; i < T3_THREADS; i++) 00489 { 00490 t3args[i] = i; 00491 t3threads[i] = NdbThread_Create(testTryLockfunc, // Function 00492 (void**)&t3args[i],// Arg 00493 2048, // Stacksize 00494 (char*)"test10thread", // Thread name 00495 NDB_THREAD_PRIO_MEAN); // Thread priority 00496 } 00497 00498 ndbout << "All threads created" << endl; 00499 00500 if (NdbMutex_Lock(testmutex) != 0) 00501 fail("TEST10", "NdbMutex_Lock failed"); 00502 00503 while (testthreadsdone < T3_THREADS*10) 00504 { 00505 if(NdbCondition_Wait(testcond, testmutex) != 0) 00506 fail("TEST10", "NdbCondition_WaitTimeout failed"); 00507 ndbout << "Condition signaled, there are " << testthreadsdone << " completed threads" << endl; 00508 } 00509 if (NdbMutex_Unlock(testmutex) != 0) 00510 fail("TEST10", "NdbMutex_Unlock failed"); 00511 00512 for (int i = 0; i < T3_THREADS; i++) 00513 { 00514 if (NdbThread_WaitFor(t3threads[i], &status3) != 0) 00515 fail("TEST10", "NdbThread_WaitFor failed"); 00516 00517 NdbThread_Destroy(&t3threads[i]); 00518 } 00519 00520 NdbMutex_Destroy(testmutex); 00521 NdbCondition_Destroy(testcond); 00522 00523 ndbout << "TEST10 completed" << endl; 00524 00525 00526 // Check total status of test 00527 00528 if (TestHasFailed == 1) 00529 ndbout << endl << "TEST FAILED!" << endl; 00530 else 00531 ndbout << endl << "TEST PASSED!" << endl; 00532 00533 return TestHasFailed; 00534 00535 };
Here is the call graph for this function:

| void* test2func | ( | void * | arg | ) |
Definition at line 64 of file NdbPortLibTest.cpp.
References fail(), NdbMutex_Lock(), NdbMutex_Unlock(), ndbout(), and test2mutex.
Referenced by NDB_COMMAND().
00065 { 00066 00067 int arg1; 00068 arg1 = *(int*)arg; 00069 ndbout << "thread" << arg1 << " started in test2func" << endl; 00070 00071 if (NdbMutex_Lock(test2mutex) != 0) 00072 fail("TEST2", "Failed to lock mutex"); 00073 00074 ndbout << "thread" << arg1 << ", test2func " << endl; 00075 00076 if (NdbMutex_Unlock(test2mutex) != 0) 00077 fail("TEST2", "Failed to unlock mutex"); 00078 00079 int returnvalue = arg1; 00080 return returnvalue; 00081 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void* testfunc | ( | void * | arg | ) |
Definition at line 90 of file NdbPortLibTest.cpp.
References fail(), NdbCondition_Signal(), NdbMutex_Lock(), NdbMutex_Unlock(), ndbout(), NdbSleep_MilliSleep(), NdbSleep_SecSleep(), testcond, testmutex, and testthreadsdone.
Referenced by NDB_COMMAND().
00091 { 00092 int tmpVar; 00093 int threadno; 00094 int result; 00095 00096 threadno = *(int*)arg; 00097 00098 ndbout << "Thread" << threadno << " started in testfunc" << endl; 00099 do 00100 { 00101 00102 if ((threadno % 2) == 0) 00103 result = NdbSleep_SecSleep(1); 00104 else 00105 result = NdbSleep_MilliSleep(100); 00106 00107 if (result != 0) 00108 fail("TEST3", "Wrong result from sleep function"); 00109 00110 if (NdbMutex_Lock(testmutex) != 0) 00111 fail("TEST3", "Wrong result from NdbMutex_Lock function"); 00112 00113 ndbout << "thread" << threadno << ", testfunc " << endl; 00114 testthreadsdone++; 00115 tmpVar = testthreadsdone; 00116 00117 if (NdbCondition_Signal(testcond) != 0) 00118 fail("TEST3", "Wrong result from NdbCondition_Signal function"); 00119 00120 if (NdbMutex_Unlock(testmutex) != 0) 00121 fail("TEST3", "Wrong result from NdbMutex_Unlock function"); 00122 00123 } 00124 while(tmpVar<100); 00125 00126 return 0; 00127 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void testMicros | ( | int | count | ) |
Definition at line 556 of file NdbPortLibTest.cpp.
References ndbout(), NdbSleep_MilliSleep(), NdbTick_CurrentMicrosecond(), TestHasFailed, time_diff(), and verbose.
Referenced by NDB_COMMAND().
00556 { 00557 Uint32 avg = 0; 00558 Uint32 sum2 = 0; 00559 00560 for(int i = 0; i<count; i++){ 00561 Uint64 s1, s2; 00562 Uint32 m1, m2; 00563 if(NdbTick_CurrentMicrosecond(&s1, &m1) != 0){ 00564 ndbout << "Failed to get current micro" << endl; 00565 TestHasFailed = 1; 00566 return; 00567 } 00568 Uint32 r = (rand() % 1000) + 1; 00569 NdbSleep_MilliSleep(r); 00570 if(NdbTick_CurrentMicrosecond(&s2, &m2) != 0){ 00571 ndbout << "Failed to get current micro" << endl; 00572 TestHasFailed = 1; 00573 return; 00574 } 00575 Uint64 m = time_diff(s1,s2,m1,m2); 00576 if(verbose) 00577 ndbout << "Slept for " << r << " ms" 00578 << " - Measured " << m << " us" << endl; 00579 00580 if(m > (r*1000)){ 00581 avg += (m - (r*1000)); 00582 sum2 += (m - (r*1000)) * (m - (r*1000)); 00583 } else { 00584 avg += ((r*1000) - m); 00585 sum2 += ((r*1000) - m) * ((r*1000) - m); 00586 } 00587 #if 0 00588 m /= 1000; 00589 if(m > r && ((m - r) > 10)){ 00590 ndbout << "Difference to big: " << (m - r) << " - Test failed" << endl; 00591 TestHasFailed = 1; 00592 } 00593 if(m < r && ((r - m) > 10)){ 00594 ndbout << "Difference to big: " << (r - m) << " - Test failed" << endl; 00595 TestHasFailed = 1; 00596 } 00597 #endif 00598 } 00599 00600 Uint32 dev = (avg * avg - sum2) / count; dev /= count; 00601 avg /= count; 00602 00603 Uint32 t = 0; 00604 while((t*t)<dev) t++; 00605 ndbout << "NOTE - measure are compared to NdbSleep_MilliSleep(...)" << endl; 00606 ndbout << "Average error = " << avg << " us" << endl; 00607 ndbout << "Stddev error = " << t << " us" << endl; 00608 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void* testTryLockfunc | ( | void * | arg | ) |
Definition at line 129 of file NdbPortLibTest.cpp.
References fail(), NdbCondition_Signal(), NdbMutex_Trylock(), NdbMutex_Unlock(), ndbout(), NdbSleep_MilliSleep(), NdbSleep_SecSleep(), testcond, testmutex, and testthreadsdone.
Referenced by NDB_COMMAND().
00130 { 00131 int tmpVar = 0; 00132 int threadno; 00133 int result; 00134 00135 threadno = *(int*)arg; 00136 00137 ndbout << "Thread" << threadno << " started" << endl; 00138 do 00139 { 00140 00141 if ((threadno % 2) == 0) 00142 result = NdbSleep_SecSleep(1); 00143 else 00144 result = NdbSleep_MilliSleep(100); 00145 00146 if (result != 0) 00147 fail("TEST3", "Wrong result from sleep function"); 00148 00149 if (NdbMutex_Trylock(testmutex) == 0){ 00150 00151 ndbout << "thread" << threadno << ", testTryLockfunc locked" << endl; 00152 testthreadsdone++; 00153 tmpVar = testthreadsdone; 00154 00155 if (NdbCondition_Signal(testcond) != 0) 00156 fail("TEST3", "Wrong result from NdbCondition_Signal function"); 00157 00158 if (NdbMutex_Unlock(testmutex) != 0) 00159 fail("TEST3", "Wrong result from NdbMutex_Unlock function"); 00160 } 00161 00162 } 00163 while(tmpVar<100); 00164 00165 return 0; 00166 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void* thread1func | ( | void * | arg | ) |
Definition at line 46 of file NdbPortLibTest.cpp.
References fail(), and ndbout().
Referenced by NDB_COMMAND().
00047 { 00048 int arg1; 00049 int returnvalue = 8; 00050 arg1 = *(int*)arg; 00051 ndbout << "thread1: thread1func called with arg = " << arg1 << endl; 00052 00053 // delay(1000); 00054 if (arg1 != 7) 00055 fail("TEST1", "Wrong arg"); 00056 00057 return returnvalue; 00058 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 537 of file NdbPortLibTest.cpp.
Referenced by NDB_COMMAND(), and testMicros().
00537 { 00538 00539 Uint64 diff = 0; 00540 diff += (s2 - s1) * 1000000; 00541 if(m2 >= m1) 00542 diff += (m2 - m1); 00543 else { 00544 diff += m2; 00545 diff -= m1; 00546 } 00547 00548 // if(0) 00549 // ndbout("(s1,m1) = (%d, %d) (s2,m2) = (%d, %d) -> diff = %d\n", 00550 // (Uint32)s1,m1,(Uint32)s2,m2, (Uint32)diff); 00551 00552 return diff; 00553 };
Here is the caller graph for this function:

Definition at line 87 of file NdbPortLibTest.cpp.
Referenced by NDB_COMMAND(), testfunc(), and testTryLockfunc().
| int TestHasFailed |
NdbPortLibTest.cpp Test the functionality of portlib TODO - Add tests for NdbMem
Definition at line 35 of file NdbPortLibTest.cpp.
Referenced by fail(), NDB_COMMAND(), and testMicros().
Definition at line 86 of file NdbPortLibTest.cpp.
Referenced by NDB_COMMAND(), testfunc(), and testTryLockfunc().
| int testthreadsdone |
Definition at line 88 of file NdbPortLibTest.cpp.
Referenced by NDB_COMMAND(), testfunc(), and testTryLockfunc().
| int verbose = 0 |
Definition at line 36 of file NdbPortLibTest.cpp.
1.4.7

