|
2 | 2 | #include <stdlib.h> |
3 | 3 | #include <string.h> |
4 | 4 | #include <time.h> |
| 5 | +#define OPENCSTL_TRACER |
5 | 6 | #include "opencstl/opencstl.h" |
6 | 7 | #define DECORATE(STR) {int padding = 70 - strlen(STR);int margin=0;if(padding%2==1)margin=1;else margin=0;for (int i = 0; i < padding/2; i++) { putchar('#'); } printf(STR); for (int i = 0; i < padding/2+margin; i++) { putchar('#'); } putchar('\n');} |
7 | 8 |
|
@@ -138,7 +139,7 @@ void cstl_list_test02(void) { |
138 | 139 | } |
139 | 140 |
|
140 | 141 |
|
141 | | - cstl_list_sort(list, LESS(int)); |
| 142 | + cstl_sort(list, LESS(int)); |
142 | 143 |
|
143 | 144 | logging.info("list size: %d", size(list)); |
144 | 145 | for (int *it = begin(list); it != end(list); it = next(it)) { |
@@ -388,16 +389,16 @@ void test01(void) { |
388 | 389 | void test02(void) { |
389 | 390 | VECTOR(int) v = new_vector(int); |
390 | 391 |
|
391 | | - watch t_beg = now(); |
| 392 | + watch t_beg = chrono.now(); |
392 | 393 | for (int i = 0; i < 100; i++) { |
393 | 394 | push_back(v, rand32() % 1000); |
394 | 395 | } |
395 | 396 |
|
396 | 397 | sort(v,size(v), sizeof(int),GREATER(int)); |
397 | 398 |
|
398 | | - watch t_end = now(); |
| 399 | + watch t_end = chrono.now(); |
399 | 400 |
|
400 | | - double ms = duration(t_beg, t_end); |
| 401 | + double ms = chrono.duration(t_beg, t_end); |
401 | 402 | for (int i = 0; i < size(v); i++) { |
402 | 403 | printf("[%4d]\n", v[i]); |
403 | 404 | } |
@@ -444,6 +445,9 @@ void test04(void) { |
444 | 445 | } |
445 | 446 |
|
446 | 447 | int main(void) { |
| 448 | + |
| 449 | + //cstl_list_test02(); |
| 450 | + //return 0; |
447 | 451 | // watch t_beg = now(); |
448 | 452 | // test_opencstl_unordered_set(); |
449 | 453 | // watch t_end = now(); |
|
0 commit comments