Updated Branches: refs/heads/clownfish-test-v2 4f775b86c -> 2177ebf1a
Remove 'vself' hack from TestBatch and TestFormatter Project: http://git-wip-us.apache.org/repos/asf/lucy/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/2177ebf1 Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/2177ebf1 Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/2177ebf1 Branch: refs/heads/clownfish-test-v2 Commit: 2177ebf1abfcbc911ef368fb8e7b296b9bd0c4ad Parents: 08c61bf Author: Nick Wellnhofer <[email protected]> Authored: Thu Feb 21 18:58:09 2013 +0100 Committer: Nick Wellnhofer <[email protected]> Committed: Thu Feb 21 18:58:09 2013 +0100 ---------------------------------------------------------------------- core/Clownfish/Test/TestBatch.c | 42 ++++++++++++++-------------- core/Clownfish/Test/TestBatch.cfh | 16 +++++----- core/Clownfish/Test/TestFormatter.c | 13 ++++---- core/Clownfish/Test/TestFormatter.cfh | 8 ++-- 4 files changed, 39 insertions(+), 40 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy/blob/2177ebf1/core/Clownfish/Test/TestBatch.c ---------------------------------------------------------------------- diff --git a/core/Clownfish/Test/TestBatch.c b/core/Clownfish/Test/TestBatch.c index 0119b0d..d2aeb5f 100644 --- a/core/Clownfish/Test/TestBatch.c +++ b/core/Clownfish/Test/TestBatch.c @@ -97,81 +97,81 @@ TestBatch_get_num_failed(TestBatch *self) { } bool -TestBatch_test_true(void *vself, bool condition, const char *pattern, ...) { +TestBatch_test_true(TestBatch *self, bool condition, const char *pattern, + ...) { va_list args; va_start(args, pattern); - bool result = TestBatch_VTest_True((TestBatch*)vself, condition, - pattern, args); + bool result = TestBatch_VTest_True(self, condition, pattern, args); va_end(args); return result; } bool -TestBatch_test_false(void *vself, bool condition, const char *pattern, ...) { +TestBatch_test_false(TestBatch *self, bool condition, const char *pattern, + ...) { va_list args; va_start(args, pattern); - bool result = TestBatch_VTest_False((TestBatch*)vself, condition, - pattern, args); + bool result = TestBatch_VTest_False(self, condition, pattern, args); va_end(args); return result; } bool -TestBatch_test_int_equals(void *vself, long got, long expected, +TestBatch_test_int_equals(TestBatch *self, long got, long expected, const char *pattern, ...) { va_list args; va_start(args, pattern); - bool result = TestBatch_VTest_Int_Equals((TestBatch*)vself, got, - expected, pattern, args); + bool result + = TestBatch_VTest_Int_Equals(self, got, expected, pattern, args); va_end(args); return result; } bool -TestBatch_test_float_equals(void *vself, double got, double expected, +TestBatch_test_float_equals(TestBatch *self, double got, double expected, const char *pattern, ...) { va_list args; va_start(args, pattern); - bool result = TestBatch_VTest_Float_Equals((TestBatch*)vself, got, - expected, pattern, args); + bool result + = TestBatch_VTest_Float_Equals(self, got, expected, pattern, args); va_end(args); return result; } bool -TestBatch_test_string_equals(void *vself, const char *got, +TestBatch_test_string_equals(TestBatch *self, const char *got, const char *expected, const char *pattern, ...) { va_list args; va_start(args, pattern); - bool result = TestBatch_VTest_String_Equals((TestBatch*)vself, got, - expected, pattern, args); + bool result + = TestBatch_VTest_String_Equals(self, got, expected, pattern, args); va_end(args); return result; } bool -TestBatch_pass(void *vself, const char *pattern, ...) { +TestBatch_pass(TestBatch *self, const char *pattern, ...) { va_list args; va_start(args, pattern); - bool result = TestBatch_VPass((TestBatch*)vself, pattern, args); + bool result = TestBatch_VPass(self, pattern, args); va_end(args); return result; } bool -TestBatch_fail(void *vself, const char *pattern, ...) { +TestBatch_fail(TestBatch *self, const char *pattern, ...) { va_list args; va_start(args, pattern); - bool result = TestBatch_VFail((TestBatch*)vself, pattern, args); + bool result = TestBatch_VFail(self, pattern, args); va_end(args); return result; } void -TestBatch_skip(void *vself, const char *pattern, ...) { +TestBatch_skip(TestBatch *self, const char *pattern, ...) { va_list args; va_start(args, pattern); - TestBatch_VSkip((TestBatch*)vself, pattern, args); + TestBatch_VSkip(self, pattern, args); va_end(args); } http://git-wip-us.apache.org/repos/asf/lucy/blob/2177ebf1/core/Clownfish/Test/TestBatch.cfh ---------------------------------------------------------------------- diff --git a/core/Clownfish/Test/TestBatch.cfh b/core/Clownfish/Test/TestBatch.cfh index 42b84cb..aa0328d 100644 --- a/core/Clownfish/Test/TestBatch.cfh +++ b/core/Clownfish/Test/TestBatch.cfh @@ -61,31 +61,31 @@ abstract class Clownfish::Test::TestBatch inherits Clownfish::Obj { Get_Num_Failed(TestBatch *self); inert bool - test_true(void *vself, bool condition, const char *pattern, ...); + test_true(TestBatch *self, bool condition, const char *pattern, ...); inert bool - test_false(void *vself, bool condition, const char *pattern, ...); + test_false(TestBatch *self, bool condition, const char *pattern, ...); inert bool - test_int_equals(void *vself, long got, long expected, + test_int_equals(TestBatch *self, long got, long expected, const char *pattern, ...); inert bool - test_float_equals(void *vself, double got, double expected, + test_float_equals(TestBatch *self, double got, double expected, const char *pattern, ...); inert bool - test_string_equals(void *vself, const char *got, const char *expected, + test_string_equals(TestBatch *self, const char *got, const char *expected, const char *pattern, ...); inert bool - pass(void *vself, const char *pattern, ...); + pass(TestBatch *self, const char *pattern, ...); inert bool - fail(void *vself, const char *pattern, ...); + fail(TestBatch *self, const char *pattern, ...); inert void - skip(void *vself, const char *pattern, ...); + skip(TestBatch *self, const char *pattern, ...); bool VTest_True(TestBatch *self, bool condition, const char *pattern, http://git-wip-us.apache.org/repos/asf/lucy/blob/2177ebf1/core/Clownfish/Test/TestFormatter.c ---------------------------------------------------------------------- diff --git a/core/Clownfish/Test/TestFormatter.c b/core/Clownfish/Test/TestFormatter.c index 6bccc14..8f3d175 100644 --- a/core/Clownfish/Test/TestFormatter.c +++ b/core/Clownfish/Test/TestFormatter.c @@ -34,28 +34,27 @@ TestFormatter_init(TestFormatter *self) { } void -TestFormatter_test_result(void *vself, bool pass, uint32_t test_num, +TestFormatter_test_result(TestFormatter *self, bool pass, uint32_t test_num, const char *fmt, ...) { va_list args; va_start(args, fmt); - TestFormatter_VTest_Result((TestFormatter*)vself, pass, test_num, fmt, - args); + TestFormatter_VTest_Result(self, pass, test_num, fmt, args); va_end(args); } void -TestFormatter_test_comment(void *vself, const char *fmt, ...) { +TestFormatter_test_comment(TestFormatter *self, const char *fmt, ...) { va_list args; va_start(args, fmt); - TestFormatter_VTest_Comment((TestFormatter*)vself, fmt, args); + TestFormatter_VTest_Comment(self, fmt, args); va_end(args); } void -TestFormatter_batch_comment(void *vself, const char *fmt, ...) { +TestFormatter_batch_comment(TestFormatter *self, const char *fmt, ...) { va_list args; va_start(args, fmt); - TestFormatter_VBatch_Comment((TestFormatter*)vself, fmt, args); + TestFormatter_VBatch_Comment(self, fmt, args); va_end(args); } http://git-wip-us.apache.org/repos/asf/lucy/blob/2177ebf1/core/Clownfish/Test/TestFormatter.cfh ---------------------------------------------------------------------- diff --git a/core/Clownfish/Test/TestFormatter.cfh b/core/Clownfish/Test/TestFormatter.cfh index 4487b37..da32c24 100644 --- a/core/Clownfish/Test/TestFormatter.cfh +++ b/core/Clownfish/Test/TestFormatter.cfh @@ -24,14 +24,14 @@ abstract class Clownfish::Test::TestFormatter inherits Clownfish::Obj { init(TestFormatter *self); inert void - test_result(void *vself, bool pass, uint32_t test_num, const char *fmt, - ...); + test_result(TestFormatter *self, bool pass, uint32_t test_num, + const char *fmt, ...); inert void - test_comment(void *vself, const char *fmt, ...); + test_comment(TestFormatter *self, const char *fmt, ...); inert void - batch_comment(void *vself, const char *fmt, ...); + batch_comment(TestFormatter *self, const char *fmt, ...); /** Print output at the beginning of a test batch. *
