Skip to content

Commit

Permalink
Relax NoOutput() + CustomScorer() constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
fushar committed Dec 16, 2016
1 parent 33379e1 commit eab757d
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 24 deletions.
1 change: 0 additions & 1 deletion ete-test/resources/multi-no-output/spec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class ProblemSpec : public BaseProblemSpec {
}

void StyleConfig() {
CustomScorer();
NoOutput();
}

Expand Down
1 change: 0 additions & 1 deletion ete-test/resources/normal-no-output/spec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class ProblemSpec : public BaseProblemSpec {
}

void StyleConfig() {
CustomScorer();
NoOutput();
}

Expand Down
6 changes: 0 additions & 6 deletions include/tcframe/spec/core/StyleConfig.hpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#pragma once

#include <stdexcept>
#include <tuple>
#include <utility>

#include "CommonConfig.hpp"

using std::move;
using std::runtime_error;
using std::tie;

namespace tcframe {
Expand Down Expand Up @@ -56,10 +54,6 @@ class StyleConfigBuilder {
}

StyleConfig build() {
if (!subject_.needsOutput_ && !subject_.needsCustomScorer_) {
throw runtime_error("Problem that does not need output must need custom scorer");
}

return move(subject_);
}
};
Expand Down
16 changes: 0 additions & 16 deletions test/tcframe/spec/core/BaseProblemSpecTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,6 @@ class BaseProblemSpecTests : public Test {
}
};

class ProblemSpecWithIllegalStyleConfig : public ProblemSpec {
protected:
void StyleConfig() {
NoOutput();
}
};

class ProblemSpecWithMultipleTestCasesConfig : public ProblemSpec {
protected:
void MultipleTestCasesConfig() {
Expand Down Expand Up @@ -118,15 +111,6 @@ TEST_F(BaseProblemSpecTests, StyleConfig) {
EXPECT_FALSE(config.needsOutput());
}

TEST_F(BaseProblemSpecTests, StyleConfig_Illegal) {
try {
ProblemSpecWithIllegalStyleConfig().buildStyleConfig();
FAIL();
} catch (runtime_error& e) {
EXPECT_THAT(e.what(), StrEq("Problem that does not need output must need custom scorer"));
}
}

TEST_F(BaseProblemSpecTests, MultipleTestCasesConfig) {
MultipleTestCasesConfig config = ProblemSpecWithMultipleTestCasesConfig().buildMultipleTestCasesConfig();
EXPECT_TRUE(config.counter());
Expand Down

0 comments on commit eab757d

Please sign in to comment.