libosmocore/tests
Neels Hofmeyr 823073aa91 utils.h: add OSMO_NAME_C_IMPL() macro
Provide a common implementation for foo_name_c() functions that base on
foo_name_buf() functions.

  char *foo_name_c(void *ctx, example_t arg)
  {
          OSMO_NAME_C_IMPL(ctx, 64, "ERROR", foo_name_buf, arg)
  }

Rationale: the most efficient way of composing strings that have optional parts
or require loops for composition is by writing to a ready char[], and this in
turn is easiest done by using OSMO_STRBUF_* API. Using such a basic name string
implementation which typically returns a length, I often want a more convenient
version that returns a char*, which can just be inlined in a "%s" string format
-- crucially: skipping string composition when inlined in a LOGP(). This common
implementation allows saving code dup, only the function signature is needed.

Why not include the function signature in the macro? The two sets of varargs
(1: signature args, 2: function call args) are hard to do. Also, having an
explicit signature is good for readability and code grepping / ctags.

Upcoming uses: in libosmocore in the mslookup (D-GSM) implementation
(osmo_mslookup_result_name_c()), and in osmo_msc's codec negotiation
implementation (sdp_audio_codecs_name_c(), sdp_msg_name_c(), ...).
I54b6c0810f181259da307078977d9ef3d90458c9 (libosmocore)
If3ce23cd5bab15e2ab4c52ef3e4c75979dffe931 (osmo-msc)

Change-Id: Ida5ba8d9640ea641aafef0236800f6d489d3d322
2019-11-23 07:58:47 +00:00
..
a5 tests: a5_test: Print wrong buffer correctly on error 2018-05-16 21:13:58 +02:00
abis use osmo_init_logging2() with proper talloc ctx 2018-04-06 04:37:50 +02:00
auth Use define for key buffers 2018-12-20 09:51:02 +00:00
bits tests: bitrev_test: Fix dynamic-stack-buffer-overflow 2018-05-16 17:10:33 +02:00
bitvec bitvec: Add bitvec_tailroom_bits() function 2019-02-05 11:16:44 +01:00
codec ecu_fr: increase test coverage for FR ECU implementation 2019-09-20 11:21:46 +02:00
coding coding: check gsm0503_rach_*() results 2019-03-05 11:30:39 +01:00
comp128 tests: test actual support status for auth. algo 2016-06-29 16:33:40 +00:00
context context: Add support for [per-thread] global talloc contexts 2019-08-27 13:43:31 +02:00
conv Add functions for extended RACH coding 2017-12-11 10:36:47 +00:00
ctrl utils.h: require a semi colon after OSMO_ASSERT 2019-07-08 13:23:45 +00:00
endian add/clean big-endian packed structs (struct_endianess.py) 2018-12-19 18:40:03 +00:00
fr license: Fix the license to GPL 2017-12-09 13:03:29 +00:00
fsm fsm: refuse state chg and events after term 2019-10-29 17:28:30 +01:00
gb NS: Factor out gprs_nsvc_start_test() and use it 2019-02-26 12:18:30 +01:00
gea tests: gea_test: Use correct max size for key in buffer 2018-05-16 20:09:39 +02:00
gprs use osmo_init_logging2() with proper talloc ctx 2018-04-06 04:37:50 +02:00
gsm0408 gsm: gsm_utils: Fix return type of API ms_class_gmsk_dbm() and add unit tests 2019-11-04 12:41:22 +01:00
gsm0502 gsm0508: add functions to calculate beginning of a block 2019-10-28 19:43:14 +00:00
gsm0808 gsm0808_test: Fix wrong use of memcp 2019-07-30 12:51:29 +00:00
gsm23003 gsm23003: add osmo_imei_str_valid() 2019-01-14 14:39:57 +00:00
gsm29205 gsm29205_test: fix error: missing braces around initializer 2019-09-27 03:16:17 +00:00
gsup gsup: add OSMO_GSUP_SUPPORTED_RAT_TYPES_IE and OSMO_GSUP_CURRENT_RAT_TYPE_IE 2019-09-28 14:34:07 +02:00
kasumi gsm: kasumi: Fix dynamic-stack-buffer-overflow on out buffers not multiple of 64 bits 2018-05-17 12:13:04 +02:00
lapd RSL/LAPDm: Not all RLL message are "transparent" 2018-04-19 15:09:32 +00:00
logging logging.h: define ansi color constants 2019-11-23 07:58:47 +00:00
loggingrb logging.h: define ansi color constants 2019-11-23 07:58:47 +00:00
msgb use osmo_init_logging2() with proper talloc ctx 2018-04-06 04:37:50 +02:00
msgfile build: resolve compiler warning about implicit delcaration 2014-10-04 11:49:23 +02:00
oap oap_client: Fix license: GPLv2+ instead of AGPLv3+ 2019-05-27 23:26:45 +02:00
osmo-auc-gen umts aka: add sqn_ms out-param, print SQN.MS in osmo-auc-gen 2017-08-29 12:46:46 +00:00
prbs Add pseudo-random bit sequence generator to libosmcoore 2017-07-10 23:42:02 +02:00
sercomm Embedded: add sercomm stubs 2018-01-21 19:08:05 +00:00
sim sim: Fix compiler warning and by this fixing the test result 2016-03-21 11:29:16 +01:00
sms use osmo_init_logging2() with proper talloc ctx 2018-04-06 04:37:50 +02:00
smscb test: Fix compiler warnings on 64bit systems 2015-11-09 16:46:03 +00:00
sockaddr_str osmo_sockaddr_str: API doc: fix 32bit addr mixup of host/network byte order 2019-11-23 07:58:47 +00:00
socket use osmo_init_logging2() with proper talloc ctx 2018-04-06 04:37:50 +02:00
stats add osmo_stat_item_inc/osmo_stat_item_dec to set it relative 2019-05-07 13:20:57 +00:00
strrb Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
tdef tdef_test: verify case where osmo_tdef_set returns -EEXIST 2019-10-07 13:14:14 +00:00
timer timer: Introduce osmo_clock_gettime to override clock_gettime 2018-03-01 12:33:02 +00:00
tlv TLV: Add one-shot TLV encoder 2019-05-19 07:33:32 +00:00
use_count add osmo_use_count API 2019-04-08 13:47:17 +00:00
ussd gsm/gsm0480: refactor and expose gsm0480_parse_facility_ie() 2018-06-11 23:50:00 +07:00
utils utils.h: add OSMO_NAME_C_IMPL() macro 2019-11-23 07:58:47 +00:00
vty logging/vty: fix: actually ignore deprecated logging commands 2019-11-21 10:48:02 +07:00
write_queue wqueue: Reject messges if queue is considered full 2016-12-09 11:37:37 +01:00
Makefile.am logging/vty: fix: actually ignore deprecated logging commands 2019-11-21 10:48:02 +07:00
atlocal.in build: make check: disable sim_test when built with --disable-pcsc 2016-11-16 16:40:44 +00:00
libsercomstub.c Embedded: add sercomm stubs 2018-01-21 19:08:05 +00:00
testsuite.at logging/vty: fix vty_read_file(): do not write warnings to stdin 2019-11-21 10:48:30 +07:00