aboutsummaryrefslogtreecommitdiff
path: root/src/unittest/test_utilities.cpp
Commit message (Collapse)AuthorAge
* Add server side ncurses terminalest312015-11-06
| | | | | | | | | | | | | | | | | | | | | | | | This adds a chat console the server owner can use for administration or to talk with players. It runs in its own thread, which makes the user interface immune to the server's lag, behaving just like a client, except timeout. As it uses the same console code as the f10 console, things like nick completion or a scroll buffer basically come for free. The terminal itself is written in a general way so that adding a client version later on is just about implementing an interface. Fatal errors are printed after the console exists and the ncurses terminal buffer gets cleaned up with endwin(), so that the error still remains visible. The server owner can chose their username their entered text will have in chat and where players can send PMs to. Once the username is secured with a password to prevent anybody to take over the server, the owner can execute admin tasks over the console. This change includes a contribution by @kahrl who has improved ncurses library detection.
* Define and use limit constants for Irrlicht fixed-width typeskwolekr2015-10-04
|
* Fix wrap_rows at inner byte of multibyte sequencefigec2015-06-18
| | | | Also fix UTF-8 inner byte bounds and make unittest for case this fixes.
* Make wrap_rows not wrap inside utf-8 multibyte sequencesest312015-06-17
| | | | | | Also count multibyte sequences as "one" character. Adds unittest for the bug reporter's case. Fixes #2796.
* Add UTF and other utility unit testsest312015-06-14
|
* Fix several MSVC issues numeric.hSmallJoker2015-05-01
| | | | | -> Round negative numbers correctly CMakeLists.txt -> Link Json with the static run-time library
* Tests: Modularize unit testingkwolekr2015-04-26
Split unit tests into separate files under src/unittest/ Give better unittest diagnostics Clean up some code
='n191' href='#n191'>191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   width="256"
   height="512"
   viewBox="0 0 67.73333 135.46667"
   version="1.1"
   id="svg8"
   inkscape:version="0.92.1 r15371"
   sodipodi:docname="rare_controls.svg"
   inkscape:export-filename="/home/stu/Desktop/icons/png/rare_controls.png"
   inkscape:export-xdpi="24.000002"
   inkscape:export-ydpi="24.000002">
  <defs
     id="defs2">
    <filter
       style="color-interpolation-filters:sRGB"
       inkscape:label="Colorize"
       id="filter4628">
      <feComposite
         in2="SourceGraphic"
         operator="arithmetic"
         k1="0"
         k2="1"
         result="composite1"
         id="feComposite4614"
         k3="0"
         k4="0" />
      <feColorMatrix
         in="composite1"
         values="1"
         type="saturate"
         result="colormatrix1"
         id="feColorMatrix4616" />
      <feFlood
         flood-opacity="1"
         flood-color="rgb(158,0,0)"
         result="flood1"
         id="feFlood4618" />
      <feBlend
         in="flood1"
         in2="colormatrix1"
         mode="multiply"
         result="blend1"
         id="feBlend4620" />
      <feBlend
         in2="blend1"
         mode="screen"
         result="blend2"
         id="feBlend4622" />
      <feColorMatrix
         in="blend2"
         values="1"
         type="saturate"
         result="colormatrix2"
         id="feColorMatrix4624" />
      <feComposite
         in="colormatrix2"
         in2="SourceGraphic"
         operator="in"
         result="composite2"
         id="feComposite4626" />
    </filter>
    <filter
       style="color-interpolation-filters:sRGB"
       inkscape:label="Sharpen More"
       id="filter5109"
       inkscape:menu="Image Effects"
       inkscape:menu-tooltip="Sharpen edges and boundaries within the object, force=0.3">
      <feComposite
         in2="SourceGraphic"
         operator="arithmetic"
         k1="0"
         k2="1"
         result="composite1"
         id="feComposite5095"
         k3="0"
         k4="0" />
      <feColorMatrix
         in="composite1"
         values="1"
         type="saturate"
         result="colormatrix1"
         id="feColorMatrix5097" />
      <feFlood
         flood-opacity="1"
         flood-color="rgb(158,67,0)"
         result="flood1"
         id="feFlood5099" />
      <feBlend
         in="flood1"
         in2="colormatrix1"
         mode="multiply"
         result="blend1"
         id="feBlend5101" />
      <feBlend
         in2="blend1"
         mode="screen"
         result="blend2"
         id="feBlend5103" />
      <feColorMatrix
         in="blend2"
         values="1"
         type="saturate"
         result="colormatrix2"
         id="feColorMatrix5105" />
      <feComposite
         in="colormatrix2"
         in2="SourceGraphic"
         operator="in"
         result="fbSourceGraphic"
         id="feComposite5107" />
      <feColorMatrix
         result="fbSourceGraphicAlpha"
         in="fbSourceGraphic"
         values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"
         id="feColorMatrix5111" />
      <feComposite
         in2="fbSourceGraphic"
         id="feComposite5113"
         operator="arithmetic"
         k1="0"
         k2="1"
         result="composite1"
         in="fbSourceGraphic"
         k3="0"
         k4="0" />
      <feColorMatrix
         id="feColorMatrix5115"
         in="composite1"
         values="1"
         type="saturate"
         result="colormatrix1" />
      <feFlood
         id="feFlood5117"
         flood-opacity="1"
         flood-color="rgb(158,0,0)"
         result="flood1" />
      <feBlend
         in2="colormatrix1"
         id="feBlend5119"
         in="flood1"
         mode="multiply"
         result="blend1" />
      <feBlend
         in2="blend1"
         id="feBlend5121"
         mode="screen"
         result="blend2" />
      <feColorMatrix
         id="feColorMatrix5123"
         in="blend2"
         values="1"
         type="saturate"
         result="colormatrix2" />
      <feComposite
         in2="fbSourceGraphic"
         id="feComposite5125"
         in="colormatrix2"
         operator="in"
         result="fbSourceGraphic" />
      <feColorMatrix
         result="fbSourceGraphicAlpha"
         in="fbSourceGraphic"
         values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"
         id="feColorMatrix7007" />
      <feConvolveMatrix
         id="feConvolveMatrix7009"
         order="3 3"
         kernelMatrix="0 -0.15 0 -0.15 1.6 -0.15 0 -0.15 0"
         divisor="1"
         in="fbSourceGraphic"
         targetX="1"
         targetY="1"
         result="fbSourceGraphic" />
      <feColorMatrix
         result="fbSourceGraphicAlpha"
         in="fbSourceGraphic"
         values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"
         id="feColorMatrix7011" />
      <feConvolveMatrix
         id="feConvolveMatrix7013"
         targetY="1"
         targetX="1"
         in="fbSourceGraphic"
         divisor="1"
         kernelMatrix="0 -0.3 0 -0.3 2.2 -0.3 0 -0.3 0"
         order="3 3"
         result="result1" />
      <feBlend
         in2="fbSourceGraphic"
         id="feBlend7015"
         mode="normal"
         result="result2" />
    </filter>
    <marker
       style="overflow:visible"
       refY="0"
       refX="0"
       orient="auto"
       id="DistanceX">
      <path
         id="path7410"
         style="stroke:#000000;stroke-width:0.5"
         d="M 3,-3 -3,3 M 0,-5 V 5"
         inkscape:connector-curvature="0" />
    </marker>
    <pattern
       y="0"
       x="0"
       width="8"
       patternUnits="userSpaceOnUse"
       id="Hatch"
       height="8">
      <path
         id="path7413"
         stroke-width="0.25"
         stroke="#000000"
         linecap="square"
         d="M8 4 l-4,4" />
      <path
         id="path7415"
         stroke-width="0.25"
         stroke="#000000"
         linecap="square"
         d="M6 2 l-4,4" />
      <path
         id="path7417"
         stroke-width="0.25"
         stroke="#000000"
         linecap="square"
         d="M4 0 l-4,4" />
    </pattern>
    <symbol
       id="*Model_Space" />
    <symbol
       id="*Paper_Space" />
    <symbol
       id="*Paper_Space0" />
    <filter
       style="color-interpolation-filters:sRGB"
       inkscape:label="Colorize"
       id="filter4883">
      <feComposite
         in2="SourceGraphic"
         operator="arithmetic"
         k1="0"
         k2="1"
         result="composite1"
         id="feComposite4869"
         k3="0"
         k4="0" />
      <feColorMatrix
         in="composite1"
         values="1"
         type="saturate"
         result="colormatrix1"
         id="feColorMatrix4871" />
      <feFlood
         flood-opacity="1"
         flood-color="rgb(158,21,0)"
         result="flood1"
         id="feFlood4873" />
      <feBlend
         in="flood1"
         in2="colormatrix1"
         mode="multiply"
         result="blend1"
         id="feBlend4875" />
      <feBlend
         in2="blend1"
         mode="screen"
         result="blend2"
         id="feBlend4877" />
      <feColorMatrix
         in="blend2"
         values="1"
         type="saturate"
         result="colormatrix2"
         id="feColorMatrix4879" />
      <feComposite
         in="colormatrix2"
         in2="SourceGraphic"
         operator="in"
         result="composite2"
         id="feComposite4881" />
    </filter>
    <filter
       style="color-interpolation-filters:sRGB"
       inkscape:label="Colorize"
       id="filter5059">
      <feComposite
         in2="SourceGraphic"
         operator="arithmetic"
         k1="0"
         k2="1"
         result="composite1"
         id="feComposite5045"
         k3="0"
         k4="0" />
      <feColorMatrix
         in="composite1"
         values="1"
         type="saturate"
         result="colormatrix1"
         id="feColorMatrix5047" />
      <feFlood
         flood-opacity="1"
         flood-color="rgb(159,14,0)"
         result="flood1"
         id="feFlood5049" />
      <feBlend
         in="flood1"
         in2="colormatrix1"
         mode="multiply"
         result="blend1"
         id="feBlend5051" />
      <feBlend
         in2="blend1"
         mode="screen"
         result="blend2"
         id="feBlend5053" />
      <feColorMatrix
         in="blend2"
         values="1"
         type="saturate"
         result="colormatrix2"
         id="feColorMatrix5055" />
      <feComposite
         in="colormatrix2"
         in2="SourceGraphic"
         operator="in"
         result="composite2"
         id="feComposite5057" />
    </filter>
    <filter
       style="color-interpolation-filters:sRGB"
       inkscape:label="Colorize"
       id="filter5227">
      <feComposite
         in2="SourceGraphic"
         operator="arithmetic"
         k1="0"
         k2="1"
         result="composite1"
         id="feComposite5213"
         k3="0"
         k4="0" />
      <feColorMatrix
         in="composite1"
         values="1"
         type="saturate"
         result="colormatrix1"
         id="feColorMatrix5215" />
      <feFlood
         flood-opacity="1"
         flood-color="rgb(159,21,0)"
         result="flood1"
         id="feFlood5217" />
      <feBlend
         in="flood1"
         in2="colormatrix1"
         mode="multiply"
         result="blend1"
         id="feBlend5219" />
      <feBlend
         in2="blend1"
         mode="screen"
         result="blend2"
         id="feBlend5221" />
      <feColorMatrix
         in="blend2"
         values="1"
         type="saturate"
         result="colormatrix2"
         id="feColorMatrix5223" />
      <feComposite
         in="colormatrix2"
         in2="SourceGraphic"
         operator="in"
         result="composite2"
         id="feComposite5225" />
    </filter>
  </defs>
  <sodipodi:namedview
     id="base"
     pagecolor="#404040"
     bordercolor="#666666"
     borderopacity="1.0"
     inkscape:pageopacity="0"
     inkscape:pageshadow="2"
     inkscape:zoom="0.7"
     inkscape:cx="-59.862018"
     inkscape:cy="260.34663"
     inkscape:document-units="mm"
     inkscape:current-layer="layer2"
     showgrid="true"
     units="px"
     inkscape:window-width="1920"
     inkscape:window-height="1023"
     inkscape:window-x="0"
     inkscape:window-y="34"
     inkscape:window-maximized="1"
     inkscape:pagecheckerboard="false"
     inkscape:snap-grids="true"
     inkscape:snap-page="true"
     showguides="false">
    <inkscape:grid
       type="xygrid"
       id="grid16"
       spacingx="0.26458333"
       spacingy="0.26458333"
       empspacing="4"
       color="#40ff40"
       opacity="0.1254902"
       empcolor="#40ff40"
       empopacity="0.25098039" />
  </sodipodi:namedview>
  <metadata
     id="metadata5">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title></dc:title>
        <cc:license
           rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
      </cc:Work>
      <cc:License
         rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
        <cc:permits
           rdf:resource="http://creativecommons.org/ns#Reproduction" />
        <cc:permits
           rdf:resource="http://creativecommons.org/ns#Distribution" />
        <cc:requires
           rdf:resource="http://creativecommons.org/ns#Notice" />
        <cc:requires
           rdf:resource="http://creativecommons.org/ns#Attribution" />
        <cc:permits
           rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
        <cc:requires
           rdf:resource="http://creativecommons.org/ns#ShareAlike" />
      </cc:License>
    </rdf:RDF>
  </metadata>
  <g
     inkscape:groupmode="layer"
     id="layer1"
     inkscape:label="Layer 3"
     style="display:inline" />
  <g
     inkscape:groupmode="layer"
     id="layer2"
     inkscape:label="Layer 2"
     style="display:inline">
    <path
       style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       d=""
       id="path7055"
       inkscape:connector-curvature="0" />
    <path
       style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       d=""
       id="path7035"
       inkscape:connector-curvature="0" />
    <path
       style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       d=""
       id="path7005"
       inkscape:connector-curvature="0" />
    <path
       style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       d=""
       id="path5127"
       inkscape:connector-curvature="0" />
    <flowRoot
       xml:space="preserve"
       id="flowRoot4718"
       style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40px;line-height:1.25;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:none;fill-opacity:1;stroke:#ffffff;stroke-opacity:1"
       transform="scale(0.26458333)"><flowRegion
         id="flowRegion4720"
         style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-opacity:1"><rect
           id="rect4722"
           width="157.5838"
           height="136.37059"
           x="264.65997"
           y="124.10143"
           style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-opacity:1" /></flowRegion><flowPara
         id="flowPara4724" /></flowRoot>    <rect
       style="display:inline;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       id="rect5231-9"
       width="25.4"
       height="25.400003"
       x="21.166666"
       y="101.6" />
    <rect
       style="display:inline;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       id="rect5231-9-7"
       width="25.4"
       height="25.400003"
       x="21.166666"
       y="55.033333" />
    <rect
       style="display:inline;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       id="rect5231-9-5"
       width="25.4"
       height="25.400003"
       x="21.166664"
       y="8.4666681" />
  </g>
</svg>