Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Previous change made this size smaller, but it resulted in actually another algorithm...
[simgrid.git] / teshsuite / xbt / log_large / log_large_test.c
1 /* log_large_test -- log a very large string to test the dynamic variants   */
2
3 /* Copyright (c) 2007-2014. The SimGrid Team.
4  * All rights reserved.                                                     */
5
6 /* This program is free software; you can redistribute it and/or modify it
7  * under the terms of the license (GNU LGPL) which comes with this package. */
8
9 #include "xbt.h"
10
11 XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Logs of this example");
12
13
14 int main(int argc, char *argv[])
15 {
16   char *tmp = bprintf("\n%d%s%d%s%d%s%d%s%d%s%d%s%d%s%d%s%d%s%d%s",
17                       1,
18                       ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
19                       2,
20                       ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
21                       3,
22                       ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
23                       4,
24                       ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
25                       5,
26                       ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
27                       6,
28                       ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
29                       7,
30                       ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
31                       8,
32                       ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
33                       9,
34                       ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
35                       0,
36                       ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n");
37
38   xbt_init(&argc, argv);
39
40   XBT_INFO("This is a very large message:\n0%s1%s2%s3%s4%s5%s6%s7%s8%s9%s",
41          tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp);
42   XBT_INFO("Done (strlen>%d)", (int) (10 * strlen(tmp)));
43   free(tmp);
44
45   return 0;
46 }