GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Map doesn't work without concrete by CaelmBleidd · Pull Request #1228 · UnitTestBot/UTBotJava

Conversation

@CaelmBleidd

@CaelmBleidd CaelmBleidd commented Oct 25, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Description

At some moment we discovered that maps do not work as they suppose: sometimes concrete could fix it (for example, when a map was not a parameter), sometimes could not. This request fixes two particular problems: error in type indices for select operation and possible aliasing between nested arrays.

A problem with aliasing could be seen while debugging org.utbot.examples.collections.Maps#putInMapFromParameters. Without this fix it doesn't work for an empty map: touched and values might have the same address, and if we make two put operations, the second one will cause a problem -- memory update for keys will rewrite values as well, and we'll have wrong result values. With one put or with a map that was created during the execution everything worked fine (after the fix with types)

Fixes #436

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Automated Testing

org.utbot.examples.collections.Maps#createMapWithEnum
org.utbot.examples.collections.Maps#createMapWithString
org.utbot.examples.collections.Maps#containsKeyAndPuts
org.utbot.examples.collections.Maps#putInMapFromParameters
org.utbot.examples.collections.Maps#mapPutAndGet

Manual Scenario

Didn't check manually.

Checklist:

  • The change followed the style guidelines of the UTBot project
  • Self-review of the code is passed
  • The change contains enough commentaries, particularly in hard-to-understand areas
  • New documentation is provided or existed one is altered
  • No new warnings
  • New tests have been added
  • All tests pass locally with my changes

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@CaelmBleidd
CaelmBleidd requested review from Damtev and sergeypospelov October 25, 2022 09:06
Damtev
Damtev approved these changes Oct 25, 2022
View reviewed changes
Comment thread utbot-framework/src/main/kotlin/org/utbot/engine/ArrayObjectWrappers.kt Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread utbot-framework/src/main/kotlin/org/utbot/engine/Traverser.kt Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread utbot-sample/src/main/java/org/utbot/examples/collections/Maps.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@CaelmBleidd CaelmBleidd mentioned this pull request Oct 25, 2022
Aliasing between nested fields of UtHashMap #1230
Open
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/map_fixes branch from a1e577e to 268b0c3 Compare October 25, 2022 09:38
@CaelmBleidd
Map don't work without concrete
3a6f06f
Fixes:
* aliasing between nested arrays of UtHashMap and its fields
* unsat for get operation from Map
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/map_fixes branch 3 times, most recently from a648d4e to 410c58d Compare October 26, 2022 05:56
sergeypospelov
sergeypospelov approved these changes Oct 26, 2022
View reviewed changes
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/map_fixes branch from 827f0d4 to 43d1dd3 Compare October 26, 2022 07:12
@CaelmBleidd
Fixes for type system and fallbacks in it
03ffb84
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/map_fixes branch from 43d1dd3 to 03ffb84 Compare October 26, 2022 07:24
@CaelmBleidd
CaelmBleidd merged commit dff228f into main Oct 26, 2022
@CaelmBleidd
CaelmBleidd deleted the caelmbleidd/map_fixes branch October 26, 2022 08:21
@alisevych alisevych changed the title Map don't work without concrete Map doesn't work without concrete Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@sergeypospelov sergeypospelov sergeypospelov approved these changes
@Damtev Damtev Damtev approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

HashMap with Enum as key - test generation fails

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@CaelmBleidd @sergeypospelov @Damtev
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.