X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fslider_decibels.qc;h=2b78141383d28579d157c5d583addf039427f90d;hb=42e255d014f2c6a1871177ea511f630624cdfb57;hp=6a8dc903fc33edbdd79015ff670b101322dcf333;hpb=f1a87492d9fed27a64d0e99c068705aba5509f26;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/slider_decibels.qc b/qcsrc/menu/xonotic/slider_decibels.qc index 6a8dc903f..2b7814138 100644 --- a/qcsrc/menu/xonotic/slider_decibels.qc +++ b/qcsrc/menu/xonotic/slider_decibels.qc @@ -1,16 +1,4 @@ -#ifndef SLIDER_DECIBELS_H -#define SLIDER_DECIBELS_H -#include "slider.qc" -CLASS(XonoticDecibelsSlider, XonoticSlider) - METHOD(XonoticDecibelsSlider, loadCvars, void(entity)); - METHOD(XonoticDecibelsSlider, saveCvars, void(entity)); - METHOD(XonoticDecibelsSlider, valueToText, string(entity, float)); -ENDCLASS(XonoticDecibelsSlider) -entity makeXonoticDecibelsSlider_T(float, float, float, string, string); -entity makeXonoticDecibelsSlider(float, float, float, string); -#endif - -#ifdef IMPLEMENTATION +#include "slider_decibels.qh" float toDecibelOfSquare(float f, float mi) { @@ -95,9 +83,9 @@ string XonoticDecibelsSlider_valueToText(entity me, float v) } bool autocvar_test_XonoticDecibelsSlider = false; -TEST(XonoticDecibelsSlider) +TEST(XonoticDecibelsSlider, SoundTest) { - if (!autocvar_test_XonoticDecibelsSlider) { TEST_OK(); return; } + if (!autocvar_test_XonoticDecibelsSlider) { SUCCEED(); return; } for (int i = -400; i < 0; ++i) { float db = i * 0.1; @@ -105,9 +93,7 @@ TEST(XonoticDecibelsSlider) float dbv = toDecibelOfSquare(v, -40); float d = dbv - db; LOG_INFOF("%f -> %f -> %f (diff: %f)\n", db, v, dbv, d); - TEST_Check(fabs(d) > 0.02); + EXPECT_GT(fabs(d), 0.02); } - TEST_OK(); + SUCCEED(); } - -#endif