summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormtezych2017-01-29 12:45:57 -0600
committerGreg Hackmann2017-01-30 17:39:03 -0600
commit380b2f4fea745f4db30e5cb2ac7f5a638b33c652 (patch)
tree34ed433f94141e53e955cac62302b17cec64d75c /libsync
parent9cd890e9b7a1ae1d354815f529a0b3df1dd07aea (diff)
downloadplatform-system-core-380b2f4fea745f4db30e5cb2ac7f5a638b33c652.tar.gz
platform-system-core-380b2f4fea745f4db30e5cb2ac7f5a638b33c652.tar.xz
platform-system-core-380b2f4fea745f4db30e5cb2ac7f5a638b33c652.zip
libsync: Replace inserting tuple into unordered_map in favour of pair.
Inserting tuple into unordered_map relies on non standard libc++ extension: http://stackoverflow.com/a/21313229 This change removes this dependency. Test: sync-unit-tests (on hikey with SW_SYNC_USER built into kernel)
Diffstat (limited to 'libsync')
-rw-r--r--libsync/tests/sync_test.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/libsync/tests/sync_test.cpp b/libsync/tests/sync_test.cpp
index ff8a300f1..401aaeee5 100644
--- a/libsync/tests/sync_test.cpp
+++ b/libsync/tests/sync_test.cpp
@@ -536,7 +536,7 @@ TEST_P(MergeStressTest, RandomMerge) {
536 ASSERT_TRUE(fence.isValid()); 536 ASSERT_TRUE(fence.isValid());
537 537
538 unordered_map<int, int> fenceMap; 538 unordered_map<int, int> fenceMap;
539 fenceMap.insert(make_tuple(0, 0)); 539 fenceMap.insert(make_pair(0, 0));
540 540
541 // Randomly create syncpoints out of a fixed set of timelines, and merge them together. 541 // Randomly create syncpoints out of a fixed set of timelines, and merge them together.
542 for (int i = 0; i < mergeCount; i++) { 542 for (int i = 0; i < mergeCount; i++) {
@@ -549,12 +549,12 @@ TEST_P(MergeStressTest, RandomMerge) {
549 // Keep track of the latest syncpoint in each timeline. 549 // Keep track of the latest syncpoint in each timeline.
550 auto itr = fenceMap.find(timelineOffset); 550 auto itr = fenceMap.find(timelineOffset);
551 if (itr == end(fenceMap)) { 551 if (itr == end(fenceMap)) {
552 fenceMap.insert(tie(timelineOffset, syncPoint)); 552 fenceMap.insert(make_pair(timelineOffset, syncPoint));
553 } 553 }
554 else { 554 else {
555 int oldSyncPoint = itr->second; 555 int oldSyncPoint = itr->second;
556 fenceMap.erase(itr); 556 fenceMap.erase(itr);
557 fenceMap.insert(tie(timelineOffset, max(syncPoint, oldSyncPoint))); 557 fenceMap.insert(make_pair(timelineOffset, max(syncPoint, oldSyncPoint)));
558 } 558 }
559 559
560 // Merge. 560 // Merge.