diff options
Diffstat (limited to 'backend/src/utest/utest_font.cpp')
-rw-r--r-- | backend/src/utest/utest_font.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/backend/src/utest/utest_font.cpp b/backend/src/utest/utest_font.cpp new file mode 100644 index 00000000..d6b0fa9f --- /dev/null +++ b/backend/src/utest/utest_font.cpp @@ -0,0 +1,41 @@ +/* + * Copyright © 2012 Intel Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see <http://www.gnu.org/licenses/>. + * + * Author: Benjamin Segovia <benjamin.segovia@intel.com> + */ + +#include "renderer/font.hpp" +#include "sys/default_path.hpp" +#include "utest/utest.hpp" + +#include <string> + +using namespace pf; +static const std::string fontName = "font.fnt"; + +void utest_font(void) +{ + Font font; + size_t i = 0; + for (; i < defaultPathNum; ++i) { + const FileName path(std::string(defaultPath[i]) + fontName); + if (font.load(path)) break; + } + PF_ASSERT(i < defaultPathNum); +} + +UTEST_REGISTER(utest_font); + |