!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/netdata/libnetdata/storage_number/tests/   drwxr-xr-x
Free 13.3 GB of 57.97 GB (22.94%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     test_storage_number.c (1.41 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
// SPDX-License-Identifier: GPL-3.0-or-later

#include "../../libnetdata.h"
#include "../../required_dummies.h"
#include <setjmp.h>
#include <cmocka.h>

static void test_number_printing(void **state)
{
    (void)state;

    char value[50];

    print_calculated_number(value, 0);
    assert_string_equal(value, "0");

    print_calculated_number(value, 0.0000001);
    assert_string_equal(value, "0.0000001");

    print_calculated_number(value, 0.00000009);
    assert_string_equal(value, "0.0000001");

    print_calculated_number(value, 0.000000001);
    assert_string_equal(value, "0");

    print_calculated_number(value, 99.99999999999999999);
    assert_string_equal(value, "100");

    print_calculated_number(value, -99.99999999999999999);
    assert_string_equal(value, "-100");

    print_calculated_number(value, 123.4567890123456789);
    assert_string_equal(value, "123.456789");

    print_calculated_number(value, 9999.9999999);
    assert_string_equal(value, "9999.9999999");

    print_calculated_number(value, -9999.9999999);
    assert_string_equal(value, "-9999.9999999");

    print_calculated_number(value, unpack_storage_number(pack_storage_number(16.777218L, SN_DEFAULT_FLAGS)));
    assert_string_equal(value, "16.77722");
}

int main(void)
{
    const struct CMUnitTest tests[] = {
        cmocka_unit_test(test_number_printing)
    };

    return cmocka_run_group_tests_name("storage_number", tests, NULL, NULL);
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0711 ]--