Fossil SCM

Add the test-hash-color command for testing the hash_color() function.

drh 2011-08-26 14:11 trunk
Commit 130b8f77ff5856259fc1caa926f1344dfb86e022
1 file changed +15
--- src/timeline.c
+++ src/timeline.c
@@ -152,10 +152,25 @@
152152
default: r = mx; g = mn, b = h2; break;
153153
}
154154
sqlite3_snprintf(8, zColor, "#%02x%02x%02x", r,g,b);
155155
return zColor;
156156
}
157
+
158
+/*
159
+** COMMAND: test-hash-color
160
+**
161
+** Usage: %fossil test-hash-color TAG ...
162
+**
163
+** Print out the color names associated with each tag. Used for
164
+** testing the hash_color() function.
165
+*/
166
+void test_hash_color(void){
167
+ int i;
168
+ for(i=2; i<g.argc; i++){
169
+ fossil_print("%20s: %s\n", g.argv[i], hash_color(g.argv[i]));
170
+ }
171
+}
157172
158173
/*
159174
** Output a timeline in the web format given a query. The query
160175
** should return these columns:
161176
**
162177
--- src/timeline.c
+++ src/timeline.c
@@ -152,10 +152,25 @@
152 default: r = mx; g = mn, b = h2; break;
153 }
154 sqlite3_snprintf(8, zColor, "#%02x%02x%02x", r,g,b);
155 return zColor;
156 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
158 /*
159 ** Output a timeline in the web format given a query. The query
160 ** should return these columns:
161 **
162
--- src/timeline.c
+++ src/timeline.c
@@ -152,10 +152,25 @@
152 default: r = mx; g = mn, b = h2; break;
153 }
154 sqlite3_snprintf(8, zColor, "#%02x%02x%02x", r,g,b);
155 return zColor;
156 }
157
158 /*
159 ** COMMAND: test-hash-color
160 **
161 ** Usage: %fossil test-hash-color TAG ...
162 **
163 ** Print out the color names associated with each tag. Used for
164 ** testing the hash_color() function.
165 */
166 void test_hash_color(void){
167 int i;
168 for(i=2; i<g.argc; i++){
169 fossil_print("%20s: %s\n", g.argv[i], hash_color(g.argv[i]));
170 }
171 }
172
173 /*
174 ** Output a timeline in the web format given a query. The query
175 ** should return these columns:
176 **
177

Keyboard Shortcuts

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