Ad
  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    The description has We have to write cumbersone a < b && b < c && c < d instead of simply a < b < c. However, these are not equivalent, as there no d in the second expression.

  • Default User Avatar

    I've passed all tests except random with results:

    Expected: false
    Actual : true

    That's not too much clear. In most katas we can make debug output of incoming data, but here incoming data is the expression itsels.

    Then question: how can I see the case I failed on?

  • Custom User Avatar

    Great kata, had a lot of fun solving it but I would propose to choose a few operators you will be using and pointing them out in the description because in the end we are basically doing the same thing for every operator which is not as fun.

  • Custom User Avatar

    I'm completely stumped by exit code 139, presumably a segfault, running the sample tests in the web interface. I can't reproduce locally and valgrind/ubsan/asan don't see anything wrong in my code. My code does no heap allocations and the vector indexing in the sample tests dont overrun the vector. So haven't a clue. I'm using g++ 7.3 and clang++ 6.0.

    Not posting the solution code here (yet), but here's the steps I'm taking locally:

    $ g++ -Wall -Wno-deprecated-declarations -g -O2 -std=c++14 -I../igloo-igloo.1.1.1 cw_test.cpp -fsanitize=address,undefined -o cw
    cw_test.cpp: In member function ‘virtual void Tests::should_work_for_basic_relations()’:
    cw_test.cpp:14:35: warning: suggest parentheses around comparison in operand of ‘!=’ [-Wparentheses]
         bool res_5gtalt7neqa = (5 > a < 7 != a);
                                 ~~~~~~^~~
    $ ./cw
    ...
    Test run complete. 3 tests run, 3 succeeded, 0 failed.
    $ valgrind ./cw
    ==22141== Memcheck, a memory error detector
    ==22141== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
    ==22141== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
    ==22141== Command: ./cw
    ==22141== 
    ==22141==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
    ==22141== 
    ==22141== HEAP SUMMARY:
    ==22141==     in use at exit: 0 bytes in 0 blocks
    ==22141==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
    ==22141== 
    ==22141== All heap blocks were freed -- no leaks are possible
    ==22141== 
    ==22141== For counts of detected and suppressed errors, rerun with: -v
    ==22141== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
    
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution