From: TimePath Date: Mon, 4 Jan 2016 06:28:21 +0000 (+1100) Subject: TEST: improve macro X-Git-Tag: xonotic-v0.8.2~1290 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=51206554b2f4dd21e538f13be8742ec480988e5c;p=xonotic%2Fxonotic-data.pk3dir.git TEST: improve macro --- diff --git a/qcsrc/lib/test.qh b/qcsrc/lib/test.qh index 77e1f52ee..9173696bf 100644 --- a/qcsrc/lib/test.qh +++ b/qcsrc/lib/test.qh @@ -1,12 +1,12 @@ #pragma once -#define TEST(id) \ - void _TEST_##id(); \ +#define TEST(suite, test) \ + void _TEST_##suite##_##test(); \ [[accumulate]] int TEST_RunAll_accumulated(int f) { \ - if (!TEST_Run(#id)) ++f; \ + if (!TEST_Run(#suite "_" #test)) ++f; \ return = f; \ } \ - void _TEST_##id() + void _TEST_##suite##_##test() #define TEST_Check(cond) MACRO_BEGIN { if (!(cond)) TEST_Fail(#cond); } MACRO_END diff --git a/qcsrc/lib/yenc.qh b/qcsrc/lib/yenc.qh index c91db98f6..a9d9ed1f1 100644 --- a/qcsrc/lib/yenc.qh +++ b/qcsrc/lib/yenc.qh @@ -46,7 +46,7 @@ } \ } MACRO_END -TEST(yEncDec) +TEST(yEnc, EncodeDecode) { for (int i = 0; i <= 255; ++i) { diff --git a/qcsrc/menu/xonotic/slider_decibels.qc b/qcsrc/menu/xonotic/slider_decibels.qc index 6a8dc903f..f34528da6 100644 --- a/qcsrc/menu/xonotic/slider_decibels.qc +++ b/qcsrc/menu/xonotic/slider_decibels.qc @@ -95,7 +95,7 @@ string XonoticDecibelsSlider_valueToText(entity me, float v) } bool autocvar_test_XonoticDecibelsSlider = false; -TEST(XonoticDecibelsSlider) +TEST(XonoticDecibelsSlider, SoundTest) { if (!autocvar_test_XonoticDecibelsSlider) { TEST_OK(); return; } for (int i = -400; i < 0; ++i)