Skip to content

Commit

Permalink
Fix typos in tests and interface template (#550)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-fila authored Feb 2, 2024
1 parent 07c5bdf commit 28ef956
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion python/templates/Interface.h.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public:
template<typename T>
T getValue() const {
if (!isA<T>()) {
throw std::runtime_error("Cannot get value as object currently holds anotyer type");
throw std::runtime_error("Cannot get value as object currently holds another type");
}
// We can safely cast here since we check types before
return static_cast<Model<T>*>(m_self.get())->m_value;
Expand Down
4 changes: 2 additions & 2 deletions tests/read_frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ void processExtensions(const podio::Frame& event, int iEvent, podio::version::Ve
auto extElem = extColl[0];
const auto& polVec = extElem.getAVector();
ASSERT(polVec.r == iEvent * 123.f, "polVec.r value not as expected");
ASSERT(polVec.phi == 0.15f, "polVec.phi value not as epxected");
ASSERT(polVec.rho == 3.14f, "polVec.phi value not as epxected");
ASSERT(polVec.phi == 0.15f, "polVec.phi value not as expected");
ASSERT(polVec.rho == 3.14f, "polVec.phi value not as expected");

const auto& extCompColl = event.get<extension::ExternalComponentTypeCollection>("extension_ExternalComponent");
ASSERT(extCompColl.isValid(), "extension_ExternalComponent collection should be present");
Expand Down
2 changes: 1 addition & 1 deletion tests/read_frame_auxiliary.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ int testGetAvailableCollections(const podio::Frame& frame, const std::vector<std
}
}

// Get a few collections and make sure that the resutls are unchanged (apart
// Get a few collections and make sure that the results are unchanged (apart
// from ordering)
frame.get("hitRefs");
frame.get("mcparticles");
Expand Down
2 changes: 1 addition & 1 deletion tests/read_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ void processEvent(const podio::Frame& event, int eventNum, podio::version::Versi
// to be in the file
if (fileVersion >= podio::version::Version{0, 13, 2}) {

// Load the subset collection first to ensure that it pulls in objects taht
// Load the subset collection first to ensure that it pulls in objects that
// have not been read yet
auto& mcpRefs = event.get<ExampleMCCollection>("mcParticleRefs");
if (!mcpRefs.isValid()) {
Expand Down
2 changes: 1 addition & 1 deletion tests/root_io/read_and_write_associated.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
void writeCollection() {
podio::ROOTFrameWriter writer("associations.root");

std::cout << "start writting collections...\n";
std::cout << "start writing collections...\n";

unsigned nevents = 2;

Expand Down
2 changes: 1 addition & 1 deletion tests/schema_evolution/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ tested (if it is supported)
| `SimpleStruct` | no `int t` member in v2 | Addition of new members in components | As member of `ExampleWithArrayComponent` |
| `ExampleHit` | no `double t` member in v1 | Addition of new members in datatypes | Directly via `ExampleHit` |
| `ex2::NamespaceStruct` | renaming of `y` to `y_new` | Renaming of member variables | As member of `ex42::ExampleWithNamespace` |
| `ex42::ExampleWithARelation` | type of `number` member | migration of `float` to `double` | Direcetly via `ex42::ExampleWithARelation` |
| `ex42::ExampleWithARelation` | type of `number` member | migration of `float` to `double` | Directly via `ex42::ExampleWithARelation` |
2 changes: 1 addition & 1 deletion tests/scripts/dumpModelRoundTrip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ${PODIO_BASE}/python/podio_class_generator.py \
${IO_HANDLERS}

# Compare to the originally generated code, that has been used to write the data
# file. Need to diff subfolders explitly here because $PODIO_BASE/tests contains
# file. Need to diff subfolders explicitly here because $PODIO_BASE/tests contains
# more stuff
DIFF_EXTRA_ARGS=""
if [ ${ENABLE_SIO} = "OFF" ]; then
Expand Down
4 changes: 2 additions & 2 deletions tests/unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ option(SKIP_CATCH_DISCOVERY "Skip the Catch2 test discovery" OFF)

# To work around https://github.com/catchorg/Catch2/issues/2424 we need the
# DL_PATH argument for catch_discoer_tests which requires CMake 3.22 at least
# The whole issue can be avoied if we skip the catch test discovery and set the
# The whole issue can be avoided if we skip the catch test discovery and set the
# environment on our own
if (CMAKE_VERSION VERSION_LESS 3.22)
set(SKIP_CATCH_DISCOVERY ON)
Expand All @@ -77,7 +77,7 @@ if (USE_SANITIZER MATCHES "Memory(WithOrigin)?" OR SKIP_CATCH_DISCOVERY)
# directly in the tests.
if (FORCE_RUN_ALL_TESTS OR SKIP_CATCH_DISCOVERY)
# Unfortunately Memory sanitizer seems to be really unhappy with Catch2 and
# it fails to succesfully launch the executable and execute any test. Here
# it fails to successfully launch the executable and execute any test. Here
# we just include them in order to have them show up as failing
add_test(NAME unittest COMMAND unittest_podio ${filter_tests})
PODIO_SET_TEST_ENV(unittest)
Expand Down
8 changes: 4 additions & 4 deletions tests/unittests/frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ TEST_CASE("Frame parameters", "[frame][basics]") {
REQUIRE(std::find(stringKeys.begin(), stringKeys.end(), "someStrings") != stringKeys.end());
}

// NOTE: Due to the extremly small tasks that are done in these tests, they will
// NOTE: Due to the extremely small tasks that are done in these tests, they will
// most likely succeed with a very high probability and only running with a
// ThreadSanitizer will detect race conditions, so make sure to have that
// enabled (-DUSE_SANITIZER=Thread) when working on these tests
Expand Down Expand Up @@ -123,7 +123,7 @@ auto createFrame() {
cluster2.addHits(hits[1]);
cluster2.addClusters(cluster);

// Create a few clustes inline and relate them to the hits from above
// Create a few clusters inline and relate them to the hits from above
frame.put(std::move(clusters), "clusters");

frame.putParameter("anInt", 42);
Expand Down Expand Up @@ -169,7 +169,7 @@ TEST_CASE("Frame collections multithreaded insert and read", "[frame][basics][mu
clusters.create(i * 3.14);
frame.put(std::move(clusters), makeName("clusters", i));

// Retrieve a few collections in between and do iust a very basic testing
// Retrieve a few collections in between and do just a very basic testing
auto& existingClu = frame.get<ExampleClusterCollection>("clusters");
CHECK_INCREASE(existingClu.size() == 2, successes[i]);
auto& existingHits = frame.get<ExampleHitCollection>("hits");
Expand All @@ -196,7 +196,7 @@ TEST_CASE("Frame collections multithreaded insert and read", "[frame][basics][mu

// Check the frame contents after all threads have finished
for (int i = 0; i < nThreads; ++i) {
// Check whether the insertsions are as expected
// Check whether the insertions are as expected
REQUIRE(successes[i] == 2);

auto& hits = frame.get<ExampleHitCollection>(makeName("hits", i));
Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/interface_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ TEST_CASE("InterfaceTypes basic functionality", "[interface-types][basics]") {
REQUIRE(wrapper1 == wrapper2);
// The comparison operator is symmetric
REQUIRE(hit == wrapper1);
// Reassgning to a different entity should make comparisons fail
// Reassigning to a different entity should make comparisons fail
wrapper2 = ExampleHit{};
REQUIRE(wrapper1 != wrapper2);

Expand Down
8 changes: 4 additions & 4 deletions tests/unittests/unittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ TEST_CASE("member getter return types", "[basics][code-gen]") {
// Builtin member types are returned by value, including fixed width integers
STATIC_REQUIRE(std::is_same_v<decltype(std::declval<ExampleHit>().energy()), double>);
STATIC_REQUIRE(std::is_same_v<decltype(std::declval<ExampleWithFixedWidthIntegers>().fixedU64()), std::uint64_t>);
// Arrays are returend by const reference
// Arrays are returned by const reference
STATIC_REQUIRE(std::is_same_v<decltype(std::declval<ExampleWithArray>().myArray()), const std::array<int, 4>&>);
// But if we index into that array we get back a value
STATIC_REQUIRE(std::is_same_v<decltype(std::declval<ExampleWithArray>().myArray(0)), int>);
Expand Down Expand Up @@ -564,7 +564,7 @@ TEST_CASE("Subset collection basics", "[subset-colls]") {
}

TEST_CASE("Subset collection can handle subsets", "[subset-colls]") {
// Can only collect things that already live in a different colection
// Can only collect things that already live in a different collection
auto clusters = ExampleClusterCollection();
auto cluster = clusters.create();

Expand All @@ -582,7 +582,7 @@ TEST_CASE("Subset collection can handle subsets", "[subset-colls]") {
// These are "true" subsets, so changes should propagate
cluster.energy(42);
REQUIRE(clusterRef.energy() == 42);
// Also in the other directon
// Also in the other direction
clusterRef.energy(-42);
REQUIRE(cluster.energy() == -42);

Expand Down Expand Up @@ -623,7 +623,7 @@ TEST_CASE("Collection iterators work with subset collections", "[subset-colls]")
}
}

TEST_CASE("Canont convert a normal collection into a subset collection", "[subset-colls]") {
TEST_CASE("Cannot convert a normal collection into a subset collection", "[subset-colls]") {
auto clusterRefs = ExampleClusterCollection();
auto cluster = clusterRefs.create();

Expand Down

0 comments on commit 28ef956

Please sign in to comment.