Skip to content

Commit

Permalink
Merge pull request #15 from AustinSanders/io-remove-qt
Browse files Browse the repository at this point in the history
Fix unit tests
  • Loading branch information
amystamile-usgs authored Sep 30, 2024
2 parents 790fe9a + 6bb8f09 commit 75b1103
Show file tree
Hide file tree
Showing 435 changed files with 4,174 additions and 4,171 deletions.
2 changes: 1 addition & 1 deletion gtest
Submodule gtest updated 64 files
+1 −0 .gitignore
+17 −0 BUILD.bazel
+10 −1 CMakeLists.txt
+4 −4 CONTRIBUTING.md
+1 −0 CONTRIBUTORS
+61 −0 MODULE.bazel
+8 −8 README.md
+14 −12 WORKSPACE
+35 −0 WORKSPACE.bzlmod
+6 −4 ci/linux-presubmit.sh
+2 −1 ci/macos-presubmit.sh
+2 −2 ci/windows-presubmit.bat
+22 −12 docs/advanced.md
+18 −39 docs/faq.md
+6 −0 docs/gmock_cook_book.md
+4 −2 docs/gmock_for_dummies.md
+11 −11 docs/primer.md
+1 −1 docs/reference/assertions.md
+1 −2 docs/reference/mocking.md
+4 −2 docs/reference/testing.md
+33 −0 fake_fuchsia_sdk.bzl
+14 −13 googlemock/CMakeLists.txt
+3 −3 googlemock/README.md
+28 −4 googlemock/include/gmock/gmock-actions.h
+5 −4 googlemock/include/gmock/gmock-function-mocker.h
+14 −13 googlemock/include/gmock/gmock-matchers.h
+4 −3 googlemock/include/gmock/gmock-more-actions.h
+8 −7 googlemock/include/gmock/gmock.h
+4 −4 googlemock/include/gmock/internal/gmock-port.h
+1 −1 googlemock/src/gmock-matchers.cc
+2 −1 googlemock/src/gmock-spec-builders.cc
+9 −0 googlemock/test/gmock-matchers-comparisons_test.cc
+39 −1 googlemock/test/gmock-more-actions_test.cc
+1 −1 googlemock/test/gmock-spec-builders_test.cc
+9 −0 googlemock/test/gmock_link_test.h
+14 −14 googletest/CMakeLists.txt
+2 −2 googletest/README.md
+4 −0 googletest/cmake/Config.cmake.in
+22 −20 googletest/cmake/internal_utils.cmake
+9 −10 googletest/include/gtest/gtest-message.h
+63 −27 googletest/include/gtest/gtest-printers.h
+36 −19 googletest/include/gtest/gtest.h
+2 −4 googletest/include/gtest/internal/gtest-death-test-internal.h
+7 −1 googletest/include/gtest/internal/gtest-filepath.h
+18 −24 googletest/include/gtest/internal/gtest-internal.h
+75 −71 googletest/include/gtest/internal/gtest-param-util.h
+63 −30 googletest/include/gtest/internal/gtest-port.h
+19 −17 googletest/src/gtest-death-test.cc
+1 −1 googletest/src/gtest-filepath.cc
+29 −17 googletest/src/gtest-internal-inl.h
+37 −10 googletest/src/gtest-port.cc
+112 −88 googletest/src/gtest.cc
+1 −0 googletest/test/googletest-color-test.py
+39 −37 googletest/test/googletest-death-test-test.cc
+4 −1 googletest/test/googletest-options-test.cc
+0 −5 googletest/test/googletest-output-test-golden-lin.txt
+3 −3 googletest/test/googletest-port-test.cc
+16 −0 googletest/test/googletest-printers-test.cc
+52 −44 googletest/test/gtest_environment_test.cc
+23 −41 googletest/test/gtest_help_test.py
+1 −3 googletest/test/gtest_repeat_test.cc
+15 −8 googletest/test/gtest_unittest.cc
+9 −6 googletest/test/gtest_xml_output_unittest.py
+14 −8 googletest_deps.bzl
20 changes: 10 additions & 10 deletions isis/src/apollo/apps/apollo2isis/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,9 @@ void TranslateApolloLabels (IString filename, Cube *opack) {
PvlGroup error("ERROR");
error.addComment("The decrypted code is invalid.");
for (int i=0; i<4; i++) {
PvlKeyword keyword("Column"+toString(i+1));
PvlKeyword keyword("Column"+Isis::toString(i+1));
for (int j=0; j<32; j++) {
keyword += toString((int)code[i][j]);
keyword += Isis::toString((int)code[i][j]);
}
error.addKeyword(keyword);
codeGroup += keyword;
Expand All @@ -250,17 +250,17 @@ void TranslateApolloLabels (IString filename, Cube *opack) {
}
else {
codeGroup += PvlKeyword("StartTime", FrameTime().toStdString());
codeGroup += PvlKeyword("SpacecraftAltitude", toString(Altitude()),"meters");
codeGroup += PvlKeyword("SpacecraftAltitude", Isis::toString(Altitude()),"meters");

if (apollo->IsMetric()){
codeGroup += PvlKeyword("ExposureDuration", toString(ShutterInterval()), "milliseconds");
codeGroup += PvlKeyword("ExposureDuration", Isis::toString(ShutterInterval()), "milliseconds");
codeGroup += PvlKeyword("ForwardMotionCompensation", FMC().toStdString());
}

for (int i=0; i<4; i++) {
PvlKeyword keyword("Column"+ toString(i+1));
PvlKeyword keyword("Column"+ Isis::toString(i+1));
for (int j=0; j<32; j++) {
keyword += toString((int)code[i][j]);
keyword += Isis::toString((int)code[i][j]);
}
codeGroup += keyword;
}
Expand All @@ -284,17 +284,17 @@ void TranslateApolloLabels (IString filename, Cube *opack) {

// Update reseau locations based on refined code location
for (int i=0; i<(reseaus->findKeyword("Type")).size(); i++) {
double x = IString::ToDouble(reseaus->findKeyword("Sample")[i]) + sampleTranslation + 2278,
y = IString::ToDouble(reseaus->findKeyword("Line")[i]) + lineTranslation - 20231;
double x = Isis::toDouble(reseaus->findKeyword("Sample")[i]) + sampleTranslation + 2278,
y = Isis::toDouble(reseaus->findKeyword("Line")[i]) + lineTranslation - 20231;

if (apollo->IsApollo17()) {
x += 50;
y += 20;
}

reseaus->findKeyword("Sample")[i] = toString(
reseaus->findKeyword("Sample")[i] = Isis::toString(
cos(rotation)*(x-sampleTranslation) - sin(rotation)*(y-lineTranslation) + sampleTranslation);
reseaus->findKeyword("Line")[i] = toString(
reseaus->findKeyword("Line")[i] = Isis::toString(
sin(rotation)*(x-sampleTranslation) + cos(rotation)*(y-lineTranslation) + lineTranslation);
}
inst += PvlKeyword("StartTime", utcTime.toStdString());
Expand Down
38 changes: 19 additions & 19 deletions isis/src/apollo/apps/apollofindrx/apollofindrx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,20 @@ namespace Isis {
int nres = reseaus["Line"].size();
if (nres != reseaus["Sample"].size()) {
std::string msg = "Sample size incorrect [Sample size " +
toString(reseaus["Sample"].size()) + " != " + " Line size " +
toString(reseaus["Line"].size()) + "]";
Isis::toString(reseaus["Sample"].size()) + " != " + " Line size " +
Isis::toString(reseaus["Line"].size()) + "]";
throw IException(IException::Unknown, msg, _FILEINFO_);
}
if (nres != reseaus["Type"].size()) {
std::string msg = "Type size incorrect [Type size " +
toString(reseaus["Type"].size()) + " != " + " Line size " +
toString(reseaus["Line"].size()) + "]";
Isis::toString(reseaus["Type"].size()) + " != " + " Line size " +
Isis::toString(reseaus["Line"].size()) + "]";
throw IException(IException::Unknown, msg, _FILEINFO_);
}
if (nres != reseaus["Valid"].size()) {
std::string msg = "Valid size incorrect [Valid size " +
toString(reseaus["Valid"].size()) + " != " + " Line size " +
toString(reseaus["Line"].size()) + "]";
Isis::toString(reseaus["Valid"].size()) + " != " + " Line size " +
Isis::toString(reseaus["Line"].size()) + "]";
throw IException(IException::Unknown, msg, _FILEINFO_);
}

Expand All @@ -106,8 +106,8 @@ namespace Isis {
int validReseaus = 0;
// for (int res=0; res<nres; res++)
for (int res=0; res<nres; res++) {
currentLine = (int)(IString::ToDouble(reseaus["Line"][res])+0.5);
currentSample = (int)(IString::ToDouble(reseaus["Sample"][res])+0.5);
currentLine = (int)(Isis::toDouble(reseaus["Line"][res])+0.5);
currentSample = (int)(Isis::toDouble(reseaus["Sample"][res])+0.5);

// Output chips
chip.SetSize(patternSize + 2*ds , patternSize + 2*dl);
Expand All @@ -117,22 +117,22 @@ namespace Isis {
if (Walk() ) {
double dx = 0,
dy = 0;
if (res%dim > 0 && reseaus["Valid"][res-1] == "1") dy = currentLine - patternSize/2 - dl + bestLine-1 - IString::ToDouble(reseaus["Line"][res]);
if (res/dim > 0 && reseaus["Valid"][res - dim] == "1") dx = currentSample - patternSize/2 - ds + bestSample-1 - IString::ToDouble(reseaus["Sample"][res]);
double horizontalShift = currentSample - patternSize/2 - ds + bestSample-1 - IString::ToDouble(reseaus["Sample"][res]) - dx,
verticalShift = currentLine - patternSize/2 - dl + bestLine-1 - IString::ToDouble(reseaus["Line"][res]) - dy;
if (res%dim > 0 && reseaus["Valid"][res-1] == "1") dy = currentLine - patternSize/2 - dl + bestLine-1 - Isis::toDouble(reseaus["Line"][res]);
if (res/dim > 0 && reseaus["Valid"][res - dim] == "1") dx = currentSample - patternSize/2 - ds + bestSample-1 - Isis::toDouble(reseaus["Sample"][res]);
double horizontalShift = currentSample - patternSize/2 - ds + bestSample-1 - Isis::toDouble(reseaus["Sample"][res]) - dx,
verticalShift = currentLine - patternSize/2 - dl + bestLine-1 - Isis::toDouble(reseaus["Line"][res]) - dy;
for (int i=res; i<nres; i++) {
reseaus["Sample"][i] = toString(IString::ToDouble(reseaus["Sample"][i]) + horizontalShift + ((i/dim) - (res/dim) + 1)*dx);
reseaus["Line"][i] = toString(IString::ToDouble(reseaus["Line"][i]) + verticalShift + ((i%dim) - (res%dim) + 1)*dy);
reseaus["Sample"][i] = Isis::toString(Isis::toDouble(reseaus["Sample"][i]) + horizontalShift + ((i/dim) - (res/dim) + 1)*dx);
reseaus["Line"][i] = Isis::toString(Isis::toDouble(reseaus["Line"][i]) + verticalShift + ((i%dim) - (res%dim) + 1)*dy);
}
reseaus["Valid"][res] = "1";
validReseaus++;

std::vector< double > xy;
xy.push_back(res%(int)sqrt(nres));
xy.push_back(res/(int)sqrt(nres));
sampFunc.AddKnown(xy, IString::ToDouble(reseaus["Sample"][res]));
lineFunc.AddKnown(xy, IString::ToDouble(reseaus["Line"][res]));
sampFunc.AddKnown(xy, Isis::toDouble(reseaus["Sample"][res]));
lineFunc.AddKnown(xy, Isis::toDouble(reseaus["Line"][res]));

ds = (int)(MIN_DISP+ abs(dx) + abs(horizontalShift));
dl = (int)(MIN_DISP + abs(dy) + abs(verticalShift));
Expand All @@ -150,12 +150,12 @@ namespace Isis {

// for invalid reseaus, refine the estimated locations
for (int res=0; res<nres; res++) {
if (IString::ToInteger(reseaus["Valid"][res])==0) {
if (Isis::toInt(reseaus["Valid"][res])==0) {
std::vector< double > xy;
xy.push_back(res%(int)sqrt(nres));
xy.push_back(res/(int)sqrt(nres));
reseaus["Sample"][res] = toString(sampFunc.Evaluate(xy));
reseaus["Line"][res] = toString(lineFunc.Evaluate(xy));
reseaus["Sample"][res] = Isis::toString(sampFunc.Evaluate(xy));
reseaus["Line"][res] = Isis::toString(lineFunc.Evaluate(xy));
}
}

Expand Down
26 changes: 13 additions & 13 deletions isis/src/apollo/apps/apollopaninit/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ void IsisMain() {

keyword.setName("LineExposureDuration");
//converted led to msec/mm--negative sign to account for the anti-parallel time and line axes
keyword.setValue(toString(-led),"sec/mm");
keyword.setValue(Isis::toString(-led),"sec/mm");
inst_pvlG.addKeyword(keyword);

panCube.putGroup(inst_pvlG);
Expand All @@ -191,7 +191,7 @@ void IsisMain() {
kernels_pvlG.clear();

keyword.setName("NaifFrameCode");
keyword.setValue(toString(insCode));
keyword.setValue(Isis::toString(insCode));
kernels_pvlG.addKeyword(keyword);

keyword.setName("LeapSecond");
Expand Down Expand Up @@ -404,7 +404,7 @@ void IsisMain() {
recordPos[2] = posJ20[2];
recordPos[3] = temp; //temp = et (right now anyway)
tablePos += recordPos;
tablePos.Label() += PvlKeyword("SpkTableStartTime",toString(temp));
tablePos.Label() += PvlKeyword("SpkTableStartTime",Isis::toString(temp));
//now the other node
temp = 0.515*(time1-time0); //3% extension
posSel[0] = pos0[0] + temp*vel[0]; //selenocentric coordinate calculation
Expand All @@ -424,7 +424,7 @@ void IsisMain() {
recordPos[2] = posJ20[2];
recordPos[3] = temp; //temp = et (right now anyway)
tablePos += recordPos;
tablePos.Label() += PvlKeyword("SpkTableEndTime",toString(temp));
tablePos.Label() += PvlKeyword("SpkTableEndTime",Isis::toString(temp));
tablePos.Label() += PvlKeyword("CacheType","Linear");
tablePos.Label() += PvlKeyword("Description","Created by apollopaninit");
panCube.write(tablePos); //now attach it to the table
Expand Down Expand Up @@ -547,18 +547,18 @@ void IsisMain() {
recordRot[4] = Q[i][4];
tableRot += recordRot;
}
tableRot.Label() += PvlKeyword("CkTableStartTime", toString(Q[0][4]));
tableRot.Label() += PvlKeyword("CkTableEndTime", toString(Q[NODES-1][4]));
tableRot.Label() += PvlKeyword("CkTableStartTime", Isis::toString(Q[0][4]));
tableRot.Label() += PvlKeyword("CkTableEndTime", Isis::toString(Q[NODES-1][4]));
tableRot.Label() += PvlKeyword("Description", "Created by appollopan2isis");

keyword.setName("TimeDependentFrames");
keyword.setValue(toString(scFrameCode));
keyword.setValue(Isis::toString(scFrameCode));
keyword.addValue("1");
tableRot.Label() += keyword;

keyword.setName("ConstantFrames");
keyword.setValue(toString(insCode));
keyword.addValue(toString(scFrameCode));
keyword.setValue(Isis::toString(insCode));
keyword.addValue(Isis::toString(scFrameCode));
tableRot.Label() += keyword;

keyword.setName("ConstantRotation");
Expand Down Expand Up @@ -777,10 +777,10 @@ void IsisMain() {
ApolloPanoramicCamera* cam = (ApolloPanoramicCamera*)(panCube.camera());
//log the residual report from interior orientation
PvlGroup residualStats("InteriorOrientationStats");
residualStats += PvlKeyword("FiducialsFound", toString(tableFid.Records()));
residualStats += PvlKeyword("ResidualMax", toString(cam->intOriResidualMax()),"pixels");
residualStats += PvlKeyword("ResidualMean", toString(cam->intOriResidualMean()),"pixels");
residualStats += PvlKeyword("ResidualStdev", toString(cam->intOriResidualStdev()),"pixels");
residualStats += PvlKeyword("FiducialsFound", Isis::toString(tableFid.Records()));
residualStats += PvlKeyword("ResidualMax", Isis::toString(cam->intOriResidualMax()),"pixels");
residualStats += PvlKeyword("ResidualMean", Isis::toString(cam->intOriResidualMean()),"pixels");
residualStats += PvlKeyword("ResidualStdev", Isis::toString(cam->intOriResidualStdev()),"pixels");

Application::Log( residualStats );

Expand Down
6 changes: 3 additions & 3 deletions isis/src/apollo/apps/apolloremrx/apolloremrx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ namespace Isis {
Brick brick(dim,dim,1,cube.pixelType());
int width = ui.GetInteger("WIDTH");
for (int res=0; res<numres; res++) {
if ((resvalid == 0 || IString::ToInteger(valid[res]) == 1)) {
int baseSamp = (int)(IString::ToDouble(samps[res])+0.5) - (dim/2);
int baseLine = (int)(IString::ToDouble(lines[res])+0.5) - (dim/2);
if ((resvalid == 0 || Isis::toInt(valid[res]) == 1)) {
int baseSamp = (int)(Isis::toDouble(samps[res])+0.5) - (dim/2);
int baseLine = (int)(Isis::toDouble(lines[res])+0.5) - (dim/2);
brick.SetBasePosition(baseSamp,baseLine,1);
cube.read(brick);
if (action == "NULL") {
Expand Down
6 changes: 3 additions & 3 deletions isis/src/apollo/apps/apollowarp/WarpTransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ namespace Isis {
PvlGroup WarpTransform::Residuals () {
PvlGroup errs("Residuals");
for (int i=0; i<p_lsqInputLine->Knowns(); i++) {
PvlKeyword p("POINT"+toString(i+1));
p += toString(p_lsqInputLine->Residual(i));
p += toString(p_lsqInputSamp->Residual(i));
PvlKeyword p("POINT"+Isis::toString(i+1));
p += Isis::toString(p_lsqInputLine->Residual(i));
p += Isis::toString(p_lsqInputSamp->Residual(i));
errs += p;
}
return errs;
Expand Down
12 changes: 6 additions & 6 deletions isis/src/apollo/apps/apollowarp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ void IsisMain() {
vector<double> inputLine,inputSample,outputLine,outputSample;
// Setup the parameters for the transform
for (int i=0; i<reseaus["Sample"].size(); i++) {
inputLine.push_back(IString::ToDouble(reseaus["Line"][i]));
inputSample.push_back(IString::ToDouble(reseaus["Sample"][i]));
outputLine.push_back(IString::ToDouble(master["Line"][i]));
outputSample.push_back(IString::ToDouble(master["Sample"][i]));
inputLine.push_back(Isis::toDouble(reseaus["Line"][i]));
inputSample.push_back(Isis::toDouble(reseaus["Sample"][i]));
outputLine.push_back(Isis::toDouble(master["Line"][i]));
outputSample.push_back(Isis::toDouble(master["Sample"][i]));

// Update the cube's reseau information
reseaus["Line"][i] = toString(outputLine[i]);
reseaus["Sample"][i] = toString(outputSample[i]);
reseaus["Line"][i] = Isis::toString(outputLine[i]);
reseaus["Sample"][i] = Isis::toString(outputSample[i]);
}

// Get the final output image dimensions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ namespace Isis {
new LineScanCameraSkyMap(this);

PvlGroup &instP = lab.findGroup("Kernels", Pvl::Traverse);
m_CkFrameId = IString::ToInteger(instP["NaifFrameCode"][0]);
m_CkFrameId = Isis::toInt(instP["NaifFrameCode"][0]);
m_CkFrameId = -int(-m_CkFrameId/1000)*1000;

LoadCache();
Expand Down
2 changes: 1 addition & 1 deletion isis/src/base/apps/appjit/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void IsisMain() {
}
cube.putGroup(kernels);
cube.close();
gp += PvlKeyword("Status" + toString(ifile), list[ifile].toString() + ": camera pointing updated");
gp += PvlKeyword("Status" + Isis::toString(ifile), list[ifile].toString() + ": camera pointing updated");
}
}
Application::Log(gp);
Expand Down
2 changes: 1 addition & 1 deletion isis/src/base/apps/ascii2isis/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void ascii2isis(Buffer &out) {
if (!fin) {
// Clean stream to get the position and invalid data that broke the stream
fin.clear();
std::string msg = "Could not extract non-numerical data [" + std::to_string(fin.peek()) + "] ";
std::string msg = "Could not extract non-numerical data [" + Isis::toString(fin.peek()) + "] ";
msg += "at byte position [" + std::to_string(fin.tellg()) + "]. ";
msg += "Please make sure to skip any header data in [" + from.toStdString() + "].";
throw IException(IException::User, msg, _FILEINFO_);
Expand Down
Loading

0 comments on commit 75b1103

Please sign in to comment.