test Style.loadJSON directly, drop headless view

This commit is contained in:
Mike Morris
2014-07-07 19:13:32 -07:00
parent 5ae5d7cbc0
commit bc30a9b8cd
2 changed files with 3 additions and 11 deletions

View File

@@ -1,8 +1,6 @@
#include "gtest/gtest.h"
#include <llmr/map/map.hpp>
#include "../common/headless_view.hpp"
#include <llmr/style/style.hpp>
#include <iostream>
#include <fstream>
@@ -10,14 +8,11 @@
using namespace llmr;
TEST(Style, Color) {
// Setup OpenGL
llmr::HeadlessView view;
llmr::Map map(view);
std::ifstream stylefile("./style-fuzzed.min.js");
ASSERT_FALSE(stylefile.good());
std::stringstream stylejson;
stylejson << stylefile.rdbuf();
map.setStyleJSON(stylejson.str());
Style style;
style.loadJSON((const uint8_t *)stylejson.str().c_str());
}

View File

@@ -95,13 +95,10 @@
"sources": [
"./main.cpp",
"./style.cpp",
"../common/headless_view.hpp",
"../common/headless_view.cpp",
],
"dependencies": [
"../deps/gtest/gtest.gyp:gtest",
"../llmr.gyp:llmr-x86",
"link_gl",
]
},
{