test: Add test_misc

This commit is contained in:
Kim Woelders 2022-02-06 11:45:22 +01:00
parent c035f8d19a
commit 90824fc2fd
2 changed files with 27 additions and 1 deletions

View File

@ -8,7 +8,8 @@ CLEANFILES = file.c img_save-*.*
GTEST_LIBS = -lgtest -lstdc++
GTESTS = test_string
GTESTS = test_misc
GTESTS += test_string
GTESTS += test_file
GTESTS += test_context
GTESTS += test_load
@ -39,6 +40,9 @@ endif
TEST_COMMON = test.cpp test.h
test_misc_SOURCES = $(TEST_COMMON) test_misc.cpp
test_misc_LDADD = $(LIBS)
test_string_SOURCES = $(TEST_COMMON) test_string.cpp
nodist_test_string_SOURCES = strutils.c
test_string_LDADD = $(LIBS)

22
test/test_misc.cpp Normal file
View File

@ -0,0 +1,22 @@
#include <gtest/gtest.h>
#include "config.h"
#include <Imlib2.h>
#include "test.h"
TEST(MISC, version)
{
EXPECT_EQ(imlib_version(), IMLIB2_VERSION);
}
TEST(MISC, strerror)
{
if (debug <= 0)
return;
for (int i = -10; i < 140; i++)
{
printf("%3d: '%s'\n", i, imlib_strerror(i));
}
}