Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 13 21:29
    kugel- commented #172
  • Nov 13 20:49
    Snaipe commented #312
  • Nov 13 20:29
    Snaipe labeled #313
  • Nov 13 20:29
    Snaipe labeled #313
  • Nov 13 20:29
    Snaipe labeled #313
  • Nov 13 20:29
    Snaipe opened #313
  • Nov 13 20:26
    Snaipe commented #172
  • Nov 13 15:12
    kugel- commented #172
  • Nov 11 17:41
    jonathanturcotte commented #312
  • Nov 06 16:25
    jonathanturcotte commented #312
  • Nov 06 16:12
    jonathanturcotte commented #312
  • Nov 06 15:56
    Snaipe commented #312
  • Nov 06 15:48
    jonathanturcotte commented #312
  • Nov 06 12:31
    Snaipe commented #312
  • Nov 05 23:41
    jonathanturcotte opened #312
  • Nov 04 18:20
    Snaipe commented #310
  • Nov 04 18:01
    am11 commented on 81982a2
  • Nov 04 11:57
    Snaipe labeled #311
  • Nov 04 11:57
    Snaipe labeled #311
  • Nov 04 11:57
    Snaipe labeled #311
Franklin Mathieu
@Snaipe
@kaidowei you would do mmk_verify(..., .times = 10)
mmk_verify lets you check the number of times a function has been called based on predicates
Dominik
@kaidowei
okay, I see. But why do I have to pass the same information again? Cant the mock do that work?
Franklin Mathieu
@Snaipe
What do you mean by same information?
Are you talking about mmk_when vs mmk_verify?
Dominik
@kaidowei
yes. mmk_when tells the mock how often and how it will be called;
mmk_verify should only check whether the mock really was called that way
Franklin Mathieu
@Snaipe
Actually, it's a bit more subtle than that. mmk_when defines the behaviour of the mock regardless of the number of times the stub is called. If you define foo(1) to return 1, then it will always do so.
mmk_verify asserts that at some point the function has been called with matching parameters a certain number of times
Both are complementary but not necessary to each other
If you want to test what happens when a function returns a specific value, you use mmk_when (i.e. you tell a function to do things)
If you want to test how the function has been used (i.e. you ask the function if it has been called the way you want), then you use mmk_verify
You can completely use mmk_verify without mmk_when, and mmk_verify without mmk_when (useful when you don't care about return values)
Franklin Mathieu
@Snaipe
Er, I meant mmk_when without mmk_verify
Dominik
@kaidowei
okay, I understand. powerful, but (at first glance) quite confusing
what does mmk_eq do?
Franklin Mathieu
@Snaipe
mmk_eq ought to dissappear, I've since found a better way to express it
Dominik
@kaidowei
ah, good
Franklin Mathieu
@Snaipe
but in theory it's a matcher that fixes a parameter to the specific value
in my new batch of tests, it's simply .with_foo = 42 instead of .with_foo = mmk_eq(type, 42)
there are other matchers though
like mmk_any(type), which produces a dummy value matching any parameter
or mmk_lt(type, val), which produces a dummy value matching any parameter less than val
Dominik
@kaidowei
cool :)
Franklin Mathieu
@Snaipe
btw, I'm surveying from a group of programmer friends what syntax they prefer between the two mentionned above, if you'd like to weigh in your syntactic preferences: http://goo.gl/forms/7CEBv3vvxT
Franklin Mathieu
@Snaipe
@kaidowei it seems I can't reproduce the 2nd leak you reported on 2.2.0, does it still happen on your end?
(the one created by test_stats_init)
Franklin Mathieu
@Snaipe
acually, a better question would be: where does it happen on your end
Farid Mesnata
@lamrii
Hi all, I currently learning C, and I'm doing some algorithm problem to progress. I would like to use a Criterion, but I dont understand how to install it. Can you help me. Thanks
Franklin Mathieu
@Snaipe
@faridmes what OS are you on? They details may vary depending on your platform
Farid Mesnata
@lamrii
Ubuntu
Franklin Mathieu
@Snaipe
then follow the instructions over at http://criterion.readthedocs.org/en/master/setup.html (including the sudo make install)
we ought to have a proper package for debian systems in the future, but we currently have some issues with packaging
until then, building from source is the best solution
Farid Mesnata
@lamrii
Ok, I will do that
thanks
Dominik
@kaidowei
@Snaipe hi, I tried to produce a minimal example, but I can't reproduce the leak there
Dominik
@kaidowei
that does it for me, dunno if there are things from our automake, that produce the error
Franklin Mathieu
@Snaipe
This doesn't trigger the leak for me, are you passing specific parameters or setting any environment variable to alter the behaviour of the runner?
Dominik
@kaidowei
--no-early-exit -j1 --pattern confparse_simple/config_load
Franklin Mathieu
@Snaipe
Ah! I can reproduce it now.
Dominik
@kaidowei
yeah :)
Franklin Mathieu
@Snaipe
--pattern exits too early without cleaning up the test stats
Dominik
@kaidowei
btw. 2.2.1 seems to run well ...
Dominik
@kaidowei
@Snaipe
double timeout; /// A timeout for the test in seconds
void *data; /// Extra user data
both are missing in http://criterion.readthedocs.org/en/master/starter.html#configuration-reference
Franklin Mathieu
@Snaipe
this should be fixed in the features/sphinx-doxygen branch (see http://criterion.readthedocs.org/en/features-sphinx-doxygen/starter.html#configuration-reference for what it looks like)
Dominik
@kaidowei
ah okay, sorry then
Franklin Mathieu
@Snaipe
no need to be sorry for that :)
Franklin Mathieu
@Snaipe
Mimick's new API draft has been fully implemented on branch feature/api-2
A current (working) sample is available here