use nullptr in unittest tree
This commit is contained in:
@ -108,21 +108,22 @@ TEST_F(LAMMPS_plain, TestStyles)
|
||||
const char *found;
|
||||
|
||||
const char *atom_styles[] = {"atomic", "body", "charge", "ellipsoid", "hybrid",
|
||||
"line", "sphere", "tri", NULL};
|
||||
for (int i = 0; atom_styles[i] != NULL; ++i) {
|
||||
"line", "sphere", "tri", nullptr};
|
||||
for (int i = 0; atom_styles[i] != nullptr; ++i) {
|
||||
found = lmp->match_style("atom", atom_styles[i]);
|
||||
EXPECT_STREQ(found, NULL);
|
||||
EXPECT_STREQ(found, nullptr);
|
||||
}
|
||||
|
||||
const char *molecule_atom_styles[] = {"angle", "bond", "full", "molecular", "template", NULL};
|
||||
for (int i = 0; molecule_atom_styles[i] != NULL; ++i) {
|
||||
const char *molecule_atom_styles[] = {"angle", "bond", "full",
|
||||
"molecular", "template", nullptr};
|
||||
for (int i = 0; molecule_atom_styles[i] != nullptr; ++i) {
|
||||
found = lmp->match_style("atom", molecule_atom_styles[i]);
|
||||
EXPECT_STREQ(found, "MOLECULE");
|
||||
}
|
||||
|
||||
const char *kokkos_atom_styles[] = {"angle/kk", "bond/kk", "full/kk",
|
||||
"molecular/kk", "hybrid/kk", NULL};
|
||||
for (int i = 0; kokkos_atom_styles[i] != NULL; ++i) {
|
||||
"molecular/kk", "hybrid/kk", nullptr};
|
||||
for (int i = 0; kokkos_atom_styles[i] != nullptr; ++i) {
|
||||
found = lmp->match_style("atom", kokkos_atom_styles[i]);
|
||||
EXPECT_STREQ(found, "KOKKOS");
|
||||
}
|
||||
@ -149,7 +150,7 @@ TEST_F(LAMMPS_plain, TestStyles)
|
||||
found = lmp->match_style("atom", "sph");
|
||||
EXPECT_STREQ(found, "SPH");
|
||||
found = lmp->match_style("atom", "i_don't_exist");
|
||||
EXPECT_STREQ(found, NULL);
|
||||
EXPECT_STREQ(found, nullptr);
|
||||
}
|
||||
|
||||
// test fixture for OpenMP with 2 threads
|
||||
|
||||
@ -47,7 +47,7 @@ void write_yaml_header(YamlWriter *writer, TestConfig *cfg, const char *version)
|
||||
writer->emit("lammps_version", version);
|
||||
|
||||
// date_generated
|
||||
std::time_t now = time(NULL);
|
||||
std::time_t now = time(nullptr);
|
||||
std::string block = trim(ctime(&now));
|
||||
writer->emit("date_generated", block);
|
||||
|
||||
|
||||
@ -31,9 +31,9 @@ YamlWriter::YamlWriter(const char *outfile)
|
||||
|
||||
yaml_stream_start_event_initialize(&event, YAML_UTF8_ENCODING);
|
||||
yaml_emitter_emit(&emitter, &event);
|
||||
yaml_document_start_event_initialize(&event, NULL, NULL, NULL, 0);
|
||||
yaml_document_start_event_initialize(&event, nullptr, nullptr, nullptr, 0);
|
||||
yaml_emitter_emit(&emitter, &event);
|
||||
yaml_mapping_start_event_initialize(&event, NULL, (yaml_char_t *)YAML_MAP_TAG, 1,
|
||||
yaml_mapping_start_event_initialize(&event, nullptr, (yaml_char_t *)YAML_MAP_TAG, 1,
|
||||
YAML_ANY_MAPPING_STYLE);
|
||||
yaml_emitter_emit(&emitter, &event);
|
||||
}
|
||||
@ -67,11 +67,11 @@ void YamlWriter::emit(const std::string &key, const int value)
|
||||
|
||||
void YamlWriter::emit(const std::string &key, const std::string &value)
|
||||
{
|
||||
yaml_scalar_event_initialize(&event, NULL, (yaml_char_t *)YAML_STR_TAG,
|
||||
yaml_scalar_event_initialize(&event, nullptr, (yaml_char_t *)YAML_STR_TAG,
|
||||
(yaml_char_t *)key.c_str(), key.size(), 1, 0,
|
||||
YAML_PLAIN_SCALAR_STYLE);
|
||||
yaml_emitter_emit(&emitter, &event);
|
||||
yaml_scalar_event_initialize(&event, NULL, (yaml_char_t *)YAML_STR_TAG,
|
||||
yaml_scalar_event_initialize(&event, nullptr, (yaml_char_t *)YAML_STR_TAG,
|
||||
(yaml_char_t *)value.c_str(), value.size(), 1, 0,
|
||||
YAML_PLAIN_SCALAR_STYLE);
|
||||
yaml_emitter_emit(&emitter, &event);
|
||||
@ -79,11 +79,11 @@ void YamlWriter::emit(const std::string &key, const std::string &value)
|
||||
|
||||
void YamlWriter::emit_block(const std::string &key, const std::string &value)
|
||||
{
|
||||
yaml_scalar_event_initialize(&event, NULL, (yaml_char_t *)YAML_STR_TAG,
|
||||
yaml_scalar_event_initialize(&event, nullptr, (yaml_char_t *)YAML_STR_TAG,
|
||||
(yaml_char_t *)key.c_str(), key.size(), 1, 0,
|
||||
YAML_PLAIN_SCALAR_STYLE);
|
||||
yaml_emitter_emit(&emitter, &event);
|
||||
yaml_scalar_event_initialize(&event, NULL, (yaml_char_t *)YAML_STR_TAG,
|
||||
yaml_scalar_event_initialize(&event, nullptr, (yaml_char_t *)YAML_STR_TAG,
|
||||
(yaml_char_t *)value.c_str(), value.size(), 1, 0,
|
||||
YAML_LITERAL_SCALAR_STYLE);
|
||||
yaml_emitter_emit(&emitter, &event);
|
||||
|
||||
Reference in New Issue
Block a user