Fossil SCM
Add the test-hash-color command for testing the hash_color() function.
Commit
130b8f77ff5856259fc1caa926f1344dfb86e022
Parent
0b4f83067aba90e…
1 file changed
+15
+15
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -152,10 +152,25 @@ | ||
| 152 | 152 | default: r = mx; g = mn, b = h2; break; |
| 153 | 153 | } |
| 154 | 154 | sqlite3_snprintf(8, zColor, "#%02x%02x%02x", r,g,b); |
| 155 | 155 | return zColor; |
| 156 | 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 | +} | |
| 157 | 172 | |
| 158 | 173 | /* |
| 159 | 174 | ** Output a timeline in the web format given a query. The query |
| 160 | 175 | ** should return these columns: |
| 161 | 176 | ** |
| 162 | 177 |
| --- 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 |