Skip to content

Commit 3de732c

Browse files
committed
Fix pedantic issues
1 parent 35bdc46 commit 3de732c

File tree

9 files changed

+15
-19
lines changed

9 files changed

+15
-19
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ target_link_libraries(c++spec INTERFACE
3535
cxx-prettyprint
3636
argparse
3737
)
38-
target_compile_options(c++spec INTERFACE -Wno-missing-template-arg-list-after-template-kw)
38+
target_compile_options(c++spec INTERFACE -Wno-missing-template-arg-list-after-template-kw -Wno-dollar-in-identifier-extension)
3939

4040
FILE(GLOB_RECURSE c++spec_headers ${CMAKE_CURRENT_LIST_DIR}/include/*.hpp)
4141

@@ -79,7 +79,7 @@ if(CPPSPEC_BUILD_TESTS)
7979
enable_testing()
8080

8181
# Tests
82-
discover_specs(spec)
82+
add_subdirectory(spec)
8383
endif(CPPSPEC_BUILD_TESTS)
8484

8585
if(CPPSPEC_BUILD_EXAMPLES)

examples/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
add_compile_options(-Wall -Wextra -Wpedantic)
2+
13
add_subdirectory(sample)
24
#add_subdirectory(skip)
3-
#add_subdirectory(xml_output)
5+
#add_subdirectory(xml_output)

examples/sample/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ target_link_libraries(cppspec_sample c++spec)
77
add_executable(jasmine_intro jasmine_intro.cpp)
88
target_link_libraries(jasmine_intro c++spec)
99

10+
1011
set_target_properties(cppspec_sample jasmine_intro PROPERTIES
1112
CXX_STANDARD 23
1213
CXX_STANDARD_REQUIRED YES

include/child.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ class Child {
7171
/*--------- Parent helper functions -------------*/
7272

7373
/** @brief Check to see if the Child has a parent. */
74-
const bool has_parent() noexcept { return parent != nullptr; }
75-
[[nodiscard]] const bool has_parent() const noexcept { return parent != nullptr; }
74+
bool has_parent() noexcept { return parent != nullptr; }
75+
[[nodiscard]] bool has_parent() const noexcept { return parent != nullptr; }
7676

7777
// TODO: Look in to making these references instead of pointer returns
7878
/** @brief Get the Child's parent. */

include/cppspec.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,8 @@
1919
#define specify it
2020

2121
// Apparently MSVC++ doesn't conform to C++14 14.2/4. Annoying.
22-
#if defined(_MSC_VER) && !defined(__clang__)
2322
#define context self.context
2423
#define expect self.expect
25-
#else
26-
#define context self.template context
27-
#define expect self.template expect
28-
#endif
2924
#define explain context // Piggybacks off of the `context` macro
3025

3126
#define is_expected self.is_expected

include/expectations/expectation.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ class Expectation : public Child {
5555
bool ignore_failure_ = false;
5656

5757
public:
58-
Expectation(const Expectation &) = default;
59-
6058
/**
6159
* @brief Create an Expectation using a value.
6260
*
@@ -399,8 +397,6 @@ class ExpectationValue : public Expectation<A> {
399397
A value;
400398

401399
public:
402-
ExpectationValue(ExpectationValue const &copy) : Expectation<A>(copy), value(copy.value) {}
403-
404400
/**
405401
* @brief Create an ExpectationValue using a value.
406402
*

include/formatters/formatters_base.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ class BaseFormatter {
4545

4646
virtual ~BaseFormatter() = default;
4747

48-
virtual void format(const Description &description) {}
49-
virtual void format(const ItBase &it) {}
48+
virtual void format(const Description & /* description */) {}
49+
virtual void format(const ItBase & /* it */) {}
5050
virtual void format(const std::string &message) { out_stream << message << std::endl; }
51-
virtual void format_failure(const std::string &message) {}
51+
virtual void format_failure(const std::string & /* message */) {}
5252
virtual void flush() {}
5353
virtual void cleanup() {}
5454

include/matchers/pretty_matchers.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,12 @@ inline std::string Pretty::to_word<bool>(bool &item) {
129129
}
130130

131131
template <>
132-
inline std::string Pretty::to_word<std::true_type>(std::true_type &item) {
132+
inline std::string Pretty::to_word<std::true_type>(std::true_type & /* item */) {
133133
return "true";
134134
}
135135

136136
template <>
137-
inline std::string Pretty::to_word<std::false_type>(std::false_type &item) {
137+
inline std::string Pretty::to_word<std::false_type>(std::false_type & /* item */) {
138138
return "false";
139139
}
140140

spec/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
add_compile_options(-Wno-unused-parameter -Wno-missing-template-arg-list-after-template-kw)
2+
discover_specs(${CMAKE_CURRENT_SOURCE_DIR})

0 commit comments

Comments
 (0)