Lib:Test Specification Document

From GNUpdf

Example sunflower image
Note: This page is automatically generated


Contents

GNU PDF Library Test Specification Document

GNU PDF Library Test Specification Document

This is the GNU PDF Library Test Specification Document, updated for libgnupdf version 0.1.

Copyright © 2007, 2008 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".


Unit Testing

Base Layer Modules

Memory Allocation Module

pdf_alloc

Test: pdf_alloc_001

Allocate some bytes.

Success condition

The call should not produce an error.


pdf_realloc

Test: pdf_realloc_001

Get more memory.

Success condition

  • The call should not produce an error.
  • The previous contents of the buffer should still be there.

Test: pdf_realloc_002

Reduce the size of a memory buffer.

Success condition

  • The call should not produce an error.
  • The truncated previous contents of the buffer should still be there.


pdf_dealloc

Test: pdf_dealloc_001

Deallocate memory.

Success condition

The call should not produce an error.


Filesystem Module

pdf_fsys_open

Test: pdf_fsys_open_001

Open an existent and readable file for reading.

Success condition

pdf_fsys_open should return PDF_OK.

Test: pdf_fsys_open_002

Open a non-existent and writable file for writing.

Success condition

pdf_fsys_open should return PDF_OK.

Test: pdf_fsys_open_003

Open an existing and writable file for writing.

Success condition

pdf_fsys_open should return PDF_OK.

Test: pdf_fsys_open_004

Open an existing, readable and writable file for reading and writing.

Success condition

pdf_fsys_open should return PDF_OK.


Stream Module

pdf_stm_mem_new

Test: pdf_stm_mem_new_001

Create a new memory-based reading stream.

Success condition

pdf_stm_mem_new should return a PDF_OK.


pdf_stm_read

Test: pdf_stm_read_001

Read some bytes from a reading memory stream.

Success condition

The readed data should be consistent.

Test: pdf_stm_read_002

Read bytes from a reading memory stream getting and EOF condition in the returned value.

Success condition

The readed data should be consistent and we should get and EOF condition in the returned value.

Test: pdf_stm_read_003

Read bytes from a reading memory stream in several steps.

Success condition

The readed data should be consistent.

Test: pdf_stm_read_004

Read some bytes from a reading memory cache with two null filters installed.

Success condition

The readed data should be consistent.

Test: pdf_stm_read_005

Create a memory-based reading stream and attach a RunLength filter decoder to it.

Success condition

The decoded data should be correct.

Test: pdf_stm_read_006

Read some bytes from a read memory stream with an ASCII Hex decoder.

Success condition

The decoded data should be correct.

Test: pdf_stm_read_007

Read some bytes from a read memory stream with an ASCII Hex decoder having white characters in the data.

Success condition

The decoded data should be correct.

Test: pdf_stm_read_008

Read some bytes from a read memory stream with an ASCII Hex decoder having an even number of hex digits in the input.

Success condition

The decoded data should be correct.


Test: pdf_stm_read_009

Create a memory-based reading stream and attach a flate filter decoder to it.

Success condition

The decoded data should be correct.


pdf_stm_read_char

Test: pdf_stm_read_char_001

Read a character from a memory stream.

Success condition

The read character should be ok.

Test: pdf_stm_read_char_002

Read a character from an empty memory stream.

Success condition

The read character should be PDF_EOF.


pdf_stm_peek_char

Test: pdf_stm_peek_char_001

Peek a character from a memory stream.

Success condition

The peek character should be ok.

Test: pdf_stm_peek_char_002

Peek a character from an empty memory stream.

Success condition

The peek character should be PDF_EOF.


pdf_stm_seek

Test: pdf_stm_seek_001

Seek into a memory read stream.

Success condition

The seek operation should success.

Test: pdf_stm_seek_002

Seek to a position beyond the size of the stream into a memory read stream.

Success condition

The seek operation should success and the seek position should be to the last valid position in the stream.


pdf_stm_tell

Test: pdf_stm_tell_001

Tell an initialized reading memory stream.

Success condition

The tell operation should report the first position in the stream (0).


pdf_stm_write

Test: pdf_stm_write_001

Write some bytes to a write memory stream.

Success condition

The written data should be consistent.

Test: pdf_stm_write_002

Write some bytes to a write memory stream with two null filter installed.

Success condition

The written data should be consistent.

Test: pdf_stm_write_003

Write some bytes to a write memory stream producing a cache flush.

Success condition

The written data should be consistent.

Test: pdf_stm_write_004

Write some bytes to a write memory stream with an ASCII Hex encoder.

Success condition

The written data should be consistent.

Test: pdf_stm_write_005

Create a memory-based writing stream and attach a RunLength filter encoder to it.

Success condition

The encoded data should be correct.

Test: pdf_stm_write_006

Write some bytes to a write memory stream with an ASCII Hex encoder, generating new lines.

Success condition

The encoded data should be correct.


Test: pdf_stm_write_007

Create a memory-based writing stream and attach a flate filter encoder to it.

Success condition

The encoded data should be correct.



Text Module

pdf_text_init

Test: pdf_text_init_001

Initialize text module

Success conditions

1. The call should not produce an error.

2. A valid (non-empty) host encoding should be detected.

3. A valid host endianness should be detected (either LE or BE).

4. A valid (non-empty) host EOL marker should be detected.

5. A valid (non-empty) language ID should be detected.


pdf_text_new_destroy

Test: pdf_text_new_destroy_001

Create an empty text object and destroy it

Success conditions

1. The call to pdf_text_new should not return a NULL pointer.

2. The text data of the created object should be empty.

3. The language code of the output object should be empty

4. The country code of the output object should be empty

5. The call to pdf_text_destroy should return PDF_OK;


pdf_text_dup

Test: pdf_text_dup_001

Duplicate an empty text object

Success conditions

1. The call to pdf_text_dup should not return a NULL pointer.

2. The text data of the created object should be empty.

3. The language code of the output object should be empty

4. The country code of the output object should be empty

Test: pdf_text_dup_002

Duplicate a text object with data contents but no language/country code

Success conditions

1. The call to pdf_text_dup should not return a NULL pointer.

2. The text data of the output object should be equal to the text data of the input object.

3. The language code of the output object should be empty

4. The country code of the output object should be empty

Test: pdf_text_dup_003

Duplicate a text object with data contents and language code

Success conditions

1. The call to pdf_text_dup should not return a NULL pointer.

2. The text data of the output object should be equal to the text data of the input object.

3. The language code of the output object should be equal to the language code of the input object.

4. The country code of the output object should be empty.

Test: pdf_text_dup_004

Duplicate a text object with data contents, language code and country code

Success conditions

1. The call to pdf_text_dup should not return a NULL pointer.

2. The text data of the output object should be equal to the text data of the input object.

3. The language code of the output object should be equal to the language code of the input object.

4. The country code of the output object should be equal to the country code of the input object.


pdf_text_new_from_host

Test: pdf_text_new_from_host_001

Create a text object with an input valid host-encoded string

Success conditions

1. The call to pdf_text_new_from_host should return PDF_OK.

2. The contents of the text object must be the expected ones.

Test: pdf_text_new_from_host_002

Create a text object with an input invalid host-encoded string

Success conditions

1. The call to pdf_text_new_from_host should NOT return PDF_OK.

Test: pdf_text_new_from_host_003

Create a text object with an input string encoded in an invalid host encoding

Success conditions

1. The call to pdf_text_new_from_host should NOT return PDF_OK.


pdf_text_new_from_pdf_string

Test: pdf_text_new_from_pdf_string_001

Create a text object with an input valid PDF-Doc-Encoded string

Success conditions

1. The call to pdf_text_new_from_pdf_string should return PDF_OK.

2. The contents of the text object must be the expected ones.

3. The language code within the text object must be empty.

4. The country code within the text object must be empty.

5. The call should return a NULL remaining_str pointer and a zero remaining_length

Test: pdf_text_new_from_pdf_string_002

Create a text object with an input invalid PDF-Doc-Encoded string

Success conditions

1. The call to pdf_text_new_from_pdf_string should NOT return PDF_OK.

2. Pointer to the text object must remain unchanged.

Test: pdf_text_new_from_pdf_string_003

Create a text object with an input valid UTF-16BE encoded string with BOM (containing both 16-bit and 32-bit UTF-16 code points!) and without lang/country information.

Success conditions

1. The call to pdf_text_new_from_pdf_string should return PDF_OK.

2. The function should return a valid pointer to the new text object.

3. The contents of the text object must be the expected ones.

4. The language code within the text object must be empty.

5. The country code within the text object must be empty.

5. The call should return a NULL remaining_str pointer and a zero remaining_length

Test: pdf_text_new_from_pdf_string_004

Create a text object with an input valid UTF-16BE encoded string without BOM

Success conditions

1. The call to pdf_text_new_from_pdf_string should NOT return PDF_OK.

2. Pointer to the text object must remain unchanged.

Test: pdf_text_new_from_pdf_string_005

Create a text object with an input invalid UTF-16BE encoded string with BOM

Success conditions

1. The call to pdf_text_new_from_pdf_string should NOT return PDF_OK.

2. Pointer to the text object must remain unchanged.

Test: pdf_text_new_from_pdf_string_006

Create a text object with an input valid UTF-16BE encoded string with BOM (containing both 16-bit and 32-bit UTF-16 code points!) which also contains a valid language code embedded.

Success conditions

1. The call to pdf_text_new_from_pdf_string should return PDF_OK.

2. The function should return a valid pointer to the new text object

3. The contents of the text object must be the expected ones.

4. The languange code within the text object must be the expected one.

5. The country code within the text object must be empty.

6. The call should return a NULL remaining_str pointer and a zero remaining_length

Test: pdf_text_new_from_pdf_string_007

Create a text object with an input valid UTF-16BE encoded string with BOM (containing both 16-bit and 32-bit UTF-16 code points!) which also contains a valid language code and a valid country code embedded.

Success conditions

1. The call to pdf_text_new_from_pdf_string should return PDF_OK.

2. The function should return a valid pointer to the new text object

3. The contents of the text object must be the expected ones.

4. The languange code within the text object must be the expected one.

5. The country code within the text object must be the expected one.

6. The call should return a NULL remaining_str pointer and a zero remaining_length

Test: pdf_text_new_from_pdf_string_008

Create a text object with an input valid UTF-16BE encoded string with BOM (containing both 16-bit and 32-bit UTF-16 code points!) which also contains more than one (three) valid language code embedded (the string contains more than one string in more than one different language).

Success conditions

1. The first call to pdf_text_new_from_pdf_string should return PDF_OK.

2. The first call should return a valid pointer to the new text object

3. The contents of the first text object must be the expected ones.

4. The languange code within the first text object must be the expected one.

5. The country code within the first text object must be empty.

6. The first call should return a valid remaining_str pointer and a non-zero remaining_length

7. The second call to pdf_text_new_from_pdf_string should return PDF_OK.

8. The second call should return a valid pointer to the new text object

9. The contents of the second text object must be the expected ones.

10. The languange code within the second text object must be the expected one.

11. The country code within the second text object must be empty.

12. The second call should return a valid remaining_str pointer and a non-zero remaining_length

13. The third call to pdf_text_new_from_pdf_string should return PDF_OK.

14. The third call should return a valid pointer to the new text object

15. The contents of the third text object must be the expected ones.

16. The languange code within the third text object must be the expected one.

17. The country code within the third text object must be empty.

18. The second call should return a NULL remaining_str pointer and a zero remaining_length

Test: pdf_text_new_from_pdf_string_009

Create a text object with an input valid UTF-16BE encoded string with BOM (containing both 16-bit and 32-bit UTF-16 code points!) which also contains more than one (three) valid language code and a valid country code embedded (the string contains more than one string in more than one different language/country).

Success conditions

1. The first call to pdf_text_new_from_pdf_string should return PDF_OK.

2. The first call should return a valid pointer to the new text object

3. The contents of the first text object must be the expected ones.

4. The languange code within the first text object must be the expected one.

5. The country code within the first text object must be the expected one.

6. The first call should return a valid remaining_str pointer and a non-zero remaining_length

7. The second call to pdf_text_new_from_pdf_string should return PDF_OK.

8. The second call should return a valid pointer to the new text object

9. The contents of the second text object must be the expected ones.

10. The languange code within the second text object must be the expected one.

11. The country code within the second text object must be the expected one.

12. The second call should return a valid remaining_str pointer and a non-zero remaining_length

13. The third call to pdf_text_new_from_pdf_string should return PDF_OK.

14. The third call should return a valid pointer to the new text object

15. The contents of the third text object must be the expected ones.

16. The languange code within the third text object must be the expected one.

17. The country code within the third text object must be the expected one.

18. The second call should return a NULL remaining_str pointer and a zero remaining_length


pdf_text_new_from_unicode

Test: pdf_text_new_from_unicode_001

Create a text object with an input valid UTF-8 encoded string (containing 8-bit, 16-bit, 24-bit and 32-bit code points!) without BOM

Success conditions

1. The call to pdf_text_new_from_unicode should return PDF_OK.

2. The function should return a valid pointer to the new text object

3. The contents of the text object must be the expected ones (without BOM).

4. The language code within the text object must be empty.

5. The country code within the text object must be empty.

Test: pdf_text_new_from_unicode_002

Create a text object with an input valid UTF-16BE encoded string (16-bit and 32-bit code points!) without BOM

Success conditions

1. The call to pdf_text_new_from_unicode should return PDF_OK.

2. The function should return a valid pointer to the new text object

3. The contents of the text object must be the expected ones (without BOM).

4. The language code within the text object must be empty.

5. The country code within the text object must be empty.

Test: pdf_text_new_from_unicode_003

Create a text object with an input valid UTF-16LE encoded string (16-bit and 32-bit code points!) without BOM

Success conditions

1. The call to pdf_text_new_from_unicode should return PDF_OK.

2. The function should return a valid pointer to the new text object

3. The contents of the text object must be the expected ones (without BOM).

4. The language code within the text object must be empty.

5. The country code within the text object must be empty.

Test: pdf_text_new_from_unicode_004

Create a text object with an input valid UTF-16HE encoded string (16-bit and 32-bit code points!) without BOM

Success conditions

1. The call to pdf_text_new_from_unicode should return PDF_OK.

2. The function should return a valid pointer to the new text object

3. The contents of the text object must be the expected ones (without BOM).

4. The language code within the text object must be empty.

5. The country code within the text object must be empty.

Test: pdf_text_new_from_unicode_005

Create a text object with an input valid UTF-32BE encoded string without BOM

Success conditions

1. The call to pdf_text_new_from_unicode should return PDF_OK.

2. The function should return a valid pointer to the new text object

3. The contents of the text object must be the expected ones (without BOM).

4. The language code within the text object must be empty.

5. The country code within the text object must be empty.

Test: pdf_text_new_from_unicode_006

Create a text object with an input valid UTF-32LE encoded string without BOM

Success conditions

1. The call to pdf_text_new_from_unicode should return PDF_OK.

2. The function should return a valid pointer to the new text object

3. The contents of the text object must be the expected ones (without BOM).

4. The language code within the text object must be empty.

5. The country code within the text object must be empty.

Test: pdf_text_new_from_unicode_007

Create a text object with an input valid UTF-32HE encoded string without BOM

Success conditions

1. The call to pdf_text_new_from_unicode should return PDF_OK.

2. The function should return a valid pointer to the new text object

3. The contents of the object must be completely equal to the input data

4. The language code within the text object must be empty.

5. The country code within the text object must be empty.

Test: pdf_text_new_from_unicode_008

Create a text object with an input valid UTF-8 encoded string (containing 8-bit, 16-bit, 24-bit and 32-bit code points!) with BOM

Success conditions

1. The call to pdf_text_new_from_unicode should return PDF_OK.

2. The function should return a valid pointer to the new text object

3. The contents of the text object must be the expected ones (without BOM).

4. The language code within the text object must be empty.

5. The country code within the text object must be empty.

Test: pdf_text_new_from_unicode_009

Create a text object with an input valid UTF-16BE encoded string (16-bit and 32-bit code points!) with BOM

Success conditions

1. The call to pdf_text_new_from_unicode should return PDF_OK.

2. The function should return a valid pointer to the new text object

3. The contents of the text object must be the expected ones (without BOM).

4. The language code within the text object must be empty.

5. The country code within the text object must be empty.

Test: pdf_text_new_from_unicode_010

Create a text object with an input valid UTF-16LE encoded string (16-bit and 32-bit code points!) with BOM

Success conditions

1. The call to pdf_text_new_from_unicode should return PDF_OK.

2. The function should return a valid pointer to the new text object

3. The contents of the text object must be the expected ones (without BOM).

4. The language code within the text object must be empty.

5. The country code within the text object must be empty.

Test: pdf_text_new_from_unicode_011

Create a text object with an input valid UTF-16HE encoded string (16-bit and 32-bit code points!) with BOM

Success conditions

1. The call to pdf_text_new_from_unicode should return PDF_OK.

2. The function should return a valid pointer to the new text object

3. The contents of the text object must be the expected ones (without BOM).

4. The language code within the text object must be empty.

5. The country code within the text object must be empty.

Test: pdf_text_new_from_unicode_012

Create a text object with an input valid UTF-32BE encoded string with BOM

Success conditions

1. The call to pdf_text_new_from_unicode should return PDF_OK.

2. The function should return a valid pointer to the new text object

3. The contents of the text object must be the expected ones (without BOM).

4. The language code within the text object must be empty.

5. The country code within the text object must be empty.

Test: pdf_text_new_from_unicode_013

Create a text object with an input valid UTF-32LE encoded string with BOM

Success conditions

1. The call to pdf_text_new_from_unicode should return PDF_OK.

2. The function should return a valid pointer to the new text object

3. The contents of the text object must be the expected ones (without BOM).

4. The language code within the text object must be empty.

5. The country code within the text object must be empty.

Test: pdf_text_new_from_unicode_014

Create a text object with an input valid UTF-32HE encoded string with BOM

Success conditions

1. The call to pdf_text_new_from_unicode should return PDF_OK.

2. The function should return a valid pointer to the new text object

3. The contents of the object must be completely equal to the input data

4. The language code within the text object must be empty.

5. The country code within the text object must be empty.


Test: pdf_text_new_from_unicode_015

Create a text object with an input invalid UTF-8 encoded string without BOM

Success conditions

1. The call to pdf_text_new_from_unicode should NOT return PDF_OK.

2. Pointer to the text object must remain unchanged.

Test: pdf_text_new_from_unicode_016

Create a text object with an input invalid UTF-16BE encoded string without BOM

Success conditions

1. The call to pdf_text_new_from_unicode should NOT return PDF_OK.

2. Pointer to the text object must remain unchanged.

Test: pdf_text_new_from_unicode_017

Create a text object with an input invalid UTF-16LE encoded string without BOM

Success conditions

1. The call to pdf_text_new_from_unicode should NOT return PDF_OK.

2. Pointer to the text object must remain unchanged.

Test: pdf_text_new_from_unicode_018

Create a text object with an input invalid UTF-16HE encoded string without BOM

Success conditions

1. The call to pdf_text_new_from_unicode should NOT return PDF_OK.

2. Pointer to the text object must remain unchanged.

Test: pdf_text_new_from_unicode_019

Create a text object with an input invalid UTF-32BE encoded string without BOM

Success conditions

1. The call to pdf_text_new_from_unicode should NOT return PDF_OK.

2. Pointer to the text object must remain unchanged.

Test: pdf_text_new_from_unicode_020

Create a text object with an input invalid UTF-32LE encoded string without BOM

Success conditions

1. The call to pdf_text_new_from_unicode should NOT return PDF_OK.

2. Pointer to the text object must remain unchanged.

Test: pdf_text_new_from_unicode_021

Create a text object with an input invalid UTF-32HE encoded string without BOM

Success conditions

1. The call to pdf_text_new_from_unicode should NOT return PDF_OK.

2. Pointer to the text object must remain unchanged.


pdf_text_new_from_u32

Test: pdf_text_new_from_u32_001

Create a text object given '0' as input number

Success conditions

1. The call to pdf_text_new_from_u32 should return PDF_OK.

2. The contents of the text object must be the expected ones.

Test: pdf_text_new_from_u32_001

Create a text object given a non-zero positive number

Success conditions

1. The call to pdf_text_new_from_u32 should return PDF_OK.

2. The contents of the text object must be the expected ones.


pdf_text_get_country

Test: pdf_text_get_country_001

Get country ID when the stored country ID is valid

Success conditions

1. The call to pdf_text_get_country should return a valid pointer.

2. The length of the returned string should be 2.

Test: pdf_text_get_country_002

Get country ID when the stored country ID is invalid

Success conditions

1. The call to pdf_text_get_country should return a valid pointer.

2. The length of the returned string should be 0.


pdf_text_get_language

Test: pdf_text_get_language_001

Get language ID when the stored language ID is valid

Success conditions

1. The call to pdf_text_get_language should return a valid pointer.

2. The length of the returned string should be 2.

Test: pdf_text_get_language_002

Get language ID when the stored language ID is invalid

Success conditions

1. The call to pdf_text_get_language should return a valid pointer.

2. The length of the returned string should be 0.


pdf_text_set_country

Test: pdf_text_set_country_001

Set a valid two-character country ID

Success conditions

1. The call to pdf_text_set_country should return PDF_OK.

2. The contents of the internal country ID representation should be the expected ones.

Test: pdf_text_set_country_002

Set an invalid one-character country ID

Success conditions

1. The call to pdf_text_set_country should NOT return PDF_OK.

Test: pdf_text_set_country_003

Set an invalid empty country ID

Success conditions

1. The call to pdf_text_set_country should NOT return PDF_OK.


pdf_text_set_language

Test: pdf_text_set_language_001

Set a valid two-character language ID

Success conditions

1. The call to pdf_text_set_language should return PDF_OK.

2. The contents of the internal language ID representation should be the expected ones.

Test: pdf_text_set_language_002

Set an invalid one-character language ID

Success conditions

1. The call to pdf_text_set_language should NOT return PDF_OK.

Test: pdf_text_set_language_003

Set an invalid empty language ID

Success conditions

1. The call to pdf_text_set_language should NOT return PDF_OK.


pdf_text_empty_p

Test: pdf_text_empty_p_001

Check if a given empty text object is empty

Success conditions

1. The call to pdf_text_empty_p should return PDF_TRUE.

Test: pdf_text_empty_p_002

Check if a given non-empty text object is empty

Success conditions

1. The call to pdf_text_empty_p should return PDF_FALSE.


pdf_text_get_host_encoding

Test: pdf_text_get_host_encoding_001

Get the host encoding configured by the user. As this test really depends on what the user has configured in the system, the unit test will only check that a non-empty host encoding is returned.

Success conditions

1. The call to pdf_text_get_host_encoding should return a non-empty pdf_text_host_encoding_t variable.


pdf_text_check_host_encoding

Test: pdf_text_check_host_encoding_001

Check if a given valid host encoding is available in the system. ASCII-7 is considered as the host encoding that every system should at least have, so the test will check for it.

Success conditions

1. The call to pdf_text_check_host_encoding should return PDF_OK.

2. A non-empty pdf_text_host_encoding_t variable should be returned as well.

Test: pdf_text_check_host_encoding_002

Check if a given invalid host encoding is available in the system. An inexistent host encoding will be requested.

Success conditions

1. The call to pdf_text_check_host_encoding should NOT return PDF_OK.

2. The pdf_text_host_encoding_t variable should remain unchanged.


pdf_text_get_best_encoding

Test: pdf_text_get_best_encoding_001

Check if a best encoding is returned. If available, it must return a valid Unicode-based host encoding. If no Unicode encoding is available, it should return the preferred encoding. As this test really depends on what the user has configured in the system, the unit test will only check that a non-empty host encoding is returned.

Success conditions

1. The call to pdf_text_get_best_encoding should return a non-empty pdf_text_host_encoding_t variable.


pdf_text_get_host

Test: pdf_text_get_host_001

Get the contents of a text object in a valid host encoding

Success conditions

1. The call to pdf_text_get_host should return PDF_OK.

2. The returned string must be the expected one.

Test: pdf_text_get_host_002

Get the contents of a text object in an invalid host encoding

Success conditions

1. The call to pdf_text_get_host should NOT return PDF_OK.


pdf_text_get_pdfdocenc

Test: pdf_text_get_pdfdocenc_001

Get the contents of a text object in PDF Doc Encoding. The contents of the text object can all be transformed to PDF Doc Encoding without loss of information.

Success conditions

1. The call to pdf_text_get_pdfdocenc should return PDF_OK.

2. The returned string must be the expected one, and NUL terminated

Test: pdf_text_get_pdfdocenc_002

Get the contents of a text object in PDF Doc Encoding. The contents of the text object cannot be transformed to PDF Doc Encoding without loss of information. A default character must be used for those characters that cannot be represented in PDF Doc Encoding.

Success conditions

1. The call to pdf_text_get_pdfdocenc should return PDF_OK.

2. The returned string must be the expected one, and NUL terminated


pdf_text_get_unicode

Test: pdf_text_get_unicode_001

Get the contents of a non-empty text object in UTF-8 without BOM. The contents of the text object include characters that are encoded in UTF-8 using 8-bit, 16-bit, 24-bit and 32-bit.

Success conditions

1. The call to pdf_text_get_unicode should return PDF_OK.

2. The returned string must be the expected one, not NUL terminated.

3. The returned length must be the expected one.

Test: pdf_text_get_unicode_002

Get the contents of a non-empty text object in UTF-8 with BOM. The contents of the text object include characters that are encoded in UTF-8 using 8-bit, 16-bit, 24-bit and 32-bit.

Success conditions

1. The call to pdf_text_get_unicode should return PDF_OK.

2. The returned string must be the expected one, not NUL terminated.

3. The returned length must be the expected one, including the length of the BOM in UTF-8.

Test: pdf_text_get_unicode_003

Get the contents of an empty text object in UTF-8 without BOM.

Success conditions

1. The call to pdf_text_get_unicode should return PDF_OK.

2. The returned string must be NULL.

3. The returned length must be zero.

Test: pdf_text_get_unicode_004

Get the contents of an empty text object in UTF-8 with BOM.

Success conditions

1. The call to pdf_text_get_unicode should return PDF_OK.

2. The returned string must only contain the BOM in UTF-8, not NUL terminated.

3. The returned length must be equal to the length of the BOM in UTF-8.

Test: pdf_text_get_unicode_005

Get the contents of a non-empty text object with lang/country info, in UTF-8 without BOM and with lang/country information embedded (which should not be supported in UTF-8).

Success conditions

1. The call to pdf_text_get_unicode should NOT return PDF_OK.

Test: pdf_text_get_unicode_006

Get the contents of a non-empty text object with lang/country info, in UTF-8 with BOM and with lang/country information embedded (which should not be supported in UTF-8).

Success conditions

1. The call to pdf_text_get_unicode should NOT return PDF_OK.


Test: pdf_text_get_unicode_007

Get the contents of a non-empty text object in UTF-16BE without BOM. The contents of the text object include characters that are encoded in UTF-16 using 16-bit and 32-bit.

Success conditions

1. The call to pdf_text_get_unicode should return PDF_OK.

2. The returned string must be the expected one, not NUL terminated.

3. The returned length must be the expected one.

Test: pdf_text_get_unicode_008

Get the contents of a non-empty text object in UTF-16BE with BOM. The contents of the text object include characters that are encoded in UTF-16 using 16-bit and 32-bit.

Success conditions

1. The call to pdf_text_get_unicode should return PDF_OK.

2. The returned string must be the expected one, not NUL terminated.

3. The returned length must be the expected one, including the length of the BOM in UTF-16.

Test: pdf_text_get_unicode_009

Get the contents of an empty text object in UTF-16BE without BOM.

Success conditions

1. The call to pdf_text_get_unicode should return PDF_OK.

2. The returned string must be NULL.

3. The returned length must be zero.

Test: pdf_text_get_unicode_010

Get the contents of an empty text object in UTF-16BE with BOM.

Success conditions

1. The call to pdf_text_get_unicode should return PDF_OK.

2. The returned string must only contain the BOM in UTF-16BE, not NUL terminated.

3. The returned length must be equal to the length of the BOM in UTF-16.

Test: pdf_text_get_unicode_011

Get the contents of a non-empty text object with lang/country info, in UTF-16BE without BOM and with lang/country information embedded (which IS supported in UTF-16BE).

Success conditions

1. The call to pdf_text_get_unicode should return PDF_OK.

2. The returned string must be the expected one, including the lang/country information embedded, not NUL terminated.

3. The returned length must be the expected one, including the length of the lang/country info.

Test: pdf_text_get_unicode_012

Get the contents of a non-empty text object with language info (no country info), in UTF-16BE without BOM and with lang/country information embedded (which IS supported in UTF-16BE).

Success conditions

1. The call to pdf_text_get_unicode should return PDF_OK.

2. The returned string must be the expected one, including the language information embedded, not NUL terminated.

3. The returned length must be the expected one, including the length of the language info.

Test: pdf_text_get_unicode_013

Get the contents of an empty text object with lang/country info, in UTF-16BE without BOM and with lang/country information embedded (which IS supported in UTF-16BE).

Success conditions

1. The call to pdf_text_get_unicode should return PDF_OK.

2. The returned string must only include the lang/country information embedded, not NUL terminated.

3. The returned length must be equal to the length of the lang/country info.

Test: pdf_text_get_unicode_014

Get the contents of an empty text object with language info (no country info), in UTF-16BE without BOM and with lang/country information embedded (which IS supported in UTF-16BE).

Success conditions

1. The call to pdf_text_get_unicode should return PDF_OK.

2. The returned string must only contain the language information embedded, not NUL terminated.

3. The returned length must be equal to the length of the language info.

Test: pdf_text_get_unicode_015

Get the contents of a non-empty text object with lang/country info, in UTF-16BE with BOM and with lang/country information embedded (which IS supported in UTF-16BE).

Success conditions

1. The call to pdf_text_get_unicode should return PDF_OK.

2. The returned string must be the expected one, including the BOM and the lang/country information embedded, not NUL terminated.

3. The returned length must be the expected one, including the length of the lang/country info and the BOM.

Test: pdf_text_get_unicode_016

Get the contents of a non-empty text object with language info (no country info), in UTF-16BE with BOM and with lang/country information embedded (which IS supported in UTF-16BE).

Success conditions

1. The call to pdf_text_get_unicode should return PDF_OK.

2. The returned string must be the expected one, including the BOM and the language information embedded, not NUL terminated.

3. The returned length must be the expected one, including the length of the language info and the BOM.

Test: pdf_text_get_unicode_017

Get the contents of an empty text object with lang/country info, in UTF-16BE with BOM and with lang/country information embedded (which IS supported in UTF-16BE).

Success conditions

1. The call to pdf_text_get_unicode should return PDF_OK.

2. The returned string must only include the BOM and lang/country information embedded, not NUL terminated.

3. The returned length must be equal to the length of the lang/country info plus the length of the BOM.

Test: pdf_text_get_unicode_018

Get the contents of an empty text object with language info (no country info), in UTF-16BE with BOM and with lang/country information embedded (which IS supported in UTF-16BE).

Success conditions

1. The call to pdf_text_get_unicode should return PDF_OK.

2. The returned string must only contain the BOM and the language information embedded, not NUL terminated.

3. The returned length must be equal to the length of the language info plus the length of the BOM.

Test: pdf_text_get_unicode_019

Get the contents of a non-empty text object in UTF-16LE without BOM. The contents of the text object include characters that are encoded in UTF-16 using 16-bit and 32-bit.

Success conditions

1. The call to pdf_text_get_unicode should return PDF_OK.

2. The returned string must be the expected one, not NUL terminated.

3. The returned length must be the expected one.

Test: pdf_text_get_unicode_020

Get the contents of a non-empty text object in UTF-16LE with BOM. The contents of the text object include characters that are encoded in UTF-16 using 16-bit and 32-bit.

Success conditions

1. The call to pdf_text_get_unicode should return PDF_OK.

2. The returned string must be the expected one, not NUL terminated.

3. The returned length must be the expected one, including the length of the BOM in UTF-16.

Test: pdf_text_get_unicode_021

Get the contents of an empty text object in UTF-16LE without BOM.

Success conditions

1. The call to pdf_text_get_unicode should return PDF_OK.

2. The returned string must be NULL.

3. The returned length must be zero.

Test: pdf_text_get_unicode_022

Get the contents of an empty text object in UTF-16LE with BOM.

Success conditions

1. The call to pdf_text_get_unicode should return PDF_OK.

2. The returned string must only contain the BOM in UTF-16LE, not NUL terminated.

3. The returned length must be equal to the length of the BOM in UTF-16.

Test: pdf_text_get_unicode_023

Get the contents of a non-empty text object with lang/country info, in UTF-16LE without BOM and with lang/country information embedded (which is NOT supported in UTF-16LE).

Success conditions

1. The call to pdf_text_get_unicode should NOT return PDF_OK.

Test: pdf_text_get_unicode_024

Get the contents of a non-empty text object with language info (no country info), in UTF-16LE without BOM and with lang/country information embedded (which is NOT supported in UTF-16LE).

Success conditions

1. The call to pdf_text_get_unicode should NOT return PDF_OK.

Test: pdf_text_get_unicode_025

Get the contents of an empty text object with lang/country info, in UTF-16LE without BOM and with lang/country information embedded (which is NOT supported in UTF-16LE).

Success conditions

1. The call to pdf_text_get_unicode should NOT return PDF_OK.

Test: pdf_text_get_unicode_026

Get the contents of an empty text object with language info (no country info), in UTF-16LE without BOM and with lang/country information embedded (which is NOT supported in UTF-16LE).

Success conditions

1. The call to pdf_text_get_unicode should NOT return PDF_OK.

Test: pdf_text_get_unicode_027

Get the contents of a non-empty text object with lang/country info, in UTF-16LE with BOM and with lang/country information embedded (which is NOT supported in UTF-16LE).

Success conditions

1. The call to pdf_text_get_unicode should NOT return PDF_OK.

Test: pdf_text_get_unicode_028

Get the contents of a non-empty text object with language info (no country info), in UTF-16LE with BOM and with lang/country information embedded (which is NOT supported in UTF-16LE).

Success conditions

1. The call to pdf_text_get_unicode should NOT return PDF_OK.

Test: pdf_text_get_unicode_029

Get the contents of an empty text object with lang/country info, in UTF-16LE with BOM and with lang/country information embedded (which is NOT supported in UTF-16LE).

Success conditions

1. The call to pdf_text_get_unicode should NOT return PDF_OK.

Test: pdf_text_get_unicode_030

Get the contents of an empty text object with language info (no country info), in UTF-16LE with BOM and with lang/country information embedded (which is NOT supported in UTF-16LE).

Success conditions

1. The call to pdf_text_get_unicode should NOT return PDF_OK.

Test: pdf_text_get_unicode_031

Get the contents of a non-empty text object in UTF-32BE without BOM.

Success conditions

1. The call to pdf_text_get_unicode should return PDF_OK.

2. The returned string must be the expected one, not NUL terminated.

3. The returned length must be the expected one.

Test: pdf_text_get_unicode_032

Get the contents of a non-empty text object in UTF-32BE with BOM.

Success conditions

1. The call to pdf_text_get_unicode should return PDF_OK.

2. The returned string must be the expected one, not NUL terminated.

3. The returned length must be the expected one, including the length of the BOM in UTF-32.

Test: pdf_text_get_unicode_033

Get the contents of an empty text object in UTF-32BE without BOM.

Success conditions

1. The call to pdf_text_get_unicode should return PDF_OK.

2. The returned string must be NULL.

3. The returned length must be zero.

Test: pdf_text_get_unicode_034

Get the contents of an empty text object in UTF-32BE with BOM.

Success conditions

1. The call to pdf_text_get_unicode should return PDF_OK.

2. The returned string must only contain the BOM in UTF-32BE, not NUL terminated.

3. The returned length must be equal to the length of the BOM in UTF-32.

Test: pdf_text_get_unicode_035

Get the contents of a non-empty text object with lang/country info, in UTF-32BE without BOM and with lang/country information embedded (which is NOT supported in UTF-32BE).

Success conditions

1. The call to pdf_text_get_unicode should NOT return PDF_OK.

Test: pdf_text_get_unicode_036

Get the contents of a non-empty text object with language info (no country info), in UTF-32BE without BOM and with lang/country information embedded (which is NOT supported in UTF-32BE).

Success conditions

1. The call to pdf_text_get_unicode should NOT return PDF_OK.

Test: pdf_text_get_unicode_037

Get the contents of an empty text object with lang/country info, in UTF-32BE without BOM and with lang/country information embedded (which is NOT supported in UTF-32BE).

Success conditions

1. The call to pdf_text_get_unicode should NOT return PDF_OK.

Test: pdf_text_get_unicode_038

Get the contents of an empty text object with language info (no country info), in UTF-32BE without BOM and with lang/country information embedded (which is NOT supported in UTF-32BE).

Success conditions

1. The call to pdf_text_get_unicode should NOT return PDF_OK.

Test: pdf_text_get_unicode_039

Get the contents of a non-empty text object with lang/country info, in UTF-32BE with BOM and with lang/country information embedded (which is NOT supported in UTF-32BE).

Success conditions

1. The call to pdf_text_get_unicode should NOT return PDF_OK.

Test: pdf_text_get_unicode_040

Get the contents of a non-empty text object with language info (no country info), in UTF-32BE with BOM and with lang/country information embedded (which is NOT supported in UTF-32BE).

Success conditions

1. The call to pdf_text_get_unicode should NOT return PDF_OK.

Test: pdf_text_get_unicode_041

Get the contents of an empty text object with lang/country info, in UTF-32BE with BOM and with lang/country information embedded (which is NOT supported in UTF-32BE).

Success conditions

1. The call to pdf_text_get_unicode should NOT return PDF_OK.

Test: pdf_text_get_unicode_042

Get the contents of an empty text object with language info (no country info), in UTF-32BE with BOM and with lang/country information embedded (which is NOT supported in UTF-32BE).

Success conditions

1. The call to pdf_text_get_unicode should NOT return PDF_OK.

Test: pdf_text_get_unicode_043

Get the contents of a non-empty text object in UTF-32LE without BOM.

Success conditions

1. The call to pdf_text_get_unicode should return PDF_OK.

2. The returned string must be the expected one, not NUL terminated.

3. The returned length must be the expected one.

Test: pdf_text_get_unicode_044

Get the contents of a non-empty text object in UTF-32LE with BOM.

Success conditions

1. The call to pdf_text_get_unicode should return PDF_OK.

2. The returned string must be the expected one, not NUL terminated.

3. The returned length must be the expected one, including the length of the BOM in UTF-32.

Test: pdf_text_get_unicode_045

Get the contents of an empty text object in UTF-32LE without BOM.

Success conditions

1. The call to pdf_text_get_unicode should return PDF_OK.

2. The returned string must be NULL.

3. The returned length must be zero.

Test: pdf_text_get_unicode_046

Get the contents of an empty text object in UTF-32LE with BOM.

Success conditions

1. The call to pdf_text_get_unicode should return PDF_OK.

2. The returned string must only contain the BOM in UTF-32LE, not NUL terminated.

3. The returned length must be equal to the length of the BOM in UTF-32.

Test: pdf_text_get_unicode_047

Get the contents of a non-empty text object with lang/country info, in UTF-32LE without BOM and with lang/country information embedded (which is NOT supported in UTF-32LE).

Success conditions

1. The call to pdf_text_get_unicode should NOT return PDF_OK.

Test: pdf_text_get_unicode_048

Get the contents of a non-empty text object with language info (no country info), in UTF-32LE without BOM and with lang/country information embedded (which is NOT supported in UTF-32LE).

Success conditions

1. The call to pdf_text_get_unicode should NOT return PDF_OK.

Test: pdf_text_get_unicode_049

Get the contents of an empty text object with lang/country info, in UTF-32LE without BOM and with lang/country information embedded (which is NOT supported in UTF-32LE).

Success conditions

1. The call to pdf_text_get_unicode should NOT return PDF_OK.

Test: pdf_text_get_unicode_050

Get the contents of an empty text object with language info (no country info), in UTF-32LE without BOM and with lang/country information embedded (which is NOT supported in UTF-32LE).

Success conditions

1. The call to pdf_text_get_unicode should NOT return PDF_OK.

Test: pdf_text_get_unicode_051

Get the contents of a non-empty text object with lang/country info, in UTF-32LE with BOM and with lang/country information embedded (which is NOT supported in UTF-32LE).

Success conditions

1. The call to pdf_text_get_unicode should NOT return PDF_OK.

Test: pdf_text_get_unicode_052

Get the contents of a non-empty text object with language info (no country info), in UTF-32LE with BOM and with lang/country information embedded (which is NOT supported in UTF-32LE).

Success conditions

1. The call to pdf_text_get_unicode should NOT return PDF_OK.

Test: pdf_text_get_unicode_053

Get the contents of an empty text object with lang/country info, in UTF-32LE with BOM and with lang/country information embedded (which is NOT supported in UTF-32LE).

Success conditions

1. The call to pdf_text_get_unicode should NOT return PDF_OK.

Test: pdf_text_get_unicode_054

Get the contents of an empty text object with language info (no country info), in UTF-32LE with BOM and with lang/country information embedded (which is NOT supported in UTF-32LE).

Success conditions

1. The call to pdf_text_get_unicode should NOT return PDF_OK.


pdf_text_get_hex

Test: pdf_text_get_hex_001

Get the contents of a non-empty text object in Hexadecimal representation in ASCII

Success conditions

1. The call to pdf_text_get_hex should return a valid string, NUL terminated.

2. The contents of the returned string must be the expected ones.

3. The length of the string must be non-zero.

Test: pdf_text_get_hex_002

Get the contents of an empty text object in Hexadecimal representation in ASCII

Success conditions

1. The call to pdf_text_get_hex should return a valid string, NUL terminated.

2. The length of the string must be zero.


pdf_text_set_host

Test: pdf_text_set_host_001

Set the contents of a text object with an input valid host-encoded string

Success conditions

1. The call to pdf_text_set_host should return PDF_OK.

2. The contents of the text object must be the expected ones.

Test: pdf_text_set_host_002

Set the contents of a text object with an input invalid host-encoded string

Success conditions

1. The call to pdf_text_set_host should NOT return PDF_OK.

Test: pdf_text_set_host_003

Set the contents of a text object with an input string encoded in an invalid host encoding

Success conditions

1. The call to pdf_text_set_host should NOT return PDF_OK.


pdf_text_set_pdfdocenc

Test: pdf_text_set_pdfdocenc_001

Set the contents of a text object with an input valid PDF Doc Encoded string

Success conditions

1. The call to pdf_text_set_pdfdocenc should return PDF_OK.

2. The contents of the text object must be the expected ones.

Test: pdf_text_set_pdfdocenc_002

Set the contents of a text object with an input empty PDF Doc Encoded string

Success conditions

1. The call to pdf_text_set_pdfdocenc should return PDF_OK.

2. The contents of the text object must be empty.

Test: pdf_text_set_pdfdocenc_003

Set the contents of a text object with an input invalid PDF Doc Encoded string

Success conditions

1. The call to pdf_text_set_pdfdocenc should NOT return PDF_OK.


pdf_text_set_unicode

Test: pdf_text_set_unicode_001

Set the contents of a text object with an input valid UTF-8 encoded string (containing 8-bit, 16-bit, 24-bit and 32-bit code points!) without BOM

Success conditions

1. The call to pdf_text_set_unicode should return PDF_OK.

2. The contents of the text object must be the expected ones (without BOM).

Test: pdf_text_set_unicode_002

Set the contents of a text object with an input valid UTF-16BE encoded string (16-bit and 32-bit code points!) without BOM

Success conditions

1. The call to pdf_text_set_unicode should return PDF_OK.

2. The contents of the text object must be the expected ones (without BOM).

Test: pdf_text_set_unicode_003

Set the contents of a text object with an input valid UTF-16LE encoded string (16-bit and 32-bit code points!) without BOM

Success conditions

1. The call to pdf_text_set_unicode should return PDF_OK.

2. The contents of the text object must be the expected ones (without BOM).

Test: pdf_text_set_unicode_004

Set the contents of a text object with an input valid UTF-16HE encoded string (16-bit and 32-bit code points!) without BOM

Success conditions

1. The call to pdf_text_set_unicode should return PDF_OK.

2. The contents of the text object must be the expected ones (without BOM).

Test: pdf_text_set_unicode_005

Set the contents of a text object with an input valid UTF-32BE encoded string without BOM

Success conditions

1. The call to pdf_text_set_unicode should return PDF_OK.

2. The contents of the text object must be the expected ones (without BOM).

Test: pdf_text_set_unicode_006

Set the contents of a text object with an input valid UTF-32LE encoded string without BOM

Success conditions

1. The call to pdf_text_set_unicode should return PDF_OK.

2. The contents of the text object must be the expected ones (without BOM).

Test: pdf_text_set_unicode_007

Set the contents of a text object with an input valid UTF-32HE encoded string without BOM

Success conditions

1. The call to pdf_text_new_from_unicode should return PDF_OK.

2. The contents of the text object must be the expected ones (without BOM).

Test: pdf_text_set_unicode_008

Set the contents of a text object with an input valid UTF-8 encoded string (containing 8-bit, 16-bit, 24-bit and 32-bit code points!) with BOM

Success conditions

1. The call to pdf_text_set_unicode should return PDF_OK.

2. The contents of the text object must be the expected ones (without BOM).

Test: pdf_text_set_unicode_009

Set the contents of a text object with an input valid UTF-16BE encoded string (16-bit and 32-bit code points!) with BOM

Success conditions

1. The call to pdf_text_set_unicode should return PDF_OK.

2. The contents of the text object must be the expected ones (without BOM).

Test: pdf_text_set_unicode_010

Set the contents of a text object with an input valid UTF-16LE encoded string (16-bit and 32-bit code points!) with BOM

Success conditions

1. The call to pdf_text_set_unicode should return PDF_OK.

2. The contents of the text object must be the expected ones (without BOM).

Test: pdf_text_set_unicode_011

Set the contents of a text object with an input valid UTF-16HE encoded string (16-bit and 32-bit code points!) with BOM

Success conditions

1. The call to pdf_text_set_unicode should return PDF_OK.

2. The contents of the text object must be the expected ones (without BOM).

Test: pdf_text_set_unicode_012

Set the contents of a text object with an input valid UTF-32BE encoded string with BOM

Success conditions

1. The call to pdf_text_set_unicode should return PDF_OK.

2. The contents of the text object must be the expected ones (without BOM).

Test: pdf_text_set_unicode_013

Set the contents of a text object with an input valid UTF-32LE encoded string with BOM

Success conditions

1. The call to pdf_text_set_unicode should return PDF_OK.

2. The contents of the text object must be the expected ones (without BOM).

Test: pdf_text_set_unicode_014

Set the contents of a text object with an input valid UTF-32HE encoded string with BOM

Success conditions

1. The call to pdf_text_set_unicode should return PDF_OK.

2. The contents of the text object must be the expected ones (without BOM).


Test: pdf_text_set_unicode_015

Set the contents of a text object with an input invalid UTF-8 encoded string without BOM

Success conditions

1. The call to pdf_text_set_unicode should NOT return PDF_OK.

2. The contents of the text object must remain unchanged.

Test: pdf_text_set_unicode_016

Set the contents of a text object with an input invalid UTF-16BE encoded string without BOM

Success conditions

1. The call to pdf_text_set_unicode should NOT return PDF_OK.

2. The contents of the text object must remain unchanged.

Test: pdf_text_set_unicode_017

Set the contents of a text object with an input invalid UTF-16LE encoded string without BOM

Success conditions

1. The call to pdf_text_set_unicode should NOT return PDF_OK.

2. The contents of the text object must remain unchanged.

Test: pdf_text_set_unicode_018

Set the contents of a text object with an input invalid UTF-16HE encoded string without BOM

Success conditions

1. The call to pdf_text_set_unicode should NOT return PDF_OK.

2. The contents of the text object must remain unchanged.

Test: pdf_text_set_unicode_019

Set the contents of a text object with an input invalid UTF-32BE encoded string without BOM

Success conditions

1. The call to pdf_text_set_unicode should NOT return PDF_OK.

2. The contents of the text object must remain unchanged.

Test: pdf_text_set_unicode_020

Set the contents of a text object with an input invalid UTF-32LE encoded string without BOM

Success conditions

1. The call to pdf_text_set_unicode should NOT return PDF_OK.

2. The contents of the text object must remain unchanged.

Test: pdf_text_set_unicode_021

Set the contents of a text object with an input invalid UTF-32HE encoded string without BOM

Success conditions

1. The call to pdf_text_set_unicode should NOT return PDF_OK.

2. The contents of the text object must remain unchanged.

Test: pdf_text_set_unicode_022

Set the contents of a text object with an input invalid UTF-8 encoded string with BOM

Success conditions

1. The call to pdf_text_set_unicode should NOT return PDF_OK.

2. The contents of the text object must remain unchanged.

Test: pdf_text_set_unicode_023

Set the contents of a text object with an input invalid UTF-16BE encoded string with BOM

Success conditions

1. The call to pdf_text_set_unicode should NOT return PDF_OK.

2. The contents of the text object must remain unchanged.

Test: pdf_text_set_unicode_024

Set the contents of a text object with an input invalid UTF-16LE encoded string with BOM

Success conditions

1. The call to pdf_text_set_unicode should NOT return PDF_OK.

2. The contents of the text object must remain unchanged.

Test: pdf_text_set_unicode_025

Set the contents of a text object with an input invalid UTF-16HE encoded string with BOM

Success conditions

1. The call to pdf_text_set_unicode should NOT return PDF_OK.

2. The contents of the text object must remain unchanged.

Test: pdf_text_set_unicode_026

Set the contents of a text object with an input invalid UTF-32BE encoded string with BOM

Success conditions

1. The call to pdf_text_set_unicode should NOT return PDF_OK.

2. The contents of the text object must remain unchanged.

Test: pdf_text_set_unicode_027

Set the contents of a text object with an input invalid UTF-32LE encoded string with BOM

Success conditions

1. The call to pdf_text_set_unicode should NOT return PDF_OK.

2. The contents of the text object must remain unchanged.

Test: pdf_text_set_unicode_028

Set the contents of a text object with an input invalid UTF-32HE encoded string with BOM

Success conditions

1. The call to pdf_text_set_unicode should NOT return PDF_OK.

2. The contents of the text object must remain unchanged.


Test: pdf_text_set_unicode_029

Set the contents of a text object with an input valid UTF-16BE encoded string with BOM and embedded language/country information (it should treat that information as standard UTF-16BE)

Success conditions

1. The call to pdf_text_set_unicode should return PDF_OK.

2. The contents of the text object must be the expected ones.

3. The language code must be empty.

4. The country code must be empty.

Test: pdf_text_set_unicode_030

Set the contents of a text object with an input valid UTF-16BE encoded string without BOM and embedded language/country information (it should treat that information as standard UTF-16BE)

Success conditions

1. The call to pdf_text_set_unicode should return PDF_OK.

2. The contents of the text object must be the expected ones.

3. The language code must be empty.

4. The country code must be empty.


pdf_text_concat

Test: pdf_text_concat_001

Concatenate two non-empty text objects with the same lang/country information. Don't override langinfo.

Success conditions

1. The call to pdf_text_concat should return PDF_OK.

2. The contents of the output text object must be the expected ones.

3. The lang/country information in the output object must remain unchanged.

Test: pdf_text_concat_002

Concatenate two non-empty text objects without lang/country information. Don't override langinfo.

Success conditions

1. The call to pdf_text_concat should return PDF_OK.

2. The contents of the output text object must be the expected ones.

3. The lang/country information in the output object must be empty.

Test: pdf_text_concat_003

Concatenate two non-empty text objects with different lang/country information. Don't override langinfo.

Success conditions

1. The call to pdf_text_concat should NOT return PDF_OK.

2. The contents of the output text object must remain unchanged.


Test: pdf_text_concat_004

Concatenate two empty text objects with the same lang/country information. Don't override langinfo.

Success conditions

1. The call to pdf_text_concat should return PDF_OK.

2. The contents of the output text object should be empty.

3. The lang/country information in the output object must remain unchanged.

Test: pdf_text_concat_005

Concatenate two empty text objects without lang/country information. Don't override langinfo.

Success conditions

1. The call to pdf_text_concat should return PDF_OK.

2. The contents of the output text object should be empty.

3. The lang/country information in the output object must be empty.

Test: pdf_text_concat_006

Concatenate two empty text objects with different lang/country information. Don't override langinfo.

Success conditions

1. The call to pdf_text_concat should NOT return PDF_OK.

2. The contents of the output text object must remain unchanged.

Test: pdf_text_concat_007

Concatenate two non-empty text objects with the same lang/country information. Override langinfo.

Success conditions

1. The call to pdf_text_concat should return PDF_OK.

2. The contents of the output text object must be the expected ones.

3. The lang/country information in the output object must remain unchanged.

Test: pdf_text_concat_008

Concatenate two non-empty text objects without lang/country information. Override langinfo.

Success conditions

1. The call to pdf_text_concat should return PDF_OK.

2. The contents of the output text object must be the expected ones.

3. The lang/country information in the output object must be empty.

Test: pdf_text_concat_009

Concatenate two non-empty text objects with different lang/country information. Override langinfo.

Success conditions

1. The call to pdf_text_concat should return PDF_OK.

2. The contents of the output text object must be the expected ones.

3. The lang/country information in the output object must remain unchanged.


Test: pdf_text_concat_010

Concatenate two empty text objects with the same lang/country information. Override langinfo.

Success conditions

1. The call to pdf_text_concat should return PDF_OK.

2. The contents of the output text object should be empty.

3. The lang/country information in the output object must remain unchanged.

Test: pdf_text_concat_011

Concatenate two empty text objects without lang/country information. Override langinfo.

Success conditions

1. The call to pdf_text_concat should return PDF_OK.

2. The contents of the output text object should be empty.

3. The lang/country information in the output object must be empty.

Test: pdf_text_concat_012

Concatenate two empty text objects with different lang/country information. Override langinfo.

Success conditions

1. The call to pdf_text_concat should return PDF_OK.

2. The contents of the output text object should be empty.

3. The lang/country information in the output object must be empty.


pdf_text_replace

Test: pdf_text_r