mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 20:51:16 +00:00
Copied all files from new-api branch of old repo
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#include "tests.h"
|
||||
#include "yaml-cpp/yaml.h"
|
||||
#include "yaml-cpp/eventhandler.h"
|
||||
#include <iostream>
|
||||
|
||||
namespace Test
|
||||
@@ -1000,21 +999,6 @@ namespace Test
|
||||
}
|
||||
|
||||
namespace {
|
||||
class NullEventHandler: public YAML::EventHandler {
|
||||
virtual void OnDocumentStart(const YAML::Mark&) {}
|
||||
virtual void OnDocumentEnd() {}
|
||||
|
||||
virtual void OnNull(const YAML::Mark&, YAML::anchor_t) {}
|
||||
virtual void OnAlias(const YAML::Mark&, YAML::anchor_t) {}
|
||||
virtual void OnScalar(const YAML::Mark&, const std::string&, YAML::anchor_t, const std::string&) {}
|
||||
|
||||
virtual void OnSequenceStart(const YAML::Mark&, const std::string&, YAML::anchor_t) {}
|
||||
virtual void OnSequenceEnd() {}
|
||||
|
||||
virtual void OnMapStart(const YAML::Mark&, const std::string&, YAML::anchor_t) {}
|
||||
virtual void OnMapEnd() {}
|
||||
};
|
||||
|
||||
void RunEmitterTest(void (*test)(YAML::Emitter&, std::string&), const std::string& name, int& passed, int& total) {
|
||||
YAML::Emitter out;
|
||||
std::string desiredOutput;
|
||||
@@ -1024,10 +1008,7 @@ namespace Test
|
||||
|
||||
if(output == desiredOutput) {
|
||||
try {
|
||||
std::stringstream stream(output);
|
||||
YAML::Parser parser;
|
||||
NullEventHandler handler;
|
||||
parser.HandleNextDocument(handler);
|
||||
YAML::Node node = YAML::Load(output);
|
||||
passed++;
|
||||
} catch(const YAML::Exception& e) {
|
||||
std::cout << "Emitter test failed: " << name << "\n";
|
||||
|
Reference in New Issue
Block a user