forked from old/legacy-imlib2
test: Add test_misc
This commit is contained in:
parent
c035f8d19a
commit
90824fc2fd
|
@ -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)
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue