Ad
  • Default User Avatar

    Okay :D So much to learn..
    I don't know if i did the right thing, couldn't find the edit button that let me to the old version. So i just did a new fork of the translation. It's waiting for approval.

  • Default User Avatar

    you edited the translation, this has no effect on the kata once it has already been approved ;-)
    you can edit the kata's C version directly with the 'Edit' button when viewing the kata

  • Default User Avatar

    Thanks for this Advice. I Fixed it :)

  • Default User Avatar

    @lnx1_1
    Criterion's default error messages are not very helpful :

    The expression (isAValidMessage(buff)) == (isValid) is false.
    

    How do I debug my code with this kind of message ?

    You need to override it by supplying an extra argument to the assertion. Criterion assertions can take an optional printf format string parameter and corresponding arguments :

    cr_assert_eq(is_valid_msg("abc"), false, "for string %s, expected %s", "abc", "false");
    

    to avoid code duplication, assertions are usually wrapped in a function :

    void do_test (const char *msg, bool expected)
    {
      bool actual = validate(msg);
      cr_assert_eq(actual, expected,
        "expected %s for '%s'",
        expected ? "true" : "false", msg
      );
    }
    

    Could you please edit the C version to do this ?

  • Default User Avatar

    Had the random Test in "Sample Test".. fixed it now

  • Custom User Avatar

    No, retired katas can't be deleted, just leave it.

  • Default User Avatar

    OK I know the problem. I unfortunately evaluated Codewarriors solution before mine in the two last random tests... nobody is perfect:-(
    I changed the evaluation order of my reference solution and Codewarrior's solution so everything should be fine now without having to copy the input. Could you give it a try with your modifying the input? (It is generally considered "bad practice" to modify the input:-)
    Thanks for your post!

  • Custom User Avatar

    But the tests already expect 0 for it. What language are you using?