Skip to content

Commit

Permalink
Use Name::append() rather than push_back()
Browse files Browse the repository at this point in the history
Change-Id: Ie2cbc50415e1c485f03902ac74191d1d8c81ce95
  • Loading branch information
Pesa committed Feb 9, 2024
1 parent 52d1326 commit 526d4c8
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 15 deletions.
24 changes: 19 additions & 5 deletions .jenkins.d/00-deps.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
#!/usr/bin/env bash
set -eo pipefail

APT_PKGS=(build-essential pkg-config python3-minimal
libboost-all-dev libssl-dev libsqlite3-dev)
APT_PKGS=(
build-essential
libboost-chrono-dev
libboost-date-time-dev
libboost-dev
libboost-filesystem-dev
libboost-log-dev
libboost-program-options-dev
libboost-stacktrace-dev
libboost-test-dev
libboost-thread-dev
libsqlite3-dev
libssl-dev
pkg-config
python3-minimal
)
FORMULAE=(boost openssl pkg-config)
PIP_PKGS=()
case $JOB_NAME in
Expand All @@ -25,10 +39,10 @@ if [[ $ID == macos ]]; then
brew update
brew install --formula "${FORMULAE[@]}"
elif [[ $ID_LIKE == *debian* ]]; then
sudo apt-get -qq update
sudo apt-get -qy install "${APT_PKGS[@]}"
sudo apt-get update -qq
sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
elif [[ $ID_LIKE == *fedora* ]]; then
sudo dnf -y install gcc-c++ libasan lld pkgconf-pkg-config python3 \
sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
boost-devel openssl-devel sqlite-devel
fi

Expand Down
6 changes: 3 additions & 3 deletions .jenkins.d/01-ndn-cxx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ sudo ./waf --color=yes install
popd >/dev/null
popd >/dev/null

if [[ $ID_LIKE == *fedora* ]]; then
sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
fi
if [[ $ID_LIKE == *linux* ]]; then
if [[ $(uname -m) == x86_64 && -d /usr/lib64 ]]; then
sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
fi
sudo ldconfig
fi
6 changes: 3 additions & 3 deletions .jenkins.d/10-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ fi
# Install
sudo ./waf --color=yes install

if [[ $ID_LIKE == *fedora* ]]; then
sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
fi
if [[ $ID_LIKE == *linux* ]]; then
if [[ $(uname -m) == x86_64 && -d /usr/lib64 ]]; then
sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
fi
sudo ldconfig
fi
3 changes: 2 additions & 1 deletion .jenkins.d/20-tests.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/usr/bin/env bash
set -eo pipefail

# https://github.com/google/sanitizers/wiki/SanitizerCommonFlags
# https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
ASAN_OPTIONS="color=always"
ASAN_OPTIONS+=":strip_path_prefix=${PWD}/"
ASAN_OPTIONS+=":check_initialization_order=1"
ASAN_OPTIONS+=":detect_stack_use_after_return=1"
ASAN_OPTIONS+=":strict_init_order=1"
ASAN_OPTIONS+=":strict_string_checks=1"
ASAN_OPTIONS+=":detect_invalid_pointer_pairs=2"
ASAN_OPTIONS+=":strip_path_prefix=${PWD}/"
export ASAN_OPTIONS

# https://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/runtime_config/summary.html
Expand Down
6 changes: 3 additions & 3 deletions src/name-assignment/assignment-email.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2017-2022, Regents of the University of California.
* Copyright (c) 2017-2024, Regents of the University of California.
*
* This file is part of ndncert, a certificate management system based on NDN.
*
Expand Down Expand Up @@ -47,12 +47,12 @@ AssignmentEmail::assignName(const std::multimap<std::string, std::string>& param
formatIter++;
}
else {
result.push_back(domain.substr(domainSplit + 1).c_str());
result.append(domain.substr(domainSplit + 1).data());
}
domain = domain.substr(0, domainSplit);
domainSplit = domain.rfind(".");
}
result.push_back(email.substr(0, emailSplit).c_str());
result.append(email.substr(0, emailSplit).data());
resultList.push_back(std::move(result));
}
}
Expand Down

0 comments on commit 526d4c8

Please sign in to comment.