X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Ftest.hpp;h=d904070008c8a64b3fe0586be8aa03490fa5d5d5;hb=e0165c033349179841bd1658f4068a9e4c075f66;hp=b2c89722d856e2e98dd43c892493c78768a7c557;hpb=acf69ff8d9954846854b1a9dbd8b3e11a83bad4c;p=awesomized%2Flibmemcached diff --git a/libtest/test.hpp b/libtest/test.hpp index b2c89722..d9040700 100644 --- a/libtest/test.hpp +++ b/libtest/test.hpp @@ -1,8 +1,8 @@ /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * libtest * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ + * Data Differential YATL (i.e. libtest) library + * + * Copyright (C) 2012 Data Differential, http://datadifferential.com/ * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -34,56 +34,69 @@ * */ - /* Structures for generic tests. */ +#pragma once + +#ifndef YATL_FULL +# define YATL_FULL 1 +#endif + +#ifndef __PRETTY_FUNCTION__ +# define __PRETTY_FUNCTION__ __func__ +#endif + +#define YATL_STRINGIFY(x) #x +#define YATL_TOSTRING(x) YATL_STRINGIFY(x) +#define YATL_AT __FILE__ ":" YATL_TOSTRING(__LINE__) +#define YATL_AT_PARAM __func__, AT +#define YATL_UNIQUE __FILE__ ":" YATL_TOSTRING(__LINE__) "_unique" +#define YATL_UNIQUE_FUNC_NAME __FILE__ ":" YATL_TOSTRING(__LINE__) "_unique_func" + +#define LIBYATL_DEFAULT_PARAM __FILE__, __LINE__, __PRETTY_FUNCTION__ + #include #include -#include #include #include +#include +#include #include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include #include +#include #include #include #include -#include +#include #include #include -#include +#include +#include +#include #include #include #include -#include #include - -#pragma once - -LIBTEST_API -in_port_t default_port(); - -LIBTEST_API -void set_default_port(in_port_t port); - -LIBTEST_API -const char* default_socket(); - -LIBTEST_API -void set_default_socket(const char *socket); - -LIBTEST_API -bool test_is_local(void); - -#ifdef __cplusplus -#define test_literal_param(X) (X), (static_cast((sizeof(X) - 1))) -#else -#define test_literal_param(X) (X), ((size_t)((sizeof(X) - 1))) -#endif - -#define test_string_make_from_cstr(X) (X), ((X) ? strlen(X) : 0) - -#define test_array_length(__array) sizeof(__array)/sizeof(&__array) +#include +#include +#include +#include +#include +#include +#include