gparted/tests
Mike Fleetwood 0f1fde850f Resolve compiler warning from gen_password()
More recent g++ versions produce these warnings:
    test_PasswordRAMStore.cc: In member function ‘virtual void GParted::PasswordRAMStoreTest_TotalErasure_Test::TestBody()’:
    test_PasswordRAMStore.cc:61:32: warning: ‘                    ’ directive output truncated writing 20 bytes into a region of size 10 [-Wformat-truncation=]
      snprintf( buf, sizeof( buf ), "password%03u                    ", i );
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    test_PasswordRAMStore.cc:61:10: note: ‘snprintf’ output 32 bytes into a destination of size 21
      snprintf( buf, sizeof( buf ), "password%03u                    ", i );
      ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

snprintf() [1] truncates the printed string to the specified size so
didn't overflow the buffer.  However clear the warning by making the
formatted string always exactly 20 characters long, followed by the
terminating NUL character to exactly fill the buffer.

[1] print3(f) - Linux manual page
    https://man7.org/linux/man-pages/man3/snprintf.3.html
    "The functions snprintf() and vsnprintf() write at most size bytes
    (including the terminating null byte ('\0')) to str.
    "
2023-02-13 16:33:57 +00:00
..
Makefile.am Move duplicated test code into shared modules (#220) 2023-02-13 16:33:57 +00:00
common.cc Move duplicated test code into shared modules (#220) 2023-02-13 16:33:57 +00:00
common.h Move duplicated test code into shared modules (#220) 2023-02-13 16:33:57 +00:00
exclude_loopdev_tests.sh Automate exclusion of loop device tests from CI image (!105) 2022-08-25 15:41:31 +00:00
insertion_operators.cc Move duplicated test code into shared modules (#220) 2023-02-13 16:33:57 +00:00
insertion_operators.h Move duplicated test code into shared modules (#220) 2023-02-13 16:33:57 +00:00
makedev.sh Add /dev/disk/by-id/ symlink in CI for test_BlockSpecial 2020-03-14 15:31:37 +00:00
test_BlockSpecial.cc Fix test (dentry->d_name is invalidated by closedir...) (!41) 2019-05-31 19:32:52 +01:00
test_EraseFileSystemSignatures.cc Add unit test of erasing Promise FastTrack RAID signatures (#220) 2023-02-13 16:33:57 +00:00
test_PasswordRAMStore.cc Resolve compiler warning from gen_password() 2023-02-13 16:33:57 +00:00
test_PipeCapture.cc Move duplicated test code into shared modules (#220) 2023-02-13 16:33:57 +00:00
test_SupportedFileSystems.cc Replace fragment of unit test code with trim_trailing_new_line() 2023-02-13 16:33:57 +00:00
test_dummy.cc Add unit test suites with initial successful dummy test (#781978) 2017-06-02 10:13:16 -06:00