1
0
mirror of https://gitlab.xiph.org/xiph/icecast-common.git synced 2024-12-04 14:46:31 -05:00

Merge branch 'feature-tests' into ph3-libigloo

This commit is contained in:
Philipp Schafft 2018-11-07 15:58:15 +00:00
commit bb33f86bc9
8 changed files with 740 additions and 0 deletions

View File

@ -40,3 +40,5 @@ AM_CFLAGS = -I$(top_srcdir)/include
static: static:
$(MAKE) all LDFLAGS="${LDFLAGS} -all-static" $(MAKE) all LDFLAGS="${LDFLAGS} -all-static"
include $(srcdir)/src/tests/Makefile.am

View File

@ -147,6 +147,8 @@ CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}"
CPPFLAGS="${CPPFLAGS} ${PTHREAD_CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PTHREAD_CPPFLAGS}"
LIBS="${LIBS} ${PTHREAD_LIBS}" LIBS="${LIBS} ${PTHREAD_LIBS}"
AC_REQUIRE_AUX_FILE([tap-driver.sh])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
AX_PREFIX_CONFIG_H([include/igloo/config.h], [igloo_CTC]) AX_PREFIX_CONFIG_H([include/igloo/config.h], [igloo_CTC])

44
src/tests/Makefile.am Normal file
View File

@ -0,0 +1,44 @@
## Process this file with automake to produce Makefile.in
#######################
# libigloo unit tests #
#######################
TEST_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
$(top_srcdir)/build-aux/tap-driver.sh
check_PROGRAMS =
#
# Helper library for TAP tests
#
libice_ctest_la_SOURCES = %reldir%/ctest_lib.c %reldir%/ctest_lib.h
noinst_LTLIBRARIES = libice_ctest.la
#
# Test programs
#
ctest_suite_test_SOURCES = %reldir%/ctest_suite.c
ctest_suite_test_LDADD = libice_ctest.la
check_PROGRAMS += ctest_suite.test
ctest_refobject_test_SOURCES = %reldir%/ctest_refobject.c
ctest_refobject_test_LDADD = libice_ctest.la \
thread/libicethread.la \
avl/libiceavl.la \
src/ro.o
check_PROGRAMS += ctest_refobject.test
ctest_buffer_test_SOURCES = %reldir%/ctest_buffer.c
ctest_buffer_test_LDADD = libice_ctest.la \
thread/libicethread.la \
avl/libiceavl.la \
src/ro.o \
src/buffer.o
check_PROGRAMS += ctest_buffer.test
# Add all programs to TESTS
TESTS = $(check_PROGRAMS)

323
src/tests/ctest_buffer.c Normal file
View File

@ -0,0 +1,323 @@
/* Icecast
*
* This program is distributed under the GNU General Public License, version 2.
* A copy of this license is included with this source.
*
* Copyright 2018, Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>,
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <string.h>
#include "ctest_lib.h"
#include <igloo/ro.h>
#include <igloo/buffer.h>
static void test_create_ref_unref(void)
{
igloo_buffer_t *a;
a = igloo_buffer_new(-1, NULL, igloo_RO_NULL);
ctest_test("buffer created", a != NULL);
ctest_test("un-referenced", igloo_ro_unref(a) == 0);
a = igloo_ro_new(igloo_buffer_t);
ctest_test("buffer created", a != NULL);
ctest_test("un-referenced", igloo_ro_unref(a) == 0);
}
static void test_name(void)
{
igloo_buffer_t *a;
const char *name = "test object name";
const char *ret;
a = igloo_buffer_new(-1, name, igloo_RO_NULL);
ctest_test("buffer created", a != NULL);
ret = igloo_ro_get_name(a);
ctest_test("get name", ret != NULL);
ctest_test("name match", strcmp(name, ret) == 0);
ctest_test("un-referenced", igloo_ro_unref(a) == 0);
}
static void test_associated(void)
{
igloo_ro_base_t *a;
igloo_buffer_t *b;
a = igloo_ro_new(igloo_ro_base_t);
ctest_test("refobject created", !igloo_RO_IS_NULL(a));
b = igloo_buffer_new(-1, NULL, a);
ctest_test("buffer created with associated", !igloo_RO_IS_NULL(b));
ctest_test("un-referenced (1 of 2)", igloo_ro_unref(b) == 0);
ctest_test("un-referenced (2 of 2)", igloo_ro_unref(a) == 0);
}
static void test_empty(void)
{
igloo_buffer_t *a;
const void *data = &data;
size_t length = 5;
const char *string;
int ret;
a = igloo_ro_new(igloo_buffer_t);
ctest_test("buffer created", a != NULL);
ret = igloo_buffer_get_data(a, &data, &length);
ctest_test("got data and length from buffer", ret == 0);
if (ret == 0) {
ctest_test("data is updated", data != &data);
ctest_test("length is zero", length == 0);
}
data = &data;
ret = igloo_buffer_get_data(a, &data, NULL);
ctest_test("got data from buffer", ret == 0);
if (ret == 0) {
ctest_test("data is updated", data != &data);
}
length = 5;
ret = igloo_buffer_get_data(a, NULL, &length);
ctest_test("got length from buffer", ret == 0);
if (ret == 0) {
ctest_test("length is zero", length == 0);
}
ret = igloo_buffer_get_string(a, &string);
ctest_test("got string from buffer", ret == 0);
if (ret == 0) {
ctest_test("string is non-NULL", string != NULL);
if (string != NULL) {
ctest_test("string is empty", *string == 0);
}
}
ctest_test("un-referenced", igloo_ro_unref(a) == 0);
}
static void test_string(void)
{
igloo_buffer_t *a;
const char *hw = "Hello World!";
const char *count = "0 1 2 3 4";
const char *combined = "Hello World!" "0 1 2 3 4";
const char *string = NULL;
int ret;
a = igloo_ro_new(igloo_buffer_t);
ctest_test("buffer created", a != NULL);
ctest_test("pushed string", igloo_buffer_push_string(a, hw) == 0);
ret = igloo_buffer_get_string(a, &string);
ctest_test("got strong", ret == 0);
if (ret == 0) {
ctest_test("string is non-NULL", string != NULL);
if (string != NULL) {
ctest_test("string matches input", strcmp(string, hw) == 0);
}
}
ctest_test("pushed string", igloo_buffer_push_string(a, count) == 0);
string = NULL;
ret = igloo_buffer_get_string(a, &string);
ctest_test("got strong", ret == 0);
if (ret == 0) {
ctest_test("string is non-NULL", string != NULL);
if (string != NULL) {
ctest_test("string matches combined input", strcmp(string, combined) == 0);
}
}
ctest_test("un-referenced", igloo_ro_unref(a) == 0);
}
static void test_binary(void)
{
igloo_buffer_t *a;
char pattern_a[8] = {0x01, 0x10, 0x80, 0xFF, 0x00, 0x55, 0xEE, 0xAA};
char pattern_b[9] = {0x02, 0x03, 0xF0, 0x80, 0x0F, 0x04, 0x1A, 0x7F, 0x33};
int ret;
size_t length;
const void *data;
a = igloo_ro_new(igloo_buffer_t);
ctest_test("buffer created", a != NULL);
ctest_test("pushed data pattern a", igloo_buffer_push_data(a, pattern_a, sizeof(pattern_a)) == 0);
length = sizeof(pattern_a) + 42;
data = &data;
ret = igloo_buffer_get_data(a, &data, &length);
ctest_test("got data", ret == 0);
if (ret == 0) {
ctest_test("correct length was returned", length == sizeof(pattern_a));
ctest_test("data is non-NULL", data != NULL);
ctest_test("data has been set", data != &data);
if (length == sizeof(pattern_a) && data != NULL && data != &data) {
ctest_test("data matches pattern", memcmp(data, pattern_a, sizeof(pattern_a)) == 0);
}
}
ctest_test("pushed data pattern b", igloo_buffer_push_data(a, pattern_b, sizeof(pattern_b)) == 0);
length = sizeof(pattern_a) + sizeof(pattern_b) + 42;
data = &data;
ret = igloo_buffer_get_data(a, &data, &length);
ctest_test("got data", ret == 0);
if (ret == 0) {
ctest_test("correct length was returned", length == (sizeof(pattern_a) + sizeof(pattern_b)));
ctest_test("data is non-NULL", data != NULL);
ctest_test("data has been set", data != &data);
if (length == (sizeof(pattern_a) + sizeof(pattern_b)) && data != NULL && data != &data) {
ctest_test("data matches combined pattern", memcmp(data, pattern_a, sizeof(pattern_a)) == 0 && memcmp(data + sizeof(pattern_a), pattern_b, sizeof(pattern_b)) == 0);
}
}
ctest_test("un-referenced", igloo_ro_unref(a) == 0);
}
static void test__compare_to_string(igloo_buffer_t *a, const char *testname, const char *pattern)
{
const char *string = NULL;
int ret;
ret = igloo_buffer_get_string(a, &string);
ctest_test("got strong", ret == 0);
if (ret == 0) {
ctest_test("string is non-NULL", string != NULL);
if (string != NULL) {
ctest_test(testname, strcmp(string, pattern) == 0);
ctest_diagnostic_printf("string=\"%s\", pattern=\"%s\"", string, pattern);
}
}
}
static void test_shift(void)
{
igloo_buffer_t *a;
const char *pattern = "AABBBCC";
a = igloo_ro_new(igloo_buffer_t);
ctest_test("buffer created", a != NULL);
ctest_test("pushed string", igloo_buffer_push_string(a, pattern) == 0);
test__compare_to_string(a, "string matches input", pattern);
ctest_test("shifted data by 0 bytes", igloo_buffer_shift(a, 0) == 0);
test__compare_to_string(a, "string matches input (no shift happened)", pattern);
ctest_test("shifted data by 2 bytes", igloo_buffer_shift(a, 2) == 0);
test__compare_to_string(a, "string matches shifted input", pattern + 2);
ctest_test("shifted data by 3 bytes", igloo_buffer_shift(a, 3) == 0);
test__compare_to_string(a, "string matches shifted input", pattern + 2 + 3);
ctest_test("shifted data by 3 bytes", igloo_buffer_shift(a, 2) == 0);
test__compare_to_string(a, "string matches shifted input", pattern + 2 + 3 + 2);
ctest_test("shifted data beyond end (42 bytes)", igloo_buffer_shift(a, 42) != 0);
ctest_test("un-referenced", igloo_ro_unref(a) == 0);
}
static void test_length(void)
{
igloo_buffer_t *a;
const char *pattern = "AABBBCC";
const char *match_a = "AABBB";
const char *match_b = "AABB";
const char *match_c = "";
a = igloo_ro_new(igloo_buffer_t);
ctest_test("buffer created", a != NULL);
ctest_test("pushed string", igloo_buffer_push_string(a, pattern) == 0);
test__compare_to_string(a, "string matches input", pattern);
ctest_test("Set length to match pattern a", igloo_buffer_set_length(a, strlen(match_a)) == 0);
test__compare_to_string(a, "string matches pattern a", match_a);
ctest_test("Set length to match pattern b", igloo_buffer_set_length(a, strlen(match_b)) == 0);
test__compare_to_string(a, "string matches pattern a", match_b);
ctest_test("Set length to match pattern c", igloo_buffer_set_length(a, strlen(match_c)) == 0);
test__compare_to_string(a, "string matches pattern a", match_c);
ctest_test("Set length to match pattern a (again)", igloo_buffer_set_length(a, strlen(match_a)) != 0);
test__compare_to_string(a, "string still matches pattern c", match_c);
ctest_test("un-referenced", igloo_ro_unref(a) == 0);
}
static void test_printf(void)
{
igloo_buffer_t *a;
const char *str = "Hello World!";
const int num = -127;
const char *match_a = ":Hello World!:";
const char *match_b = ":Hello World!:<-127 >";
const char *match_c = ":Hello World!:<-127 >? +127?";
a = igloo_ro_new(igloo_buffer_t);
ctest_test("buffer created", a != NULL);
ctest_test("Set length to match pattern a", igloo_buffer_push_printf(a, ":%s:", str) == 0);
test__compare_to_string(a, "string matches pattern a", match_a);
ctest_test("Set length to match pattern a", igloo_buffer_push_printf(a, "<%-5i>", num) == 0);
test__compare_to_string(a, "string matches pattern b", match_b);
ctest_test("Set length to match pattern a", igloo_buffer_push_printf(a, "?%+5i?", -num) == 0);
test__compare_to_string(a, "string matches pattern c", match_c);
ctest_test("un-referenced", igloo_ro_unref(a) == 0);
}
static void test_push_buffer(void)
{
igloo_buffer_t *a;
igloo_buffer_t *b;
const char *pattern = "AABBBCC";
const char *match_a = "AABBBCCAABBBCC";
a = igloo_ro_new(igloo_buffer_t);
ctest_test("buffer a created", a != NULL);
b = igloo_ro_new(igloo_buffer_t);
ctest_test("buffer b created", b != NULL);
ctest_test("pushed string", igloo_buffer_push_string(a, pattern) == 0);
test__compare_to_string(a, "string matches input", pattern);
ctest_test("pushed buffer a to b", igloo_buffer_push_buffer(b, a) == 0);
test__compare_to_string(b, "string matches input", pattern);
ctest_test("pushed buffer a to b", igloo_buffer_push_buffer(b, a) == 0);
test__compare_to_string(b, "string matches pattern a", match_a);
ctest_test("un-referenced b", igloo_ro_unref(b) == 0);
ctest_test("un-referenced a", igloo_ro_unref(a) == 0);
}
int main (void)
{
ctest_init();
test_create_ref_unref();
test_name();
test_associated();
test_empty();
test_string();
test_binary();
test_shift();
test_length();
test_printf();
test_push_buffer();
ctest_fin();
return 0;
}

84
src/tests/ctest_lib.c Normal file
View File

@ -0,0 +1,84 @@
/* Icecast
*
* This program is distributed under the GNU General Public License, version 2.
* A copy of this license is included with this source.
*
* Copyright 2018, Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>,
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <stdarg.h>
#include "ctest_lib.h"
static size_t ctest_g_test_num;
static int ctest_g_bailed_out;
void ctest_init(void)
{
ctest_g_test_num = 0;
ctest_g_bailed_out = 0;
}
void ctest_fin(void)
{
printf("1..%zu\n", ctest_g_test_num);
}
void ctest_test(const char *desc, int res)
{
const char *prefix = NULL;
if (ctest_bailed_out())
return;
ctest_g_test_num++;
if (res) {
prefix = "ok";
} else {
prefix = "not ok";
}
if (desc) {
printf("%s %zu %s\n", prefix, ctest_g_test_num, desc);
} else {
printf("%s %zu\n", prefix, ctest_g_test_num);
}
}
void ctest_diagnostic(const char *line)
{
printf("# %s\n", line);
}
void ctest_diagnostic_printf(const char *format, ...)
{
va_list ap;
va_start(ap, format);
printf("# ");
vprintf(format, ap);
printf("\n");
va_end(ap);
}
void ctest_bail_out(const char *reason)
{
ctest_g_bailed_out = 1;
if (reason) {
printf("Bail out! %s\n", reason);
} else {
printf("Bail out!\n");
}
}
int ctest_bailed_out(void)
{
return ctest_g_bailed_out;
}

21
src/tests/ctest_lib.h Normal file
View File

@ -0,0 +1,21 @@
/* Icecast
*
* This program is distributed under the GNU General Public License, version 2.
* A copy of this license is included with this source.
*
* Copyright 2018, Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>,
*/
#ifndef __CTEST_LIB_H__
#define __CTEST_LIB_H__
void ctest_init(void);
void ctest_fin(void);
void ctest_test(const char *desc, int res);
void ctest_diagnostic(const char *line);
void ctest_diagnostic_printf(const char *format, ...);
void ctest_bail_out(const char *reason);
int ctest_bailed_out(void);
#endif

244
src/tests/ctest_refobject.c Normal file
View File

@ -0,0 +1,244 @@
/* Icecast
*
* This program is distributed under the GNU General Public License, version 2.
* A copy of this license is included with this source.
*
* Copyright 2018, Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>,
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <string.h>
#include "ctest_lib.h"
#include <igloo/typedef.h>
typedef struct ctest_test_type_t ctest_test_type_t;
typedef struct ctest_test_type_free_t ctest_test_type_free_t;
typedef struct ctest_test_type_a_t ctest_test_type_a_t;
typedef struct ctest_test_type_b_t ctest_test_type_b_t;
typedef struct ctest_test_type_c_t ctest_test_type_c_t;
typedef struct ctest_test_type_d_t ctest_test_type_d_t;
#define igloo_RO_PRIVATETYPES \
igloo_RO_TYPE(ctest_test_type_t) \
igloo_RO_TYPE(ctest_test_type_free_t) \
igloo_RO_TYPE(ctest_test_type_a_t) \
igloo_RO_TYPE(ctest_test_type_b_t) \
igloo_RO_TYPE(ctest_test_type_c_t) \
igloo_RO_TYPE(ctest_test_type_d_t)
#include <igloo/ro.h>
struct ctest_test_type_t {
igloo_ro_base_t __base;
};
struct ctest_test_type_free_t{
igloo_ro_base_t __base;
};
struct ctest_test_type_a_t {
igloo_ro_base_t __base;
char padding[1024];
};
struct ctest_test_type_b_t {
igloo_ro_base_t __base;
char padding[131072];
};
struct ctest_test_type_c_t {
char padding[sizeof(igloo_ro_base_t) - 1];
};
struct ctest_test_type_d_t {
char padding[0];
};
igloo_RO_PRIVATE_TYPE(ctest_test_type_t);
static void test_freecb__freecb(igloo_ro_t self);
igloo_RO_PRIVATE_TYPE(ctest_test_type_free_t,
igloo_RO_TYPEDECL_FREE(test_freecb__freecb),
igloo_RO_TYPEDECL_NEW_NOOP()
);
igloo_RO_PRIVATE_TYPE(ctest_test_type_a_t,
igloo_RO_TYPEDECL_NEW_NOOP()
);
igloo_RO_PRIVATE_TYPE(ctest_test_type_b_t,
igloo_RO_TYPEDECL_NEW_NOOP()
);
igloo_RO_PRIVATE_TYPE(ctest_test_type_c_t,
igloo_RO_TYPEDECL_NEW_NOOP()
);
igloo_RO_PRIVATE_TYPE(ctest_test_type_d_t,
igloo_RO_TYPEDECL_NEW_NOOP()
);
static void test_ptr(void)
{
igloo_ro_t a;
a = igloo_RO_NULL;
ctest_test("NULL is NULL", igloo_RO_IS_NULL(a));
if (!igloo_RO_IS_NULL(a))
ctest_bailed_out();
}
static void test_create_ref_unref(void)
{
igloo_ro_base_t *a;
a = igloo_ro_new(igloo_ro_base_t);
ctest_test("refobject created", !igloo_RO_IS_NULL(a));
ctest_test("referenced", igloo_ro_ref(a) == 0);
ctest_test("un-referenced (1 of 2)", igloo_ro_unref(a) == 0);
ctest_test("un-referenced (2 of 2)", igloo_ro_unref(a) == 0);
}
static void test_typename(void)
{
igloo_ro_base_t *a;
const char *typename;
a = igloo_ro_new(igloo_ro_base_t);
ctest_test("refobject created", !igloo_RO_IS_NULL(a));
typename = igloo_RO_GET_TYPENAME(a);
ctest_test("got typename", typename != NULL);
ctest_test("typename matches", strcmp(typename, "igloo_ro_base_t") == 0);
ctest_test("un-referenced", igloo_ro_unref(a) == 0);
}
static void test_valid(void)
{
igloo_ro_base_t *a;
ctest_test("NULL is not valid", !igloo_RO_IS_VALID(igloo_RO_NULL, igloo_ro_base_t));
a = igloo_ro_new(igloo_ro_base_t);
ctest_test("refobject created", !igloo_RO_IS_NULL(a));
ctest_test("is valid", igloo_RO_IS_VALID(a, igloo_ro_base_t));
ctest_test("is valid as diffrent type", !igloo_RO_IS_VALID(a, ctest_test_type_t));
ctest_test("un-referenced", igloo_ro_unref(a) == 0);
}
static void test_sizes(void)
{
igloo_ro_t a;
a = igloo_ro_new(ctest_test_type_a_t);
ctest_test("refobject created with size=sizeof(igloo_ro_base_t) + 1024", !igloo_RO_IS_NULL(a));
ctest_test("un-referenced", igloo_ro_unref(a) == 0);
a = igloo_ro_new(ctest_test_type_b_t);
ctest_test("refobject created with size=sizeof(igloo_ro_base_t) + 131072", !igloo_RO_IS_NULL(a));
ctest_test("un-referenced", igloo_ro_unref(a) == 0);
a = igloo_ro_new(ctest_test_type_c_t);
ctest_test("refobject created with size=sizeof(igloo_ro_base_t) - 1", igloo_RO_IS_NULL(a));
if (!igloo_RO_IS_NULL(a)) {
ctest_test("un-referenced", igloo_ro_unref(a) == 0);
}
a = igloo_ro_new(ctest_test_type_d_t);
ctest_test("refobject created with size=0", igloo_RO_IS_NULL(a));
if (!igloo_RO_IS_NULL(a)) {
ctest_test("un-referenced", igloo_ro_unref(a) == 0);
}
}
static void test_name(void)
{
igloo_ro_base_t *a;
const char *name = "test object name";
const char *ret;
a = igloo_ro_new_ext(igloo_ro_base_t, name, igloo_RO_NULL);
ctest_test("refobject created", !igloo_RO_IS_NULL(a));
ret = igloo_ro_get_name(a);
ctest_test("get name", ret != NULL);
ctest_test("name match", strcmp(name, ret) == 0);
ctest_test("un-referenced", igloo_ro_unref(a) == 0);
}
static void test_associated(void)
{
igloo_ro_base_t *a, *b;
a = igloo_ro_new(igloo_ro_base_t);
ctest_test("refobject created", !igloo_RO_IS_NULL(a));
b = igloo_ro_new_ext(igloo_ro_base_t, NULL, a);
ctest_test("refobject created with associated", !igloo_RO_IS_NULL(b));
ctest_test("un-referenced (1 of 2)", igloo_ro_unref(b) == 0);
ctest_test("un-referenced (2 of 2)", igloo_ro_unref(a) == 0);
}
static size_t test_freecb__called;
static void test_freecb__freecb(igloo_ro_t self)
{
test_freecb__called++;
}
static void test_freecb(void)
{
ctest_test_type_free_t *a;
test_freecb__called = 0;
a = igloo_ro_new(ctest_test_type_free_t);
ctest_test("refobject created", a != NULL);
ctest_test("un-referenced", igloo_ro_unref(a) == 0);
ctest_test("freecb called", test_freecb__called == 1);
test_freecb__called = 0;
a = igloo_ro_new(ctest_test_type_free_t);
ctest_test("refobject created", a != NULL);
ctest_test("referenced", igloo_ro_ref(a) == 0);
ctest_test("freecb uncalled", test_freecb__called == 0);
ctest_test("un-referenced (1 of 2)", igloo_ro_unref(a) == 0);
ctest_test("freecb uncalled", test_freecb__called == 0);
ctest_test("un-referenced (2 of 2)", igloo_ro_unref(a) == 0);
ctest_test("freecb called", test_freecb__called == 1);
}
int main (void)
{
ctest_init();
test_ptr();
if (ctest_bailed_out()) {
ctest_fin();
return 1;
}
test_create_ref_unref();
test_typename();
test_valid();
test_sizes();
test_name();
test_associated();
test_freecb();
ctest_fin();
return 0;
}

20
src/tests/ctest_suite.c Normal file
View File

@ -0,0 +1,20 @@
/* Icecast
*
* This program is distributed under the GNU General Public License, version 2.
* A copy of this license is included with this source.
*
* Copyright 2018, Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>,
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "ctest_lib.h"
int main (void) {
ctest_init();
ctest_test("suite working", 1);
ctest_fin();
return 0;
}