Commit 41d0fab2 authored by Ari Trachtenberg's avatar Ari Trachtenberg
Browse files

fixed find to std::find

parent 0a243c48
Loading
Loading
Loading
Loading
Loading
+21 −8
Original line number Diff line number Diff line
@@ -2,7 +2,9 @@
#include <vector>

// FILE CHECKS
#if __has_include("lab5.cpp")
#if __has_include("lab6.cpp")
#define LAB6
#elif __has_include("lab5.cpp")
#define LAB5
#elif __has_include("lab4.cpp")
#define LAB4
@@ -27,7 +29,12 @@ void assertFalse(bool val, std::string failureReport) {

// STUBS

#ifdef LAB5
#ifdef LAB6
void e132();
void e133();
void p131();

#elifdef LAB5
void e107();
void p101();
void p102();
@@ -53,7 +60,9 @@ void e79(); //char* replace_all(const char s[], const char t[], const char u[]);
#endif

// TESTS
#ifdef LAB5
#ifdef LAB6

#elifdef LAB5
void teste1112() {
    std::vector<int> t1{1,2,3,4,5};
    std::vector<int> t2{3,1,4,1,5,9,2,6,5,3,5,8,9,7,9,3,2,3};
@@ -68,10 +77,10 @@ void teste1116() {
//        std::cout << "'" << str << "'" << std::endl;
//    }

    assertTrue(find(rum.begin(),rum.end(),std::string("m"))!=rum.end(),"Could not find 'm' in substrings of 'rum'.");
    assertTrue(find(rum.begin(),rum.end(),std::string("rm"))!=rum.end(),"Could not find 'rm' in substrings of 'rum'.");
    assertTrue(find(rum.begin(),rum.end(),std::string("rm"))!=rum.end(),"Could not find 'rum' in substrings of 'rum'.");
    assertTrue(find(rum.begin(),rum.end(),std::string(""))!=rum.end(),"Could not find '' in substrings of 'rum'.");
    assertTrue(std::find(rum.begin(),rum.end(),std::string("m"))!=rum.end(),"Could not find 'm' in substrings of 'rum'.");
    assertTrue(std::find(rum.begin(),rum.end(),std::string("rm"))!=rum.end(),"Could not find 'rm' in substrings of 'rum'.");
    assertTrue(std::find(rum.begin(),rum.end(),std::string("rm"))!=rum.end(),"Could not find 'rum' in substrings of 'rum'.");
    assertTrue(std::find(rum.begin(),rum.end(),std::string(""))!=rum.end(),"Could not find '' in substrings of 'rum'.");
    assertTrue(rum.size()==8,"'rum' has 8 substrings, but "+std::to_string(rum.size())+" found.");
}
#elifdef LAB4
@@ -106,7 +115,11 @@ void testE79() {

// MAIN
int main() {
#ifdef LAB5
#ifdef LAB6
    void e132();
    void e133();
    void p131();
#elifdef LAB5
    e107();
    p101();
    p102();