Fossil SCM

Add the test-tempname command for testing the file_tempname() routine.

drh 2017-08-23 17:29 trunk
Commit f1d23f04c00cc6028012240ed0a13092efa7e921d6a8c6ba1af4830ac5dff5d6
1 file changed +17
+17
--- src/file.c
+++ src/file.c
@@ -1452,10 +1452,27 @@
14521452
#else
14531453
fossil_path_free((char *)azDirs[0]);
14541454
#endif
14551455
}
14561456
1457
+
1458
+/*
1459
+** COMMAND: test-tempname
1460
+** Usage: fossil test-name BASENAME ...
1461
+**
1462
+** Generate temporary filenames derived from BASENAME
1463
+*/
1464
+void file_test_tempname(void){
1465
+ int i;
1466
+ Blob x = BLOB_INITIALIZER;
1467
+ for(i=2; i<g.argc; i++){
1468
+ file_tempname(&x, g.argv[i]);
1469
+ fossil_print("%s\n", blob_str(&x));
1470
+ blob_reset(&x);
1471
+ }
1472
+}
1473
+
14571474
14581475
/*
14591476
** Return true if a file named zName exists and has identical content
14601477
** to the blob pContent. If zName does not exist or if the content is
14611478
** different in any way, then return false.
14621479
--- src/file.c
+++ src/file.c
@@ -1452,10 +1452,27 @@
1452 #else
1453 fossil_path_free((char *)azDirs[0]);
1454 #endif
1455 }
1456
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1457
1458 /*
1459 ** Return true if a file named zName exists and has identical content
1460 ** to the blob pContent. If zName does not exist or if the content is
1461 ** different in any way, then return false.
1462
--- src/file.c
+++ src/file.c
@@ -1452,10 +1452,27 @@
1452 #else
1453 fossil_path_free((char *)azDirs[0]);
1454 #endif
1455 }
1456
1457
1458 /*
1459 ** COMMAND: test-tempname
1460 ** Usage: fossil test-name BASENAME ...
1461 **
1462 ** Generate temporary filenames derived from BASENAME
1463 */
1464 void file_test_tempname(void){
1465 int i;
1466 Blob x = BLOB_INITIALIZER;
1467 for(i=2; i<g.argc; i++){
1468 file_tempname(&x, g.argv[i]);
1469 fossil_print("%s\n", blob_str(&x));
1470 blob_reset(&x);
1471 }
1472 }
1473
1474
1475 /*
1476 ** Return true if a file named zName exists and has identical content
1477 ** to the blob pContent. If zName does not exist or if the content is
1478 ** different in any way, then return false.
1479

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button