Commit Graph

27 Commits

Author SHA1 Message Date
Mike Blumenkrantz 8cef6a9724 tests: fix minor string leaks
Summary: CIDs 1404754, 1401022, 1400965

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10405
2019-10-18 13:29:13 -04:00
Mike Blumenkrantz 2584adae08 tests/strbuf: call va_end for varargs
Summary: CID 1400792

Reviewers: brunobelo

Reviewed By: brunobelo

Subscribers: brunobelo, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10204
2019-09-26 17:59:24 -04:00
Christopher Michael 2336decbe0 eina_test_strbuf: Fix resource leak
Summary:
Coverity reports that we leak storage that 'buf' points to because we
are reassigning the variable, so lets free the previous strbuf so we
don't leak.

Fixes CID1400952

@fix

Depends on D8769

Reviewers: raster, cedric, zmike, bu5hm4n, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8770
2019-05-02 14:11:27 +02:00
Carsten Haitzler b4f9021e55 eina strbuf tests - fix tests to properly check fail unless conditions
the contiions were wrong - warnings picked it up. fix.
2018-11-09 11:43:59 +00:00
Mike Blumenkrantz 681cfc9177 tests: ck_assert_ptr_null -> ck_assert_ptr_ne 2018-04-05 13:43:54 -04:00
Mike Blumenkrantz 1f7f7297e3 tests: rework strbuf append/prepend tests
there's no point in iterating this many times; the base step size is 32
and so each loop will only increase the buffer...not at all since it takes
3 loops for the buffer to increase by the step size

verify that the buffer increases and then stop instead of spinning uselessly

fix T6835

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:29 +02:00
Mike Blumenkrantz 0f3f651f81 tests: reformat eina_test_strbuf.c
Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:29 +02:00
Mike Blumenkrantz 26103722be tests: use namespacing for eina strbuf tests
Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:29 +02:00
Mike Blumenkrantz 624925fe6e tests: move to using checked fixtures for all test suites
individual tests should not need to explicitly call init/shutdown functions
in most cases, and many did not properly do this anyway

see followup commit which resolves some issues with eina tests

ref T6813
ref T6811

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:26 +02:00
Mike Blumenkrantz adc601aca2 tests: add instrumentation to existing tests to find slow tests
efl_check.h must be included and the EFL_START/END_TEST macros must be
used in place of normal START/END_TEST macros

timing is enabled when TIMING_ENABLED is set
https://phab.enlightenment.org/w/improve_tests/

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:25 +02:00
Prince Kumar Dubey 1235459ed3 efl: unused variable removed, removing local variable assignment which has no use at all.
Reviewers: raster, cedric

Reviewed By: cedric

Subscribers: rajeshps, jpeg

Differential Revision: https://phab.enlightenment.org/D5304

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-10-13 12:11:45 -07:00
Amitesh Singh 00ba7b1b6f tests: eina strbuf - fix compilation
refer patch 2cf24eb304
2017-10-13 16:11:00 +09:00
Amitesh Singh 2cf24eb304 eina: strbuf - Add strftime related functions
eina_strbuf_append_strftime()
eina_strbuf_insert_strftime()
eina_strbuf_prepend_strftime() - macro

We need these functions for implementing generic format function
interface especially for calander.

Ref T6204
2017-10-13 16:04:24 +09:00
Marcel Hollerbach 4d6d177ff7 eina_buf: replace eina_strbuf_free_return with eina_xXxbuf_release
The api name free_return wasnt a good choice so it is changed to
release. This also moves the implementation to binbuf template so it is
available in all buf types.
2017-01-06 12:45:27 +01:00
Marcel Hollerbach 2f1d0fb189 eina_strbuf: add eina_strbuf_free_return
Summary:
For a function which just composes a string with strbuf its quite
usefull to return the string while its freed.

This makes a function like:

{
   Eina_Strbuf *buf;
   char *path;

   buf = eina_strbuf_new();
   eina_strbuf_append(buf, "test");
   eina_strbuf_append_printf(buf, "%s-%d.edj", "test", 0);
   path = eina_strbuf_string_steal(buf);
   eina_strbuf_free(buf);
   return path;
}

To:

{
   Eina_Strbuf *buf;

   buf = eina_strbuf_new();
   eina_strbuf_append(buf, "test");
   eina_strbuf_append_printf(buf, "%s-%d.edj", "test", 0);
   return eina_strbuf_free_return(buf);
}

Which is a bit more handy.

Test Plan: just run make check

Reviewers: raster, cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D4545
2017-01-05 14:08:23 +01:00
Gustavo Sverzut Barbieri 0d96ba9734 binbuf, strbuf and ustrbuf: add slice_get() and rw_slice_get(). 2016-08-22 18:25:14 -03:00
Vivek Ellur d8166c7507 eina_strbuf: add test cases for eina strbuf prepend functions
Summary:
Added test cases for eina_strbuf_prepend_printf and eina_strbuf_prepend_vprintf
functions

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: raster, jpeg, cedric

Subscribers: seoz, jpeg, raster, cedric

Differential Revision: https://phab.enlightenment.org/D3163
2016-02-17 14:33:59 -08:00
Vincent Torri 1b143f233e Test rework #10: Eina
mainly minor stuff: whitespaces, order of includes, ... Just don't fear the number
of changed files :-)
2016-02-16 12:41:06 +00:00
Srivardhan Hebbar 26ffe0d55c eina: add test case for eina_strbuf_manage_read_only_new_length API.
Summary: Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: jpeg, cedric

Differential Revision: https://phab.enlightenment.org/D3546

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-01-09 00:33:51 +01:00
Srivardhan Hebbar b598f8eb73 eina: Updated testcases of strbuf_substr_get.
Summary:
Fixes T2949.

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric, jpeg

Reviewed By: jpeg

Maniphest Tasks: T2949

Differential Revision: https://phab.enlightenment.org/D3460
2016-01-07 15:35:18 +09:00
Vincent Torri 70b805be46 Eina test strbuf: the macro TEXT already exists on Windows so rename it to TEST_TEXT 2015-12-14 11:14:34 +09:00
Srivardhan Hebbar 252e703e2a eina: add test case for eina_strbuf_substr_get.
Summary:
Depends on D3224

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

Differential Revision: https://phab.enlightenment.org/D3225

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-10 15:01:17 -08:00
Srivardhan Hebbar 01eaa7a9cc eina: add test case for eina_strbuf_tolower API.
Summary:
Depends on D3200
Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

Differential Revision: https://phab.enlightenment.org/D3204

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-09 10:42:35 -08:00
vivek 08b99cf201 eina: add test case for eina_strbuf_string_free function.
Summary:
Added test case for eina_strbuf_string_free function in eina_strbuf module

Signed-off-by: vivek <vivek.ellur@samsung.com>

Reviewers: cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2382

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-04-22 15:10:19 +02:00
Tom Hacohen 973d0b475b Eina test strbuf: Fixed compilation warnings. 2013-03-11 10:39:20 +00:00
Nikolay Lopatka 779356b45f eina: add test for strbuf trim function.
Signed-off-by: Cedric BAIL <cedric.bail@samsung.com>
2013-03-11 10:53:19 +09:00
Vincent Torri 785f2a6b3a merge : add eina
currently, examples, tests and benchmark are not set. That's the next things i'll do


SVN revision: 76710
2012-09-16 10:57:48 +00:00