Menu

Build fail on r192

2008-07-29
2012-12-11
  • Kevin Fitch

    Kevin Fitch - 2008-07-29

    I just checked out r192 and it failed to build. Below is a small patch that gets past the problem, basically a macro and a function had the same name. I don't particularly like the name I chose to rename the function with, but it worked ... if anyone has a better name, please change it.

    Kevin

    P.S. I am looking around for a good C unit-test framework and I really think this looks like one of the best. This is the first one I have seen for C that does true mocking ... very cool. I am going to play with it some more, and if I still like it then I would be willing to help push it up to 1.0.

    Index: src/assertions.c

    --- src/assertions.c    (revision 192)
    +++ src/assertions.c    (working copy)
    @@ -13,11 +13,14 @@
         return contextassert.assert;
    }

    -static void set_significant_figures(TestAsserts *assert, double epsilon);
    +static void static_set_significant_figures(TestAsserts *assert,
    +                                           double epsilon) {
    +    assert->epsilon = epsilon;
    +}

    TestAsserts *create_assert() {
         TestAsserts *assert = (TestAsserts *)malloc(sizeof(TestAsserts));
    -    assert->set_significant_figures = &set_significant_figures;
    +    assert->set_significant_figures = &static_set_significant_figures;
         assert->epsilon = 0.1;
         contextassert.assert = assert;
         return assert;
    @@ -37,9 +40,6 @@
                 "[%d] should match [%d]", tried, expected);
    }

    -static void set_significant_figures(TestAsserts *assert, double epsilon) {
    -    assert->epsilon = epsilon;
    -}

    void assert_not_equal_(const char *file, int line, intptr_t tried, intptr_t expected) {
         (*get_test_reporter()->assert_true)(

     
    • João Henrique F. de Freitas

      Thanks,

      Fixed in trunk, r193.