ooxml_crypt 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (264) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +4 -0
  3. data/LICENSE.txt +21 -0
  4. data/README.md +58 -0
  5. data/Rakefile +12 -0
  6. data/bin/console +15 -0
  7. data/bin/setup +8 -0
  8. data/ext/ooxml_crypt/extconf.rb +18 -0
  9. data/ext/ooxml_crypt/ooxml_crypt.c +27 -0
  10. data/ext/ooxml_crypt/ooxml_crypt.h +7 -0
  11. data/lib/ooxml_crypt/version.rb +5 -0
  12. data/lib/ooxml_crypt.rb +75 -0
  13. data/vendor/cybozulib/.github/workflows/main.yml +12 -0
  14. data/vendor/cybozulib/.gitignore +5 -0
  15. data/vendor/cybozulib/CMakeLists.txt +6 -0
  16. data/vendor/cybozulib/COPYRIGHT +27 -0
  17. data/vendor/cybozulib/Makefile +26 -0
  18. data/vendor/cybozulib/bin/libeay32.dll +0 -0
  19. data/vendor/cybozulib/bin/libmecab.dll +0 -0
  20. data/vendor/cybozulib/bin/ssleay32.dll +0 -0
  21. data/vendor/cybozulib/common.mk +116 -0
  22. data/vendor/cybozulib/common.props +25 -0
  23. data/vendor/cybozulib/cybozulib.sln +286 -0
  24. data/vendor/cybozulib/debug.props +14 -0
  25. data/vendor/cybozulib/include/cybozu/array.hpp +197 -0
  26. data/vendor/cybozulib/include/cybozu/atoi.hpp +238 -0
  27. data/vendor/cybozulib/include/cybozu/atomic.hpp +146 -0
  28. data/vendor/cybozulib/include/cybozu/base64.hpp +210 -0
  29. data/vendor/cybozulib/include/cybozu/benchmark.hpp +212 -0
  30. data/vendor/cybozulib/include/cybozu/bfd.hpp +105 -0
  31. data/vendor/cybozulib/include/cybozu/bit_operation.hpp +139 -0
  32. data/vendor/cybozulib/include/cybozu/bitvector.hpp +358 -0
  33. data/vendor/cybozulib/include/cybozu/condition_variable.hpp +113 -0
  34. data/vendor/cybozulib/include/cybozu/condition_variable_cs.hpp +74 -0
  35. data/vendor/cybozulib/include/cybozu/config.hpp +392 -0
  36. data/vendor/cybozulib/include/cybozu/critical_section.hpp +60 -0
  37. data/vendor/cybozulib/include/cybozu/crypto.hpp +321 -0
  38. data/vendor/cybozulib/include/cybozu/csucvector.hpp +624 -0
  39. data/vendor/cybozulib/include/cybozu/csv.hpp +294 -0
  40. data/vendor/cybozulib/include/cybozu/data_type.hpp +27 -0
  41. data/vendor/cybozulib/include/cybozu/endian.hpp +224 -0
  42. data/vendor/cybozulib/include/cybozu/env.hpp +63 -0
  43. data/vendor/cybozulib/include/cybozu/event.hpp +122 -0
  44. data/vendor/cybozulib/include/cybozu/exception.hpp +253 -0
  45. data/vendor/cybozulib/include/cybozu/file.hpp +626 -0
  46. data/vendor/cybozulib/include/cybozu/fmindex.hpp +291 -0
  47. data/vendor/cybozulib/include/cybozu/format.hpp +93 -0
  48. data/vendor/cybozulib/include/cybozu/frequency.hpp +264 -0
  49. data/vendor/cybozulib/include/cybozu/hash.hpp +67 -0
  50. data/vendor/cybozulib/include/cybozu/inttype.hpp +174 -0
  51. data/vendor/cybozulib/include/cybozu/itoa.hpp +336 -0
  52. data/vendor/cybozulib/include/cybozu/json.hpp +120 -0
  53. data/vendor/cybozulib/include/cybozu/line_stream.hpp +149 -0
  54. data/vendor/cybozulib/include/cybozu/link_libeay32.hpp +21 -0
  55. data/vendor/cybozulib/include/cybozu/link_mpir.hpp +18 -0
  56. data/vendor/cybozulib/include/cybozu/link_ssleay32.hpp +19 -0
  57. data/vendor/cybozulib/include/cybozu/log.hpp +237 -0
  58. data/vendor/cybozulib/include/cybozu/minixml.hpp +452 -0
  59. data/vendor/cybozulib/include/cybozu/mmap.hpp +143 -0
  60. data/vendor/cybozulib/include/cybozu/mutex.hpp +144 -0
  61. data/vendor/cybozulib/include/cybozu/nlp/mecab.hpp +96 -0
  62. data/vendor/cybozulib/include/cybozu/nlp/plsi.hpp +315 -0
  63. data/vendor/cybozulib/include/cybozu/nlp/random.hpp +74 -0
  64. data/vendor/cybozulib/include/cybozu/nlp/sparse.hpp +529 -0
  65. data/vendor/cybozulib/include/cybozu/nlp/svd.hpp +486 -0
  66. data/vendor/cybozulib/include/cybozu/nlp/tfidf.hpp +226 -0
  67. data/vendor/cybozulib/include/cybozu/nlp/top_score.hpp +75 -0
  68. data/vendor/cybozulib/include/cybozu/option.hpp +743 -0
  69. data/vendor/cybozulib/include/cybozu/parallel.hpp +88 -0
  70. data/vendor/cybozulib/include/cybozu/pcg.hpp +72 -0
  71. data/vendor/cybozulib/include/cybozu/process.hpp +324 -0
  72. data/vendor/cybozulib/include/cybozu/quit_signal_handler.hpp +66 -0
  73. data/vendor/cybozulib/include/cybozu/random_generator.hpp +144 -0
  74. data/vendor/cybozulib/include/cybozu/regex.hpp +463 -0
  75. data/vendor/cybozulib/include/cybozu/select8.hpp +279 -0
  76. data/vendor/cybozulib/include/cybozu/serializer.hpp +363 -0
  77. data/vendor/cybozulib/include/cybozu/sha1.hpp +209 -0
  78. data/vendor/cybozulib/include/cybozu/sha2.hpp +506 -0
  79. data/vendor/cybozulib/include/cybozu/siphash.hpp +105 -0
  80. data/vendor/cybozulib/include/cybozu/socket.hpp +785 -0
  81. data/vendor/cybozulib/include/cybozu/ssl.hpp +203 -0
  82. data/vendor/cybozulib/include/cybozu/stacktrace.hpp +291 -0
  83. data/vendor/cybozulib/include/cybozu/stream.hpp +269 -0
  84. data/vendor/cybozulib/include/cybozu/string.hpp +1746 -0
  85. data/vendor/cybozulib/include/cybozu/string_operation.hpp +365 -0
  86. data/vendor/cybozulib/include/cybozu/sucvector.hpp +378 -0
  87. data/vendor/cybozulib/include/cybozu/test.hpp +373 -0
  88. data/vendor/cybozulib/include/cybozu/thread.hpp +229 -0
  89. data/vendor/cybozulib/include/cybozu/time.hpp +281 -0
  90. data/vendor/cybozulib/include/cybozu/tls.hpp +115 -0
  91. data/vendor/cybozulib/include/cybozu/unordered_map.hpp +13 -0
  92. data/vendor/cybozulib/include/cybozu/unordered_set.hpp +13 -0
  93. data/vendor/cybozulib/include/cybozu/v128.hpp +376 -0
  94. data/vendor/cybozulib/include/cybozu/wavelet_matrix.hpp +345 -0
  95. data/vendor/cybozulib/include/cybozu/xorshift.hpp +189 -0
  96. data/vendor/cybozulib/include/cybozu/zlib.hpp +325 -0
  97. data/vendor/cybozulib/include/sais.hxx +364 -0
  98. data/vendor/cybozulib/misc/make_select8tbl.cpp +26 -0
  99. data/vendor/cybozulib/mk.bat +37 -0
  100. data/vendor/cybozulib/readme.md +29 -0
  101. data/vendor/cybozulib/release.props +12 -0
  102. data/vendor/cybozulib/sample/Makefile +30 -0
  103. data/vendor/cybozulib/sample/csucvector_smpl.cpp +42 -0
  104. data/vendor/cybozulib/sample/data/svd/org/test1.S +4 -0
  105. data/vendor/cybozulib/sample/data/svd/org/test1.U +4 -0
  106. data/vendor/cybozulib/sample/data/svd/org/test1.V +6 -0
  107. data/vendor/cybozulib/sample/data/svd/test1 +4 -0
  108. data/vendor/cybozulib/sample/data/svd/test2 +4 -0
  109. data/vendor/cybozulib/sample/desymbol.cpp +127 -0
  110. data/vendor/cybozulib/sample/exception_smpl.cpp +46 -0
  111. data/vendor/cybozulib/sample/fmindex_smpl.cpp +231 -0
  112. data/vendor/cybozulib/sample/log_smpl.cpp +19 -0
  113. data/vendor/cybozulib/sample/mecab_smpl.cpp +37 -0
  114. data/vendor/cybozulib/sample/option2_smpl.cpp +68 -0
  115. data/vendor/cybozulib/sample/option_smpl.cpp +42 -0
  116. data/vendor/cybozulib/sample/plsi_smpl.cpp +207 -0
  117. data/vendor/cybozulib/sample/proj/exception_smpl.vcproj +184 -0
  118. data/vendor/cybozulib/sample/proj/mecab_smpl.vcproj +184 -0
  119. data/vendor/cybozulib/sample/proj/ssl_smpl/ssl_smpl.vcxproj +85 -0
  120. data/vendor/cybozulib/sample/proj/ssl_smpl.vcproj +347 -0
  121. data/vendor/cybozulib/sample/proj/stacktrace_smpl/stacktrace_smpl.vcxproj +85 -0
  122. data/vendor/cybozulib/sample/proj/svd_smpl.vcproj +184 -0
  123. data/vendor/cybozulib/sample/quit_signal_handler.cpp +30 -0
  124. data/vendor/cybozulib/sample/serializer_smpl.cpp +196 -0
  125. data/vendor/cybozulib/sample/socket_smpl.cpp +82 -0
  126. data/vendor/cybozulib/sample/ssl_smpl.cpp +39 -0
  127. data/vendor/cybozulib/sample/stacktrace_smpl.cpp +52 -0
  128. data/vendor/cybozulib/sample/svd_bench_smpl.cpp +143 -0
  129. data/vendor/cybozulib/sample/svd_smpl.cpp +94 -0
  130. data/vendor/cybozulib/sample/wm_bench_smpl.cpp +182 -0
  131. data/vendor/cybozulib/sample/zlib_smpl.cpp +41 -0
  132. data/vendor/cybozulib/src/Makefile +8 -0
  133. data/vendor/cybozulib/src/base/Makefile +19 -0
  134. data/vendor/cybozulib/test/Makefile +12 -0
  135. data/vendor/cybozulib/test/base/Makefile +37 -0
  136. data/vendor/cybozulib/test/base/array_test.cpp +173 -0
  137. data/vendor/cybozulib/test/base/atoi_test.cpp +774 -0
  138. data/vendor/cybozulib/test/base/atomic_test.cpp +49 -0
  139. data/vendor/cybozulib/test/base/base64_test.cpp +113 -0
  140. data/vendor/cybozulib/test/base/bit_operation_test.cpp +134 -0
  141. data/vendor/cybozulib/test/base/bitvector_test.cpp +204 -0
  142. data/vendor/cybozulib/test/base/condition_variable_cs_test.cpp +92 -0
  143. data/vendor/cybozulib/test/base/condition_variable_test.cpp +88 -0
  144. data/vendor/cybozulib/test/base/config_test.cpp +236 -0
  145. data/vendor/cybozulib/test/base/crypto_test.cpp +122 -0
  146. data/vendor/cybozulib/test/base/csucvector_test.cpp +63 -0
  147. data/vendor/cybozulib/test/base/csv_test.cpp +182 -0
  148. data/vendor/cybozulib/test/base/data/a.xml +26 -0
  149. data/vendor/cybozulib/test/base/endian_test.cpp +56 -0
  150. data/vendor/cybozulib/test/base/env_test.cpp +22 -0
  151. data/vendor/cybozulib/test/base/event_test.cpp +41 -0
  152. data/vendor/cybozulib/test/base/file_test.cpp +233 -0
  153. data/vendor/cybozulib/test/base/fmindex_test.cpp +118 -0
  154. data/vendor/cybozulib/test/base/format_test.cpp +12 -0
  155. data/vendor/cybozulib/test/base/frequency_test.cpp +104 -0
  156. data/vendor/cybozulib/test/base/itoa_test.cpp +522 -0
  157. data/vendor/cybozulib/test/base/line_stream_test.cpp +208 -0
  158. data/vendor/cybozulib/test/base/mecab_test.cpp +41 -0
  159. data/vendor/cybozulib/test/base/minixml_test.cpp +103 -0
  160. data/vendor/cybozulib/test/base/mmap_test.cpp +15 -0
  161. data/vendor/cybozulib/test/base/option_test.cpp +487 -0
  162. data/vendor/cybozulib/test/base/parallel_test.cpp +48 -0
  163. data/vendor/cybozulib/test/base/proj/array_test/array_test.vcxproj +86 -0
  164. data/vendor/cybozulib/test/base/proj/atoi_test/atoi_test.vcxproj +86 -0
  165. data/vendor/cybozulib/test/base/proj/atomic_test/atomic_test.vcxproj +86 -0
  166. data/vendor/cybozulib/test/base/proj/base64_test/base64_test.vcxproj +86 -0
  167. data/vendor/cybozulib/test/base/proj/condition_variable_cs_test/condition_variable_cs_test.vcxproj +86 -0
  168. data/vendor/cybozulib/test/base/proj/condition_variable_test/condition_variable_test.vcxproj +86 -0
  169. data/vendor/cybozulib/test/base/proj/config_test/config_test.vcxproj +86 -0
  170. data/vendor/cybozulib/test/base/proj/csv_test/csv_test.vcxproj +86 -0
  171. data/vendor/cybozulib/test/base/proj/endian_test/endian_test.vcxproj +86 -0
  172. data/vendor/cybozulib/test/base/proj/env_test/env_test.vcxproj +86 -0
  173. data/vendor/cybozulib/test/base/proj/event_test/event_test.vcxproj +86 -0
  174. data/vendor/cybozulib/test/base/proj/file_test/file_test.vcxproj +86 -0
  175. data/vendor/cybozulib/test/base/proj/itoa_test/itoa_test.vcxproj +86 -0
  176. data/vendor/cybozulib/test/base/proj/mecab_test/mecab_test.vcxproj +88 -0
  177. data/vendor/cybozulib/test/base/proj/minixml_test/minixml_test.vcxproj +86 -0
  178. data/vendor/cybozulib/test/base/proj/mmap_test/mmap_test.vcxproj +86 -0
  179. data/vendor/cybozulib/test/base/proj/serializer_test/serializer_test.vcxproj +86 -0
  180. data/vendor/cybozulib/test/base/proj/sha1_test/sha1_test.vcxproj +86 -0
  181. data/vendor/cybozulib/test/base/proj/stream_test/stream_test.vcxproj +86 -0
  182. data/vendor/cybozulib/test/base/proj/string_operation_test/string_operation_test.vcxproj +86 -0
  183. data/vendor/cybozulib/test/base/proj/string_test/string_test.vcxproj +86 -0
  184. data/vendor/cybozulib/test/base/proj/thread_test/thread_test.vcxproj +86 -0
  185. data/vendor/cybozulib/test/base/proj/time_test/time_test.vcxproj +86 -0
  186. data/vendor/cybozulib/test/base/proj/tls_test/tls_test.vcxproj +86 -0
  187. data/vendor/cybozulib/test/base/proj/zlib_test/zlib_test.vcxproj +86 -0
  188. data/vendor/cybozulib/test/base/random_generator_test.cpp +28 -0
  189. data/vendor/cybozulib/test/base/regex_test.cpp +74 -0
  190. data/vendor/cybozulib/test/base/serializer_test.cpp +483 -0
  191. data/vendor/cybozulib/test/base/sha1_test.cpp +61 -0
  192. data/vendor/cybozulib/test/base/sha2_test.cpp +191 -0
  193. data/vendor/cybozulib/test/base/siphash_test.cpp +33 -0
  194. data/vendor/cybozulib/test/base/socket_test.cpp +76 -0
  195. data/vendor/cybozulib/test/base/stream_test.cpp +101 -0
  196. data/vendor/cybozulib/test/base/string_operation_test.cpp +340 -0
  197. data/vendor/cybozulib/test/base/string_test.cpp +1705 -0
  198. data/vendor/cybozulib/test/base/sucvector_test.cpp +312 -0
  199. data/vendor/cybozulib/test/base/thread_test.cpp +62 -0
  200. data/vendor/cybozulib/test/base/time_test.cpp +164 -0
  201. data/vendor/cybozulib/test/base/tls_test.cpp +50 -0
  202. data/vendor/cybozulib/test/base/wavelet_matrix_test.cpp +145 -0
  203. data/vendor/cybozulib/test/base/zlib_test.cpp +371 -0
  204. data/vendor/cybozulib/test/nlp/Makefile +27 -0
  205. data/vendor/cybozulib/test/nlp/proj/random_test.vcproj +184 -0
  206. data/vendor/cybozulib/test/nlp/proj/sparse_test.vcproj +184 -0
  207. data/vendor/cybozulib/test/nlp/proj/svd_test.vcproj +184 -0
  208. data/vendor/cybozulib/test/nlp/random_test.cpp +62 -0
  209. data/vendor/cybozulib/test/nlp/sparse_test.cpp +347 -0
  210. data/vendor/cybozulib/test/nlp/svd_test.cpp +234 -0
  211. data/vendor/cybozulib/test/nlp/top_score_test.cpp +40 -0
  212. data/vendor/cybozulib/tool/create_vcproj.py +186 -0
  213. data/vendor/cybozulib/tool/vcproj_tmpl.py +185 -0
  214. data/vendor/msoffice/COPYRIGHT +27 -0
  215. data/vendor/msoffice/Makefile +29 -0
  216. data/vendor/msoffice/bin/64/msoc.dll +0 -0
  217. data/vendor/msoffice/bin/64/msocsample.exe +0 -0
  218. data/vendor/msoffice/bin/64/msoffice-crypt.exe +0 -0
  219. data/vendor/msoffice/bin/msoc.dll +0 -0
  220. data/vendor/msoffice/bin/msocsample.exe +0 -0
  221. data/vendor/msoffice/bin/msoffice-crypt.exe +0 -0
  222. data/vendor/msoffice/common.mk +71 -0
  223. data/vendor/msoffice/common.props +26 -0
  224. data/vendor/msoffice/debug.props +14 -0
  225. data/vendor/msoffice/include/attack.hpp +211 -0
  226. data/vendor/msoffice/include/cfb.hpp +777 -0
  227. data/vendor/msoffice/include/crypto_util.hpp +450 -0
  228. data/vendor/msoffice/include/custom_sha1.hpp +342 -0
  229. data/vendor/msoffice/include/decode.hpp +240 -0
  230. data/vendor/msoffice/include/encode.hpp +221 -0
  231. data/vendor/msoffice/include/make_dataspace.hpp +316 -0
  232. data/vendor/msoffice/include/msoc.h +129 -0
  233. data/vendor/msoffice/include/resource.hpp +7 -0
  234. data/vendor/msoffice/include/standard_encryption.hpp +145 -0
  235. data/vendor/msoffice/include/uint32vec.hpp +179 -0
  236. data/vendor/msoffice/include/util.hpp +212 -0
  237. data/vendor/msoffice/lib/.emptydir +0 -0
  238. data/vendor/msoffice/misc/decrypt-xls.vbs +46 -0
  239. data/vendor/msoffice/mk.bat +1 -0
  240. data/vendor/msoffice/mkdll.bat +3 -0
  241. data/vendor/msoffice/msoc.def +13 -0
  242. data/vendor/msoffice/msocsample.py +178 -0
  243. data/vendor/msoffice/msoffice12.sln +31 -0
  244. data/vendor/msoffice/readme.md +110 -0
  245. data/vendor/msoffice/release.props +28 -0
  246. data/vendor/msoffice/src/Makefile +19 -0
  247. data/vendor/msoffice/src/attack.cpp +124 -0
  248. data/vendor/msoffice/src/cfb_test.cpp +77 -0
  249. data/vendor/msoffice/src/minisample.c +54 -0
  250. data/vendor/msoffice/src/msocdll.cpp +276 -0
  251. data/vendor/msoffice/src/msocsample.c +136 -0
  252. data/vendor/msoffice/src/msoffice-crypt.cpp +219 -0
  253. data/vendor/msoffice/src/proj/attack/attack.vcxproj +88 -0
  254. data/vendor/msoffice/src/proj/main/msoffice-crypt.vcxproj +88 -0
  255. data/vendor/msoffice/src/sha1.cpp +234 -0
  256. data/vendor/msoffice/test/Makefile +20 -0
  257. data/vendor/msoffice/test/cfb_test.cpp +74 -0
  258. data/vendor/msoffice/test/hash_test.cpp +59 -0
  259. data/vendor/msoffice/test/proj/cfb/cfb_test.vcxproj +90 -0
  260. data/vendor/msoffice/test/proj/hash/hash_test.vcxproj +90 -0
  261. data/vendor/msoffice/test/sampl.bat +8 -0
  262. data/vendor/msoffice/test_all.py +46 -0
  263. data/vendor/update +4 -0
  264. metadata +351 -0
@@ -0,0 +1,487 @@
1
+ #include <cybozu/option.hpp>
2
+ #include <cybozu/test.hpp>
3
+
4
+ const char progName[] = "test";
5
+
6
+ CYBOZU_TEST_AUTO(convert_int)
7
+ {
8
+ struct {
9
+ const char *str;
10
+ int val;
11
+ bool valid;
12
+ } tbl[] = {
13
+ { "123", 123, true },
14
+ { "-52145", -52145, true },
15
+ { "2147483647", 2147483647, true },
16
+ { "-2147483648", -2147483647 - 1, true },
17
+ { "2147483648", 0, false },
18
+ { "-2147483649", 0, false },
19
+ { "1k", 1000, true },
20
+ { "-1k", -1000, true },
21
+ { "2K", 2048, true },
22
+ { "1m", 1000000, true },
23
+ { "1M", 1024 * 1024, true },
24
+ { "1g", 1000000000, true },
25
+ { "1G", 1024 * 1024 * 1024, true },
26
+ { "2g", 2000000000, true },
27
+ { "2G", 0, false },
28
+ { "-2G", -1024 * 1024 * 1024 * 2, true },
29
+ { "0x123", 0x123, true },
30
+ };
31
+ for (size_t i = 0; i < CYBOZU_NUM_OF_ARRAY(tbl); i++) {
32
+ int x;
33
+ bool b = cybozu::option_local::convertInt(&x, tbl[i].str);
34
+ CYBOZU_TEST_EQUAL(b, tbl[i].valid);
35
+ if (b) {
36
+ CYBOZU_TEST_EQUAL(x, tbl[i].val);
37
+ }
38
+ }
39
+ }
40
+
41
+ CYBOZU_TEST_AUTO(convert_uint)
42
+ {
43
+ struct {
44
+ const char *str;
45
+ uint32_t val;
46
+ bool valid;
47
+ } tbl[] = {
48
+ { "123", 123, true },
49
+ { "2147483647", 2147483647, true },
50
+ { "2147483648", 2147483648U, true },
51
+ { "4294967295", 4294967295U, true },
52
+ { "4294967296", 0, false },
53
+ { "-5", 0, false },
54
+ { "1m", 1000000, true },
55
+ { "1M", 1024 * 1024, true },
56
+ { "1g", 1000000000, true },
57
+ { "1G", 1024 * 1024 * 1024, true },
58
+ { "2g", 2000000000, true },
59
+ { "2G", 1024U * 1024 * 1024 * 2, true },
60
+ { "3G", 1024U * 1024 * 1024 * 3, true },
61
+ { "4G", 0, false },
62
+ };
63
+ for (size_t i = 0; i < CYBOZU_NUM_OF_ARRAY(tbl); i++) {
64
+ uint32_t x;
65
+ bool b = cybozu::option_local::convertInt(&x, tbl[i].str);
66
+ CYBOZU_TEST_EQUAL(b, tbl[i].valid);
67
+ if (b) {
68
+ CYBOZU_TEST_EQUAL(x, tbl[i].val);
69
+ }
70
+ }
71
+ }
72
+
73
+ CYBOZU_TEST_AUTO(convert_int64_t)
74
+ {
75
+ struct {
76
+ const char *str;
77
+ int64_t val;
78
+ bool valid;
79
+ } tbl[] = {
80
+ { "123", 123, true },
81
+ { "-52145", -52145, true },
82
+ { "2147483647", 2147483647, true },
83
+ { "-2147483648", -2147483647 - 1, true },
84
+ { "9223372036854775807", int64_t(9223372036854775807LL), true },
85
+ { "9223372036854775808", 0, false },
86
+ { "1k", 1000, true },
87
+ { "-1k", -1000, true },
88
+ { "2K", 2048, true },
89
+ { "1m", 1000000, true },
90
+ { "1M", 1024 * 1024, true },
91
+ { "1g", 1000000000, true },
92
+ { "1G", 1024 * 1024 * 1024, true },
93
+ { "-2G", -1024 * 1024 * 1024 * 2, true },
94
+ { "8589934591G", int64_t(9223372035781033984LL), true },
95
+ { "8589934592G", 0, false },
96
+ { "-8589934592G", int64_t(-9223372036854775807LL - 1), true },
97
+ };
98
+ for (size_t i = 0; i < CYBOZU_NUM_OF_ARRAY(tbl); i++) {
99
+ int64_t x;
100
+ bool b = cybozu::option_local::convertInt(&x, tbl[i].str);
101
+ CYBOZU_TEST_EQUAL(b, tbl[i].valid);
102
+ if (b) {
103
+ CYBOZU_TEST_EQUAL(x, tbl[i].val);
104
+ }
105
+ }
106
+ }
107
+
108
+ CYBOZU_TEST_AUTO(convert_uint64_t)
109
+ {
110
+ struct {
111
+ const char *str;
112
+ uint64_t val;
113
+ bool valid;
114
+ } tbl[] = {
115
+ { "123", 123, true },
116
+ { "-52145", 0, false },
117
+ { "18446744073709551615", uint64_t(18446744073709551615ULL), true },
118
+ { "18446744073709551616", 0, false },
119
+ { "1k", 1000, true },
120
+ { "2K", 2048, true },
121
+ { "1m", 1000000, true },
122
+ { "1M", 1024 * 1024, true },
123
+ { "1g", 1000000000, true },
124
+ { "1G", 1024 * 1024 * 1024, true },
125
+ { "17179869183G", uint64_t(18446744072635809792ULL), true },
126
+ { "17179869184G", 0, false },
127
+ };
128
+ for (size_t i = 0; i < CYBOZU_NUM_OF_ARRAY(tbl); i++) {
129
+ uint64_t x;
130
+ bool b = cybozu::option_local::convertInt(&x, tbl[i].str);
131
+ CYBOZU_TEST_EQUAL(b, tbl[i].valid);
132
+ if (b) {
133
+ CYBOZU_TEST_EQUAL(x, tbl[i].val);
134
+ }
135
+ }
136
+ }
137
+
138
+ CYBOZU_TEST_AUTO(Var)
139
+ {
140
+ {
141
+ int x = 3;
142
+ cybozu::option_local::Var v(&x);
143
+ CYBOZU_TEST_ASSERT(!v.isSet());
144
+ v.set("12345");
145
+ CYBOZU_TEST_EQUAL(x, 12345);
146
+ CYBOZU_TEST_EQUAL(v.toStr(), "12345");
147
+ CYBOZU_TEST_ASSERT(v.isSet());
148
+ v.set("333");
149
+ CYBOZU_TEST_EQUAL(x, 333);
150
+ cybozu::option_local::Var w;
151
+ CYBOZU_TEST_ASSERT(!w.isSet());
152
+ CYBOZU_TEST_EQUAL(w.toStr(), "");
153
+ w.swap(v);
154
+ CYBOZU_TEST_ASSERT(w.isSet());
155
+ CYBOZU_TEST_EQUAL(w.toStr(), "333");
156
+ CYBOZU_TEST_ASSERT(!v.isSet());
157
+ CYBOZU_TEST_EQUAL(v.toStr(), "");
158
+ }
159
+ {
160
+ double x = 2;
161
+ cybozu::option_local::Var v(&x);
162
+ CYBOZU_TEST_ASSERT(!v.isSet());
163
+ v.set("2.345");
164
+ CYBOZU_TEST_EQUAL(x, 2.345);
165
+ CYBOZU_TEST_EQUAL(v.toStr(), "2.345");
166
+ CYBOZU_TEST_ASSERT(v.isSet());
167
+ }
168
+ {
169
+ std::string x = "123";
170
+ cybozu::option_local::Var v(&x);
171
+ CYBOZU_TEST_ASSERT(!v.isSet());
172
+ v.set("2.345");
173
+ CYBOZU_TEST_EQUAL(x, "2.345");
174
+ CYBOZU_TEST_EQUAL(v.toStr(), "2.345");
175
+ CYBOZU_TEST_ASSERT(v.isSet());
176
+ }
177
+ {
178
+ std::string x;
179
+ cybozu::option_local::Var v(&x);
180
+ CYBOZU_TEST_ASSERT(!v.isSet());
181
+ v.set("1 23 456");
182
+ CYBOZU_TEST_EQUAL(x, "1 23 456");
183
+ CYBOZU_TEST_EQUAL(v.toStr(), "1 23 456");
184
+ CYBOZU_TEST_ASSERT(v.isSet());
185
+ }
186
+ {
187
+ bool x = false;
188
+ cybozu::option_local::Var v(&x);
189
+ CYBOZU_TEST_ASSERT(!v.isSet());
190
+ v.set("1");
191
+ CYBOZU_TEST_ASSERT(x);
192
+ CYBOZU_TEST_EQUAL(v.toStr(), "1");
193
+ CYBOZU_TEST_ASSERT(v.isSet());
194
+ v.set("0");
195
+ CYBOZU_TEST_ASSERT(!x);
196
+ CYBOZU_TEST_EQUAL(v.toStr(), "0");
197
+ }
198
+ {
199
+ char x = 0;
200
+ cybozu::option_local::Var v(&x);
201
+ CYBOZU_TEST_ASSERT(!v.isSet());
202
+ v.set("a");
203
+ CYBOZU_TEST_EQUAL(x, 'a');
204
+ CYBOZU_TEST_EQUAL(v.toStr(), "a");
205
+ CYBOZU_TEST_ASSERT(v.isSet());
206
+ }
207
+ {
208
+ int8_t x = 0;
209
+ cybozu::option_local::Var v(&x);
210
+ CYBOZU_TEST_ASSERT(!v.isSet());
211
+ v.set("9");
212
+ CYBOZU_TEST_EQUAL(x, 9);
213
+ CYBOZU_TEST_EQUAL(v.toStr(), "9");
214
+ CYBOZU_TEST_ASSERT(v.isSet());
215
+ }
216
+ {
217
+ uint8_t x = 0;
218
+ cybozu::option_local::Var v(&x);
219
+ CYBOZU_TEST_ASSERT(!v.isSet());
220
+ v.set("255");
221
+ CYBOZU_TEST_EQUAL(x, 255);
222
+ CYBOZU_TEST_EQUAL(v.toStr(), "255");
223
+ CYBOZU_TEST_ASSERT(v.isSet());
224
+ }
225
+ {
226
+ std::vector<int> x;
227
+ cybozu::option_local::Var v(&x);
228
+ CYBOZU_TEST_ASSERT(!v.isSet());
229
+ v.set("5");
230
+ v.set("1234");
231
+ CYBOZU_TEST_EQUAL(x.size(), 2u);
232
+ CYBOZU_TEST_EQUAL(x[0], 5);
233
+ CYBOZU_TEST_EQUAL(x[1], 1234);
234
+ CYBOZU_TEST_EQUAL(v.toStr(), "5 1234");
235
+ CYBOZU_TEST_ASSERT(v.isSet());
236
+ }
237
+ }
238
+
239
+ CYBOZU_TEST_AUTO(appendOpt)
240
+ {
241
+ cybozu::Option opt;
242
+ int x;
243
+ opt.appendOpt(&x, 3, "x");
244
+ {
245
+ const char *argv[] = { progName };
246
+ CYBOZU_TEST_ASSERT(opt.parse(1, argv));
247
+ CYBOZU_TEST_EQUAL(x, 3);
248
+ CYBOZU_TEST_ASSERT(!opt.isSet(&x));
249
+ }
250
+ {
251
+ const char optX[] = "-x";
252
+ const char i999[] = "999";
253
+ const char *argv[] = { progName, optX, i999 };
254
+ CYBOZU_TEST_ASSERT(opt.parse(3, argv));
255
+ CYBOZU_TEST_EQUAL(x, 999);
256
+ CYBOZU_TEST_ASSERT(opt.isSet(&x));
257
+ }
258
+ }
259
+
260
+ CYBOZU_TEST_AUTO(appendOpt_bool)
261
+ {
262
+ bool b = true;
263
+ cybozu::Option opt;
264
+ opt.appendOpt(&b, false, "b");
265
+ CYBOZU_TEST_ASSERT(!b);
266
+ {
267
+ const char *argv[] = { progName };
268
+ CYBOZU_TEST_ASSERT(opt.parse(1, argv));
269
+ CYBOZU_TEST_ASSERT(!b);
270
+ CYBOZU_TEST_ASSERT(!opt.isSet(&b));
271
+ }
272
+ {
273
+ const char *argv[] = { progName, "-b", "0" };
274
+ CYBOZU_TEST_ASSERT(opt.parse(3, argv));
275
+ CYBOZU_TEST_ASSERT(!b);
276
+ CYBOZU_TEST_ASSERT(opt.isSet(&b));
277
+ }
278
+ {
279
+ const char *argv[] = { progName, "-b", "1" };
280
+ CYBOZU_TEST_ASSERT(opt.parse(3, argv));
281
+ CYBOZU_TEST_ASSERT(b);
282
+ CYBOZU_TEST_ASSERT(opt.isSet(&b));
283
+ }
284
+ }
285
+
286
+ CYBOZU_TEST_AUTO(appendBoolOpt)
287
+ {
288
+ cybozu::Option opt;
289
+ bool b;
290
+ opt.appendBoolOpt(&b, "b");
291
+ CYBOZU_TEST_ASSERT(!b);
292
+ {
293
+ const char *argv[] = { progName };
294
+ CYBOZU_TEST_ASSERT(opt.parse(1, argv));
295
+ CYBOZU_TEST_ASSERT(!b);
296
+ CYBOZU_TEST_ASSERT(!opt.isSet(&b));
297
+ }
298
+ {
299
+ const char *argv[] = { progName, "-b" };
300
+ CYBOZU_TEST_ASSERT(opt.parse(2, argv));
301
+ CYBOZU_TEST_ASSERT(b);
302
+ CYBOZU_TEST_ASSERT(opt.isSet(&b));
303
+ }
304
+ }
305
+
306
+ CYBOZU_TEST_AUTO(appendMust)
307
+ {
308
+ cybozu::Option opt;
309
+ int x = 9;
310
+ opt.appendMust(&x, "x");
311
+ {
312
+ const char *argv[] = { progName };
313
+ CYBOZU_TEST_ASSERT(!opt.parse(1, argv));
314
+ CYBOZU_TEST_ASSERT(!opt.isSet(&x));
315
+ }
316
+ {
317
+ const char optX[] = "-x";
318
+ const char i999[] = "999";
319
+ const char *argv[] = { progName, optX, i999 };
320
+ CYBOZU_TEST_ASSERT(opt.parse(3, argv));
321
+ CYBOZU_TEST_EQUAL(x, 999);
322
+ CYBOZU_TEST_ASSERT(opt.isSet(&x));
323
+ }
324
+ }
325
+
326
+ CYBOZU_TEST_AUTO(appendVec)
327
+ {
328
+ cybozu::Option opt;
329
+ std::vector<int> x;
330
+ opt.appendVec(&x, "x");
331
+ {
332
+ const char *argv[] = { progName };
333
+ CYBOZU_TEST_ASSERT(opt.parse(1, argv));
334
+ CYBOZU_TEST_ASSERT(x.empty());
335
+ CYBOZU_TEST_ASSERT(!opt.isSet(&x));
336
+ }
337
+ {
338
+ const char optX[] = "-x";
339
+ const char i999[] = "999";
340
+ const char i123[] = "123";
341
+ const char *argv[] = { progName, optX, i999, i123 };
342
+ CYBOZU_TEST_ASSERT(opt.parse(4, argv));
343
+ CYBOZU_TEST_EQUAL(x.size(), 2u);
344
+ CYBOZU_TEST_EQUAL(x[0], 999);
345
+ CYBOZU_TEST_EQUAL(x[1], 123);
346
+ CYBOZU_TEST_ASSERT(opt.isSet(&x));
347
+ }
348
+ }
349
+
350
+ CYBOZU_TEST_AUTO(appendParam)
351
+ {
352
+ cybozu::Option opt;
353
+ std::string x;
354
+ opt.appendParam(&x, "x");
355
+ {
356
+ const char *argv[] = { progName };
357
+ CYBOZU_TEST_ASSERT(!opt.parse(1, argv));
358
+ CYBOZU_TEST_ASSERT(!opt.isSet(&x));
359
+ }
360
+ {
361
+ const char aaa[] = "aaa";
362
+ const char *argv[] = { progName, aaa };
363
+ CYBOZU_TEST_ASSERT(opt.parse(2, argv));
364
+ CYBOZU_TEST_EQUAL(x, "aaa");
365
+ CYBOZU_TEST_ASSERT(opt.isSet(&x));
366
+ }
367
+ }
368
+
369
+ CYBOZU_TEST_AUTO(appendParamOpt)
370
+ {
371
+ cybozu::Option opt;
372
+ std::string x;
373
+ opt.appendParamOpt(&x, "", "x");
374
+ {
375
+ const char *argv[] = { progName };
376
+ CYBOZU_TEST_ASSERT(opt.parse(1, argv));
377
+ CYBOZU_TEST_ASSERT(x.empty());
378
+ CYBOZU_TEST_ASSERT(!opt.isSet(&x));
379
+ }
380
+ {
381
+ const char aaa[] = "aaa";
382
+ const char *argv[] = { progName, aaa };
383
+ CYBOZU_TEST_ASSERT(opt.parse(2, argv));
384
+ CYBOZU_TEST_EQUAL(x, "aaa");
385
+ CYBOZU_TEST_ASSERT(opt.isSet(&x));
386
+ }
387
+ }
388
+
389
+ CYBOZU_TEST_AUTO(appendParamVec)
390
+ {
391
+ cybozu::Option opt;
392
+ std::vector<char> x;
393
+ opt.appendParamVec(&x, "x");
394
+ {
395
+ const char *argv[] = { progName };
396
+ CYBOZU_TEST_ASSERT(opt.parse(1, argv));
397
+ CYBOZU_TEST_ASSERT(x.empty());
398
+ CYBOZU_TEST_ASSERT(!opt.isSet(&x));
399
+ }
400
+ {
401
+ const char a[] = "a";
402
+ const char z[] = "z";
403
+ const char *argv[] = { progName, a, z };
404
+ CYBOZU_TEST_ASSERT(opt.parse(3, argv));
405
+ CYBOZU_TEST_EQUAL(x.size(), 2u);
406
+ CYBOZU_TEST_EQUAL(x[0], 'a');
407
+ CYBOZU_TEST_EQUAL(x[1], 'z');
408
+ CYBOZU_TEST_ASSERT(opt.isSet(&x));
409
+ }
410
+ }
411
+
412
+ // forbitten duplicate opt
413
+ CYBOZU_TEST_AUTO(duplicateOpt)
414
+ {
415
+ cybozu::Option opt;
416
+ int x;
417
+ int y;
418
+ opt.appendMust(&x, "x");
419
+ CYBOZU_TEST_EXCEPTION(opt.appendMust(&y, "x"), cybozu::Exception);
420
+ }
421
+
422
+ // permit duplicate var
423
+ CYBOZU_TEST_AUTO(duplicateVar)
424
+ {
425
+ cybozu::Option opt;
426
+ int x;
427
+ opt.appendMust(&x, "z");
428
+ CYBOZU_TEST_NO_EXCEPTION(opt.appendMust(&x, "-zero"));
429
+ }
430
+
431
+ CYBOZU_TEST_AUTO(appendParamErr)
432
+ {
433
+ cybozu::Option opt;
434
+ int x;
435
+ int y;
436
+ std::vector<int> z;
437
+ opt.appendParamOpt(&x, 3, "x");
438
+ CYBOZU_TEST_EXCEPTION(opt.appendParam(&y, "y"), cybozu::Exception);
439
+ CYBOZU_TEST_EXCEPTION(opt.appendParamVec(&z, "z"), cybozu::Exception);
440
+ }
441
+
442
+ CYBOZU_TEST_AUTO(opt_begin_with_not_a_number)
443
+ {
444
+ cybozu::Option opt;
445
+ int x;
446
+ // opt can't srat number
447
+ CYBOZU_TEST_EXCEPTION(opt.appendOpt(&x, 9, "3a"), cybozu::Exception);
448
+ }
449
+
450
+ CYBOZU_TEST_AUTO(isSet)
451
+ {
452
+ {
453
+ cybozu::Option opt;
454
+ int x;
455
+ opt.appendOpt(&x, 3, "x");
456
+ const char *argv[] = { progName };
457
+ CYBOZU_TEST_ASSERT(opt.parse(1, argv));
458
+ CYBOZU_TEST_ASSERT(!opt.isSet(&x));
459
+ int y;
460
+ CYBOZU_TEST_EXCEPTION(opt.isSet(&y), cybozu::Exception);
461
+ }
462
+ }
463
+
464
+ CYBOZU_TEST_AUTO(delimiter)
465
+ {
466
+ cybozu::Option opt;
467
+ int x;
468
+ opt.appendOpt(&x, 3, "x");
469
+ typedef std::vector<std::string> StrVec;
470
+ StrVec remain;
471
+ StrVec remainAfterDelim;
472
+ opt.appendParamVec(&remain, "remain str");
473
+ opt.setDelimiter("---", &remainAfterDelim);
474
+
475
+ const char *argv[] = { progName, "-x", "123", "abc", "ccc", "---", "xyz", "XXX" };
476
+
477
+ CYBOZU_TEST_ASSERT(opt.parse((int)CYBOZU_NUM_OF_ARRAY(argv), argv));
478
+ CYBOZU_TEST_ASSERT(opt.isSet(&x));
479
+ CYBOZU_TEST_EQUAL(x, 123);
480
+ CYBOZU_TEST_EQUAL(remain.size(), 2);
481
+ CYBOZU_TEST_EQUAL(remain[0], "abc");
482
+ CYBOZU_TEST_EQUAL(remain[1], "ccc");
483
+ CYBOZU_TEST_EQUAL(opt.getNextPositionOfDelimiter(), 6);
484
+ CYBOZU_TEST_EQUAL(remainAfterDelim.size(), 2);
485
+ CYBOZU_TEST_EQUAL(remainAfterDelim[0], "xyz");
486
+ CYBOZU_TEST_EQUAL(remainAfterDelim[1], "XXX");
487
+ }
@@ -0,0 +1,48 @@
1
+ #include <stdio.h>
2
+ #include <cybozu/parallel.hpp>
3
+ #include <cybozu/test.hpp>
4
+ #include <cybozu/time.hpp>
5
+ #include <math.h>
6
+
7
+ struct X {
8
+ int x;
9
+ int processedNum;
10
+ X()
11
+ : x(0)
12
+ , processedNum(0)
13
+ {
14
+ }
15
+ bool operator()(int idx, int /*threadIdx*/)
16
+ {
17
+ double ret = 0;
18
+ const int N = 1000;
19
+ for (int i = 0; i < N; i++) {
20
+ ret += sin(double(i) / N) * idx;
21
+ }
22
+ cybozu::AtomicAdd(&processedNum, 1);
23
+ cybozu::AtomicAdd(&x, (int)ret);
24
+ return true;
25
+ }
26
+ };
27
+
28
+ void test(int n, int threadNum)
29
+ {
30
+ X x;
31
+ cybozu::parallel_for(x, n, threadNum);
32
+ CYBOZU_TEST_EQUAL(x.processedNum, n);
33
+ }
34
+
35
+ CYBOZU_TEST_AUTO(parallel)
36
+ try
37
+ {
38
+ for (int threadNum = 1; threadNum < 8; threadNum++) {
39
+ printf("threadNum=%d\n", threadNum);
40
+ double begin = cybozu::GetCurrentTimeSec();
41
+ for (int n = 1; n < 100; n += 10) {
42
+ test(n, threadNum);
43
+ }
44
+ printf("time %f\n", cybozu::GetCurrentTimeSec() - begin);
45
+ }
46
+ } catch (std::exception& e) {
47
+ printf("err %s\n", e.what());
48
+ }
@@ -0,0 +1,86 @@
1
+ ����<?xml version="1.0" encoding="utf-8"?>
2
+ <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <ItemGroup Label="ProjectConfigurations">
4
+ <ProjectConfiguration Include="Debug|x64">
5
+ <Configuration>Debug</Configuration>
6
+ <Platform>x64</Platform>
7
+ </ProjectConfiguration>
8
+ <ProjectConfiguration Include="Release|x64">
9
+ <Configuration>Release</Configuration>
10
+ <Platform>x64</Platform>
11
+ </ProjectConfiguration>
12
+ </ItemGroup>
13
+ <PropertyGroup Label="Globals">
14
+ <ProjectGuid>{C91C3371-DFAD-4882-A4F4-E246FBB70933}</ProjectGuid>
15
+ <Keyword>Win32Proj</Keyword>
16
+ <RootNamespace>ec_test</RootNamespace>
17
+ </PropertyGroup>
18
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
19
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
20
+ <ConfigurationType>Application</ConfigurationType>
21
+ <UseDebugLibraries>true</UseDebugLibraries>
22
+ <PlatformToolset>v110</PlatformToolset>
23
+ <CharacterSet>MultiByte</CharacterSet>
24
+ </PropertyGroup>
25
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
26
+ <ConfigurationType>Application</ConfigurationType>
27
+ <UseDebugLibraries>false</UseDebugLibraries>
28
+ <PlatformToolset>v110</PlatformToolset>
29
+ <WholeProgramOptimization>true</WholeProgramOptimization>
30
+ <CharacterSet>MultiByte</CharacterSet>
31
+ </PropertyGroup>
32
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
33
+ <ImportGroup Label="ExtensionSettings">
34
+ </ImportGroup>
35
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
36
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
37
+ <Import Project="$(SolutionDir)common.props" />
38
+ <Import Project="$(SolutionDir)debug.props" />
39
+ </ImportGroup>
40
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
41
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
42
+ <Import Project="$(SolutionDir)common.props" />
43
+ <Import Project="$(SolutionDir)release.props" />
44
+ </ImportGroup>
45
+ <PropertyGroup Label="UserMacros" />
46
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
47
+ <LinkIncremental>true</LinkIncremental>
48
+ </PropertyGroup>
49
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
50
+ <LinkIncremental>false</LinkIncremental>
51
+ </PropertyGroup>
52
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
53
+ <ClCompile>
54
+ <PrecompiledHeader>
55
+ </PrecompiledHeader>
56
+ <Optimization>Disabled</Optimization>
57
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
58
+ </ClCompile>
59
+ <Link>
60
+ <SubSystem>Console</SubSystem>
61
+ <GenerateDebugInformation>true</GenerateDebugInformation>
62
+ </Link>
63
+ </ItemDefinitionGroup>
64
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
65
+ <ClCompile>
66
+ <PrecompiledHeader>
67
+ </PrecompiledHeader>
68
+ <Optimization>MaxSpeed</Optimization>
69
+ <FunctionLevelLinking>true</FunctionLevelLinking>
70
+ <IntrinsicFunctions>true</IntrinsicFunctions>
71
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
72
+ </ClCompile>
73
+ <Link>
74
+ <SubSystem>Console</SubSystem>
75
+ <GenerateDebugInformation>true</GenerateDebugInformation>
76
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
77
+ <OptimizeReferences>true</OptimizeReferences>
78
+ </Link>
79
+ </ItemDefinitionGroup>
80
+ <ItemGroup>
81
+ <ClCompile Include="$(SolutionDir)test\base\array_test.cpp" />
82
+ </ItemGroup>
83
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
84
+ <ImportGroup Label="ExtensionTargets">
85
+ </ImportGroup>
86
+ </Project>
@@ -0,0 +1,86 @@
1
+ ����<?xml version="1.0" encoding="utf-8"?>
2
+ <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <ItemGroup Label="ProjectConfigurations">
4
+ <ProjectConfiguration Include="Debug|x64">
5
+ <Configuration>Debug</Configuration>
6
+ <Platform>x64</Platform>
7
+ </ProjectConfiguration>
8
+ <ProjectConfiguration Include="Release|x64">
9
+ <Configuration>Release</Configuration>
10
+ <Platform>x64</Platform>
11
+ </ProjectConfiguration>
12
+ </ItemGroup>
13
+ <PropertyGroup Label="Globals">
14
+ <ProjectGuid>{E11F981F-9271-4565-AEAE-64EAE6635F1D}</ProjectGuid>
15
+ <Keyword>Win32Proj</Keyword>
16
+ <RootNamespace>ec_test</RootNamespace>
17
+ </PropertyGroup>
18
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
19
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
20
+ <ConfigurationType>Application</ConfigurationType>
21
+ <UseDebugLibraries>true</UseDebugLibraries>
22
+ <PlatformToolset>v110</PlatformToolset>
23
+ <CharacterSet>MultiByte</CharacterSet>
24
+ </PropertyGroup>
25
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
26
+ <ConfigurationType>Application</ConfigurationType>
27
+ <UseDebugLibraries>false</UseDebugLibraries>
28
+ <PlatformToolset>v110</PlatformToolset>
29
+ <WholeProgramOptimization>true</WholeProgramOptimization>
30
+ <CharacterSet>MultiByte</CharacterSet>
31
+ </PropertyGroup>
32
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
33
+ <ImportGroup Label="ExtensionSettings">
34
+ </ImportGroup>
35
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
36
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
37
+ <Import Project="$(SolutionDir)common.props" />
38
+ <Import Project="$(SolutionDir)debug.props" />
39
+ </ImportGroup>
40
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
41
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
42
+ <Import Project="$(SolutionDir)common.props" />
43
+ <Import Project="$(SolutionDir)release.props" />
44
+ </ImportGroup>
45
+ <PropertyGroup Label="UserMacros" />
46
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
47
+ <LinkIncremental>true</LinkIncremental>
48
+ </PropertyGroup>
49
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
50
+ <LinkIncremental>false</LinkIncremental>
51
+ </PropertyGroup>
52
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
53
+ <ClCompile>
54
+ <PrecompiledHeader>
55
+ </PrecompiledHeader>
56
+ <Optimization>Disabled</Optimization>
57
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
58
+ </ClCompile>
59
+ <Link>
60
+ <SubSystem>Console</SubSystem>
61
+ <GenerateDebugInformation>true</GenerateDebugInformation>
62
+ </Link>
63
+ </ItemDefinitionGroup>
64
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
65
+ <ClCompile>
66
+ <PrecompiledHeader>
67
+ </PrecompiledHeader>
68
+ <Optimization>MaxSpeed</Optimization>
69
+ <FunctionLevelLinking>true</FunctionLevelLinking>
70
+ <IntrinsicFunctions>true</IntrinsicFunctions>
71
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
72
+ </ClCompile>
73
+ <Link>
74
+ <SubSystem>Console</SubSystem>
75
+ <GenerateDebugInformation>true</GenerateDebugInformation>
76
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
77
+ <OptimizeReferences>true</OptimizeReferences>
78
+ </Link>
79
+ </ItemDefinitionGroup>
80
+ <ItemGroup>
81
+ <ClCompile Include="$(SolutionDir)test\base\atoi_test.cpp" />
82
+ </ItemGroup>
83
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
84
+ <ImportGroup Label="ExtensionTargets">
85
+ </ImportGroup>
86
+ </Project>