Fossil SCM

Add --slash option to test-canonical-name and test-relative-name

jan.nijtmans 2013-09-19 08:30 trunk
Commit e6ced76797733d2c77116bf5012177929dc503a9
1 file changed +4 -2
+4 -2
--- src/file.c
+++ src/file.c
@@ -794,15 +794,16 @@
794794
** Also test Fossil's ability to measure attributes of a file.
795795
*/
796796
void cmd_test_canonical_name(void){
797797
int i;
798798
Blob x;
799
+ int slashFlag = find_option("slash",0,0)!=0;
799800
blob_zero(&x);
800801
for(i=2; i<g.argc; i++){
801802
char zBuf[100];
802803
const char *zName = g.argv[i];
803
- file_canonical_name(zName, &x, 0);
804
+ file_canonical_name(zName, &x, slashFlag);
804805
fossil_print("[%s] -> [%s]\n", zName, blob_buffer(&x));
805806
blob_reset(&x);
806807
sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_size(zName));
807808
fossil_print(" file_size = %s\n", zBuf);
808809
sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_mtime(zName));
@@ -916,14 +917,15 @@
916917
**
917918
** Test the operation of the relative name generator.
918919
*/
919920
void cmd_test_relative_name(void){
920921
int i;
922
+ int slashFlag = find_option("slash",0,0)!=0;
921923
Blob x;
922924
blob_zero(&x);
923925
for(i=2; i<g.argc; i++){
924
- file_relative_name(g.argv[i], &x, 0);
926
+ file_relative_name(g.argv[i], &x, slashFlag);
925927
fossil_print("%s\n", blob_buffer(&x));
926928
blob_reset(&x);
927929
}
928930
}
929931
930932
--- src/file.c
+++ src/file.c
@@ -794,15 +794,16 @@
794 ** Also test Fossil's ability to measure attributes of a file.
795 */
796 void cmd_test_canonical_name(void){
797 int i;
798 Blob x;
 
799 blob_zero(&x);
800 for(i=2; i<g.argc; i++){
801 char zBuf[100];
802 const char *zName = g.argv[i];
803 file_canonical_name(zName, &x, 0);
804 fossil_print("[%s] -> [%s]\n", zName, blob_buffer(&x));
805 blob_reset(&x);
806 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_size(zName));
807 fossil_print(" file_size = %s\n", zBuf);
808 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_mtime(zName));
@@ -916,14 +917,15 @@
916 **
917 ** Test the operation of the relative name generator.
918 */
919 void cmd_test_relative_name(void){
920 int i;
 
921 Blob x;
922 blob_zero(&x);
923 for(i=2; i<g.argc; i++){
924 file_relative_name(g.argv[i], &x, 0);
925 fossil_print("%s\n", blob_buffer(&x));
926 blob_reset(&x);
927 }
928 }
929
930
--- src/file.c
+++ src/file.c
@@ -794,15 +794,16 @@
794 ** Also test Fossil's ability to measure attributes of a file.
795 */
796 void cmd_test_canonical_name(void){
797 int i;
798 Blob x;
799 int slashFlag = find_option("slash",0,0)!=0;
800 blob_zero(&x);
801 for(i=2; i<g.argc; i++){
802 char zBuf[100];
803 const char *zName = g.argv[i];
804 file_canonical_name(zName, &x, slashFlag);
805 fossil_print("[%s] -> [%s]\n", zName, blob_buffer(&x));
806 blob_reset(&x);
807 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_size(zName));
808 fossil_print(" file_size = %s\n", zBuf);
809 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_mtime(zName));
@@ -916,14 +917,15 @@
917 **
918 ** Test the operation of the relative name generator.
919 */
920 void cmd_test_relative_name(void){
921 int i;
922 int slashFlag = find_option("slash",0,0)!=0;
923 Blob x;
924 blob_zero(&x);
925 for(i=2; i<g.argc; i++){
926 file_relative_name(g.argv[i], &x, slashFlag);
927 fossil_print("%s\n", blob_buffer(&x));
928 blob_reset(&x);
929 }
930 }
931
932

Keyboard Shortcuts

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