Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update expensify_prod branch #1695

Merged
merged 6 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions libstuff/SQResult.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,12 @@ const SQResultRow& SQResult::operator[](size_t rowNum) const {
STHROW("Out of range");
}
}

SQResult& SQResult::operator=(const SQResult& other) {
headers = other.headers;
rows = other.rows;
for (auto& row : rows) {
row.result = this;
}
return *this;
}
2 changes: 2 additions & 0 deletions libstuff/SQResult.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ using namespace std;
class SQResult;

class SQResultRow : public vector<string> {
friend class SQResult;
public:
SQResultRow();
SQResultRow(SQResult& result, size_t count = 0);
Expand Down Expand Up @@ -36,6 +37,7 @@ class SQResult {
// Operators
SQResultRow& operator[](size_t rowNum);
const SQResultRow& operator[](size_t rowNum) const;
SQResult& operator=(const SQResult& other);

// Serializers
string serializeToJSON() const;
Expand Down
4 changes: 4 additions & 0 deletions test/lib/tpunit++.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ tpunit::TestFixture::TestFixture(method* m0, method* m1, method* m2, method*
method* m35, method* m36, method* m37, method* m38, method* m39,
method* m40, method* m41, method* m42, method* m43, method* m44,
method* m45, method* m46, method* m47, method* m48, method* m49,
method* m50, method* m51, method* m52, method* m53, method* m54,
method* m55, method* m56, method* m57, method* m58, method* m59,
method* m60, method* m61, method* m62, method* m63, method* m64,
method* m65, method* m66, method* m67, method* m68, method* m69,
const char* name, bool parallel)
: _name(name),
_parallel(parallel)
Expand Down
40 changes: 28 additions & 12 deletions test/lib/tpunit++.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ namespace tpunit {

// Use constructor delegation to add an optional default 'name' parameter that works as a first argument.
// This lets us keep backwards compatibility with existing tests, and add a name to new tests without having
// to add 50 '0's for a bunch of unused methods.
// to add 70 '0's for a bunch of unused methods.
TestFixture(const char* name,
method* m0, method* m1 = 0, method* m2 = 0, method* m3 = 0, method* m4 = 0,
method* m5 = 0, method* m6 = 0, method* m7 = 0, method* m8 = 0, method* m9 = 0,
Expand All @@ -268,12 +268,18 @@ namespace tpunit {
method* m30 = 0, method* m31 = 0, method* m32 = 0, method* m33 = 0, method* m34 = 0,
method* m35 = 0, method* m36 = 0, method* m37 = 0, method* m38 = 0, method* m39 = 0,
method* m40 = 0, method* m41 = 0, method* m42 = 0, method* m43 = 0, method* m44 = 0,
method* m45 = 0, method* m46 = 0, method* m47 = 0, method* m48 = 0, method* m49 = 0)
method* m45 = 0, method* m46 = 0, method* m47 = 0, method* m48 = 0, method* m49 = 0,
method* m50 = 0, method* m51 = 0, method* m52 = 0, method* m53 = 0, method* m54 = 0,
method* m55 = 0, method* m56 = 0, method* m57 = 0, method* m58 = 0, method* m59 = 0,
method* m60 = 0, method* m61 = 0, method* m62 = 0, method* m63 = 0, method* m64 = 0,
method* m65 = 0, method* m66 = 0, method* m67 = 0, method* m68 = 0, method* m69 = 0)
: TestFixture( m0, m1, m2, m3, m4, m5, m6, m7, m8, m9,
m10, m11, m12, m13, m14, m15, m16, m17, m18, m19,
m20, m21, m22, m23, m24, m25, m26, m27, m28, m29,
m30, m31, m32, m33, m34, m35, m36, m37, m38, m39,
m40, m41, m42, m43, m44, m45, m46, m47, m48, m49, name) { }
m10, m11, m12, m13, m14, m15, m16, m17, m18, m19,
m20, m21, m22, m23, m24, m25, m26, m27, m28, m29,
m30, m31, m32, m33, m34, m35, m36, m37, m38, m39,
m40, m41, m42, m43, m44, m45, m46, m47, m48, m49,
m50, m51, m52, m53, m54, m55, m56, m57, m58, m59,
m60, m61, m62, m63, m64, m65, m66, m67, m68, m69, name) { }

TestFixture(bool parallel, const char* name,
method* m0, method* m1 = 0, method* m2 = 0, method* m3 = 0, method* m4 = 0,
Expand All @@ -285,16 +291,22 @@ namespace tpunit {
method* m30 = 0, method* m31 = 0, method* m32 = 0, method* m33 = 0, method* m34 = 0,
method* m35 = 0, method* m36 = 0, method* m37 = 0, method* m38 = 0, method* m39 = 0,
method* m40 = 0, method* m41 = 0, method* m42 = 0, method* m43 = 0, method* m44 = 0,
method* m45 = 0, method* m46 = 0, method* m47 = 0, method* m48 = 0, method* m49 = 0)
method* m45 = 0, method* m46 = 0, method* m47 = 0, method* m48 = 0, method* m49 = 0,
method* m50 = 0, method* m51 = 0, method* m52 = 0, method* m53 = 0, method* m54 = 0,
method* m55 = 0, method* m56 = 0, method* m57 = 0, method* m58 = 0, method* m59 = 0,
method* m60 = 0, method* m61 = 0, method* m62 = 0, method* m63 = 0, method* m64 = 0,
method* m65 = 0, method* m66 = 0, method* m67 = 0, method* m68 = 0, method* m69 = 0)
: TestFixture( m0, m1, m2, m3, m4, m5, m6, m7, m8, m9,
m10, m11, m12, m13, m14, m15, m16, m17, m18, m19,
m20, m21, m22, m23, m24, m25, m26, m27, m28, m29,
m30, m31, m32, m33, m34, m35, m36, m37, m38, m39,
m40, m41, m42, m43, m44, m45, m46, m47, m48, m49, name, parallel) { }
m10, m11, m12, m13, m14, m15, m16, m17, m18, m19,
m20, m21, m22, m23, m24, m25, m26, m27, m28, m29,
m30, m31, m32, m33, m34, m35, m36, m37, m38, m39,
m40, m41, m42, m43, m44, m45, m46, m47, m48, m49,
m50, m51, m52, m53, m54, m55, m56, m57, m58, m59,
m60, m61, m62, m63, m64, m65, m66, m67, m68, m69, name, parallel) { }

/**
* Base constructor to register methods with the test fixture. A test
* fixture can register up to 50 methods.
* fixture can register up to 70 methods.
*
* @param[in] m0..m49 The methods to register with the test fixture.
*/
Expand All @@ -308,6 +320,10 @@ namespace tpunit {
method* m35 = 0, method* m36 = 0, method* m37 = 0, method* m38 = 0, method* m39 = 0,
method* m40 = 0, method* m41 = 0, method* m42 = 0, method* m43 = 0, method* m44 = 0,
method* m45 = 0, method* m46 = 0, method* m47 = 0, method* m48 = 0, method* m49 = 0,
method* m50 = 0, method* m51 = 0, method* m52 = 0, method* m53 = 0, method* m54 = 0,
method* m55 = 0, method* m56 = 0, method* m57 = 0, method* m58 = 0, method* m59 = 0,
method* m60 = 0, method* m61 = 0, method* m62 = 0, method* m63 = 0, method* m64 = 0,
method* m65 = 0, method* m66 = 0, method* m67 = 0, method* m68 = 0, method* m69 = 0,
const char* name = 0, bool parallel = false);

~TestFixture();
Expand Down