| 35 | static const int max_depth = 15; // 2^16-1 nodes. |
| 36 | |
| 37 | void Main() { |
| 38 | Str *cmd = new Str(CMD); |
| 39 | StrArr *args = (new Str(ARGS))->split(' '); |
| 40 | Int n = 0; |
| 41 | Str *output; |
| 42 | for (int j = 0; j < iter; j++) { |
| 43 | output = ReadProcess(cmd, args); |
| 44 | n += output->len(); |
| 45 | } |
| 46 | Check(n == iter * 48894, "read process output as bytes"); |
| 47 | Node *tree; |
| 48 | static Node *permtree; |
| 49 | Int counter; |
| 50 | counter = 0; |
| 51 | GCVar(permtree, make_tree(max_depth, counter)); |
| 52 | for (int i = 0; i < iter; i++) { |
| 53 | counter = 0; |
| 54 | tree = make_tree(max_depth, counter); |
| 55 | } |
| 56 | // This may overflow on 32-bit machines, so we use unsigned |
| 57 | // modulo arithmetic without division. |
| 58 | Check(sum_tree(tree) * 2 == counter * (counter - 1), |
| 59 | "stress test memory allocation"); |
| 60 | Check(NormalizePath(S("/foo/x/../bar/./"))->eq("/foo/bar"), "normalize path"); |
| 61 | Check(BaseName(ProgramPath())->eq("test1"), "program path"); |
| 62 | } |
nothing calls this directly
no test coverage detected