Skip to content

#555#598

Open
macdude357 wants to merge 1 commit intogetodk:masterfrom
macdude357:bugfix/AddTestForToNumber
Open

#555#598
macdude357 wants to merge 1 commit intogetodk:masterfrom
macdude357:bugfix/AddTestForToNumber

Conversation

@macdude357
Copy link
Contributor

Added test to test XPathFuncExpr.toString, toNumber, etc when passing a
GeoPointData instance.

Closes #555

What has been done to verify that this works as intended?

Why is this the best possible solution? Were any other approaches considered?

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

Do we need any specific form for testing your changes? If so, please attach one.

Does this change require updates to documentation? If so, please file an issue here and include the link below.

Added test to test XPathFuncExpr.toString, toNumber, etc when passing a
GeoPointData instance.
@macdude357
Copy link
Contributor Author

Seems like toNumber(geopoint) is working correctly (returning the accuracy value). Even if the Geopoint is not valid, it returns 9999999.0. I'm also a bit confused on the suggestion that GeoPointData should not implement IExprDataType but should be implemented by the data returned by GeoPointData. I don't see how that could be since the data returned by GeoPointData are built in types. It seems that the combination of the logic in XPathFuncExpr.toXXXXX and the GeoPointData.toXXXXX are effective.

@codecov-commenter
Copy link

Codecov Report

Merging #598 into master will increase coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #598      +/-   ##
============================================
+ Coverage     54.68%   54.72%   +0.03%     
- Complexity     3218     3222       +4     
============================================
  Files           242      242              
  Lines         13320    13320              
  Branches       2562     2562              
============================================
+ Hits           7284     7289       +5     
+ Misses         5230     5226       -4     
+ Partials        806      805       -1     
Impacted Files Coverage Δ Complexity Δ
.../java/org/javarosa/core/model/utils/DateUtils.java 59.26% <0.00%> (+0.28%) 77.00% <0.00%> (+1.00%)
...ava/org/javarosa/core/model/data/GeoPointData.java 65.57% <0.00%> (+6.55%) 17.00% <0.00%> (+3.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9a1ddc6...0d3233b. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

number(geopoint) returns empty string

2 participants