Changeset 4045 for trunk/psLib/test/dataIO/tst_psDB.c
- Timestamp:
- May 27, 2005, 4:51:28 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/dataIO/tst_psDB.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/dataIO/tst_psDB.c
r4044 r4045 9 9 * @author Aaron Culliney, MHPCC 10 10 * 11 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-05-28 0 1:02:08$11 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-05-28 02:50:59 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 184 184 } 185 185 186 psMetadata *_get_ rand_row( void )186 psMetadata *_get_const_row1( void ) 187 187 { 188 188 char buf[32]; 189 snprintf(buf, 32, "% d", rand());189 snprintf(buf, 32, "%s","randrow1" ); 190 190 return _get_RowMetadata( 191 191 "key_string", "comment-string", buf, 192 "key_s32", "comment-s32", rand(), 193 "key_f32", "comment-f32", (double)rand()/RAND_MAX, 194 "key_f64", "comment-f64", (double)rand()/RAND_MAX, 195 "key_bool", "comment-bool", round((double)rand()/RAND_MAX), 192 // "key_s32", "comment-s32", rand(), 193 "key_s32", "comment-s32", 12345, 194 // "key_f32", "comment-f32", (double)rand()/RAND_MAX, 195 "key_f32", "comment-f32", 9876.5, 196 // "key_f64", "comment-f64", (double)rand()/RAND_MAX, 197 "key_f64", "comment-f64", 456.75, 198 // "key_bool", "comment-bool", round((double)rand()/RAND_MAX), 199 "key_bool", "comment-bool", true, 200 NULL, NULL, 0.0); 201 } 202 203 psMetadata *_get_const_row2( void ) 204 { 205 char buf[32]; 206 snprintf(buf, 32, "%s","randrow2"); 207 return _get_RowMetadata( 208 "key_string", "comment-string", buf, 209 // "key_s32", "comment-s32", rand(), 210 "key_s32", "comment-s32", 2345, 211 // "key_f32", "comment-f32", (double)rand()/RAND_MAX, 212 "key_f32", "comment-f32", 876.5, 213 // "key_f64", "comment-f64", (double)rand()/RAND_MAX, 214 "key_f64", "comment-f64", 56.75, 215 // "key_bool", "comment-bool", round((double)rand()/RAND_MAX), 216 "key_bool", "comment-bool", false, 196 217 NULL, NULL, 0.0); 197 218 } … … 388 409 if (!failed) { 389 410 390 row = _get_ rand_row();391 psDBInsertOneRow(dbh, table, row); 392 psFree(row); 393 394 row = _get_ rand_row();411 row = _get_const_row1(); 412 psDBInsertOneRow(dbh, table, row); 413 psFree(row); 414 415 row = _get_const_row2(); 395 416 psDBInsertOneRow(dbh, table, row); 396 417 psFree(row); … … 474 495 if (!failed) { 475 496 476 row = _get_ rand_row();477 psDBInsertOneRow(dbh, table, row); 478 psFree(row); 479 480 row = _get_ rand_row();497 row = _get_const_row1(); 498 psDBInsertOneRow(dbh, table, row); 499 psFree(row); 500 501 row = _get_const_row2(); 481 502 psDBInsertOneRow(dbh, table, row); 482 503 psFree(row); … … 548 569 if (!failed) { 549 570 550 row = _get_ rand_row();551 psDBInsertOneRow(dbh, table, row); 552 psFree(row); 553 554 row = _get_ rand_row();571 row = _get_const_row1(); 572 psDBInsertOneRow(dbh, table, row); 573 psFree(row); 574 575 row = _get_const_row2(); 555 576 psDBInsertOneRow(dbh, table, row); 556 577 psFree(row); … … 627 648 failed = ! psDBCreateTable(dbh, table, md); 628 649 if (!failed) { 629 row = _get_ rand_row();650 row = _get_const_row1(); 630 651 failed = ! psDBInsertOneRow(dbh, table, row); 631 652 psFree(row); … … 661 682 rowSet->n = 0; 662 683 663 row = _get_ rand_row();684 row = _get_const_row1(); 664 685 psArrayAdd(rowSet, 0, row); 665 686 psFree(row); 666 687 667 row = _get_ rand_row();688 row = _get_const_row2(); 668 689 psArrayAdd(rowSet, 0, row); 669 690 psFree(row); … … 734 755 if (!failed) { 735 756 736 row = _get_ rand_row();737 psDBInsertOneRow(dbh, table, row); 738 psFree(row); 739 740 row = _get_ rand_row();757 row = _get_const_row1(); 758 psDBInsertOneRow(dbh, table, row); 759 psFree(row); 760 761 row = _get_const_row2(); 741 762 psDBInsertOneRow(dbh, table, row); 742 763 psFree(row); … … 804 825 if (!failed) { 805 826 806 row = _get_ rand_row();807 psDBInsertOneRow(dbh, table, row); 808 psFree(row); 809 810 row = _get_ rand_row();827 row = _get_const_row1(); 828 psDBInsertOneRow(dbh, table, row); 829 psFree(row); 830 831 row = _get_const_row2(); 811 832 psDBInsertOneRow(dbh, table, row); 812 833 psFree(row); … … 854 875 rowSet->n = 0; 855 876 856 row = _get_ rand_row();877 row = _get_const_row1(); 857 878 psArrayAdd(rowSet, 0, row); 858 879 psFree(row); 859 880 860 row = _get_ rand_row();881 row = _get_const_row2(); 861 882 psArrayAdd(rowSet, 0, row); 862 883 psFree(row); … … 933 954 rowSet->n = 0; 934 955 935 row = _get_ rand_row();956 row = _get_const_row1(); 936 957 psArrayAdd(rowSet, 0, row); 937 958 psFree(row); 938 959 939 row = _get_ rand_row();960 row = _get_const_row2(); 940 961 psArrayAdd(rowSet, 0, row); 941 962 psFree(row);
Note:
See TracChangeset
for help on using the changeset viewer.
