[all-commits] [llvm/llvm-project] 70480f: [libc++] Validate vector<bool> copy/move-assignmen...

Peng Liu via All-commits all-commits at lists.llvm.org
Wed Mar 19 09:08:41 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 70480fcff64e2e389da8bc48043719a554893c6f
      https://github.com/llvm/llvm-project/commit/70480fcff64e2e389da8bc48043719a554893c6f
  Author: Peng Liu <winner245 at hotmail.com>
  Date:   2025-03-19 (Wed, 19 Mar 2025)

  Changed paths:
    M libcxx/test/std/containers/sequences/vector.bool/assign_copy.pass.cpp
    M libcxx/test/std/containers/sequences/vector.bool/assign_move.pass.cpp

  Log Message:
  -----------
  [libc++] Validate vector<bool> copy/move-assignment operators in realistic scenarios (#119817)

The existing tests for `vector<bool>` copy- and move-assignment
operators are limited to 3 bits only, which are inadequate to cover
realistic scenarios. Most `vector<bool>` operations have code paths that
are executed only when multiple storage words are involved, with each
storage word typically comprising 64 bits on a 64-bit platform.
Furthermore, the existing tests fail to cover all combinations
`POCCA`/`POCMA`, along with different allocator equality and/or
reallocation scenarios, leaving some critical code paths untested.

This patch enhances the test coverage by introducing new tests covering
up to 5 storage words, ensuring that partial words in the front or tail,
and whole words in the middle are all properly tested. Moreover, these
new tests ensure that the copy- and move-assignment operators are tested
under all combinations of `POCCA`/`POCMA` and various allocator equality
scenarios, both with or without reallocations.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list