Commit Graph

139 Commits

Author SHA1 Message Date
Marcin Smoczyński
a9cb37d7f4 tests: add proper catch2 handling
Add proper catch2 support:
 - add catch2 as a submodule
 - add cmake function to add test easily
 - discover each test in test binary
 - remove copies of catch.hpp
 - do not try to process tests for rt1051

Do not test internals of utf8, only public interface (nasty bugs could
occur otherwise).

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2020-06-24 10:38:14 +02:00
Marcin Smoczyński
737e586dde [EGD-3300] allow empty e164 on parsing
Do not throw on empty e164 while parsing number records.

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2020-06-19 15:06:46 +02:00
rkubiak01
9cc941d8d2 [EGD-2857] vfs fixes (#439)
* changed microtar and sbini to c++

* VFS: fixes for absolute paths, fprintf wrappers

* Create sys/user during database tests

* review: removed parenthesis around return values in VFS

* changelog updated

* module update

* module updates
2020-06-18 12:27:53 +02:00
Marcin Smoczyński
0936930063 [EGD-2593] improved matching contact by numbers
Introduced format aware phone number comparison to allow improved
matching phone numbers with contacts.

Phone numbers are also displayed formatted on a phonebook/calllog
list view and on detailed contact info view.

Entered and e164 number are verified to match each other during
processing db request.

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2020-06-17 14:01:38 +02:00
Przemyslaw Brudny
8e6d4b284e [EGD-3094] Cleanups, proper erase widget from list. 2020-06-03 19:23:16 +02:00
Przemyslaw Brudny
d2d97160e2 [EGD-3094] Basic Phonebook contact list migration to new ListView. 2020-06-03 19:23:16 +02:00
Roman Kubiak
142b71a6a6 sbini module update 2020-06-02 11:28:53 +02:00
Radoslaw Wicik
f9791b76d7 [EGD-3246] Repair crash on Sunday 2020-06-01 09:25:44 +02:00
Radoslaw Wicik
22d003ad61 [EGD-3233] Make log messages finish with linux line end. 2020-05-28 17:23:52 +02:00
alek
aa5999b070 [EGD-2830] Dialog extended for multiple options.
One dialog window in sms app instead of mulitple ones.
Notifictaions about  No SIM card inserted.
2020-05-28 14:13:12 +02:00
Marcin Smoczyński
4c4c7e93ff [EGD-3234] tests: rename time tests
Reserve 'unittest' prefix for fully automated Catch2 tests.
2020-05-27 10:41:17 +02:00
Marcin Smoczyński
d5cb13d956 [EGD-3234] tests: fix utf8 tests
Convert utf8 tests which were written with gtest help to catch2
framework.

Fix broken index operator test (index operator decodes to UTF-32).

Remove dead gtest dependency
2020-05-27 10:41:17 +02:00
Marcin Smoczyński
bfc630b96a [EGD-3234] tests: rename utf8 tests 2020-05-27 10:41:17 +02:00
Marcin Smoczyński
c3e5ef9f15 [EGD-3234] tests: rename log tests
Log tests are not unit tests because they do not provide binary
information about status - they are manual tests.
2020-05-27 10:41:17 +02:00
kkleczkowski
b70ad6c5fc Egd 3196 small cellular refactor (#365)
* [EGD-3196] Fixed fatals in cellular.

* [EGD-3196] Fixed sms sending.

* [EGD-3196] Fixed timeout in ConfProcedure.

* [EGD-3196] Board type moved to Event Manager.

* [EGD-3196] Event Manager API renamed.

* [EGD-3196] Misiing files.

* [EGD-3196] Fixed modem status message, return code in magnetometer driver, case in modem init procedure.

* [EGD-3196] PR suggestions applied.

* [EGD-3196] Style fix.

* [EGD-3196} GetBoardName -> c_str();

* [EGD-3196] Style fix.

* [EGD-3196] PR suggestions added.

* [EGD-3196] Style fix...

* [EGD-3196] Style fix again.

Co-authored-by: Kuba Kleczkowski <dd>
2020-05-21 16:56:24 +02:00
Marcin Smoczyński
a4a8315b97 fix empty calllog list item
Fix empty calllog title when number comes in national format. The
problem was caused by:
 1. making assumption that every number from cellular network comes in
 e164 format which is not true,
 2. using e164 number when looking for contact matching calllog entry
 without checking if e164 exists for calllog entry.
Fix problem by:
a.d.1 - replacing `PhoneNumber::viewFromE164` with less strict
`PhoneNumber::Parse` method which basically is a convenience method
which creates `PhoneNumber` entity and uses it to create a `View`.
a.d.2 - instead of fetching e164 directly introduce `getNonEmpty` method
of a View, which returns e164 number if it is present and entered number
otherwise.

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2020-05-18 17:31:57 +02:00
Marcin Smoczyński
b434745311 utils: fix various minor bugs in phonenumber
Bugs:
 - invalid number validation
 - no `const` qualifier in comparison operators
 - lack of comparison operator for PhoneNumber::View

Add appropriate unit tests.
2020-05-18 01:17:08 +02:00
Alek Rudnik
08358df991 Egd 2825 sms clipboard (#362)
* [EGD-2825] clipboard class implementation

* [EGD-2825] returnToPreviousView moved from appwindow to application class

* [EGD-2825] paste

* [EGD-2825] fixed paste label

* [EGD-2825] copy

* [EGD-2825] comment

* [EGD-2825] removed init data

* [EDG-2825] add clipboard UT

* [EGD-2825] add sms fw option
renamed SMSTemplateData to SMSTextData

* [EGD-2825] fxies in EventStore

* [EGD-2825] PR fixes

* [EGD-2825] rem not needed comment
2020-05-15 13:34:26 +02:00
rkubiak01
7cac882c7a [2306] VFS: support .boot.ini and "current" and "previous" os types (#315)
* VFS: support .boot.ini and "current" and "previous" os types

* fixes for first batch of comments
- moved crc32 functions to a seperate file
- changed naming of constant with _
- removed one magic number
- crc methods now cross platform

* using smart pointer for buffer management

* created a simple USER_FILE macro for database names

* removed commented-out code

* style fixes

* Updated crc32 version

* Update module-vfs/vfs-utils.cpp

Co-Authored-By: Alek Rudnik <54846206+alekrudnik@users.noreply.github.com>

* Update module-vfs/vfs-utils.cpp

Co-Authored-By: Alek Rudnik <54846206+alekrudnik@users.noreply.github.com>

* renamed USER_FILE to USER_PATH macro, this was also
bromen and was returning incorrect paths, std::filesystem::path
behavior is causing these issues.

* VFS: remove method changed

* fixed path for assets copy

* UNITTEST: vfs test fixed

* VFS: changed computeCRC32 return type to void

* Max supported partition to 2 (was 1)

* EOL in vfs.cpp

* nullptr check in computeCRC32
include for log.hpp fixed

* flash_eMMC merged properly

* CRC32 commit update

* testBuild

* fix newline at start of smsdb.cpp
removed test from cmake

* no user/ folder on the root of emmc causes sqlite3 to fault
this adds a create empty user call for rt1051

* flash script fixes
- do not use build-*/sys
- common.sh contains a static list of iles that land on the flash

Co-authored-by: Alek Rudnik <54846206+alekrudnik@users.noreply.github.com>
2020-05-08 10:27:17 +02:00
Marcin Smoczyński
c47923d70a [EGD-3107] Call number validation
Use specialized class to to pass phone number between apps and services
instead of ambigious std::string. Introduced class (utils::PhoneNumber)
wraps calls to libphonenumber providing more convienient interface.
However using libphonenumber directly may be resource hungry in terms
of stack, heap and cpu usage, so helper class has been introduced to
pass information about phone numbers (utils::PhoneNumber::View). It is
designed to maintain integrity thus can be created from an instance of
utils::PhoneNumber only or moved/copied to.

Add new field to the calllog db holding e164 formatted number. Both
entered and e164 numbers will be needed to be able to match with
contacts correctly.

Add constexpr information about country codes (utils::country).
2020-05-05 00:51:53 +02:00
Marcin Smoczyński
c9062e83e0 doc: cleanup readme files for doxygen 2020-04-28 17:34:00 +02:00
Marcin Smoczyński
7cc27ee143 [EGD-3113] Add thread safety to RE2 2020-04-28 17:01:33 +02:00
Marcin Smoczyński
86bdeb347d [EGD-3113] Add thread safety to libphonenumber
Add thread safety based on the RTOS wrapper and FreeRTOS mutex. The
mutex protects regexp cache only so additional safety on regexp level is
needed.

Add method to get currently running thread - needed by thread checker
class in libphonenumber.
2020-04-28 17:01:33 +02:00
Przemyslaw Brudny
6540a27de4 [EGD-3040] PR cleanups. 2020-04-28 14:10:41 +02:00
Radoslaw Wicik
49ca4257da [EGD-3151] Add fixes for SIM detection
Add proper passing SERIAL_PORT info
Convert cmux to unique_ptr in module-cellular
2020-04-27 17:24:24 +02:00
Alek Rudnik
62c37c4107 [EGD-2798] use either e164 number or name (#321) 2020-04-22 11:16:22 +02:00
Adam Dobrowolski
19c1f66733 EGD-3056 Messages debugging print edbug.hpp option added 2020-04-15 16:50:19 +02:00
Marcin Smoczyński
5f7d52cb2b [EGD-2592] utils: add libphonenumber
Add libphonumber support:
 - no thread safety support (disabled mutexes, etc.)
 - use re2 regexes instead of ICU's
 - don't normalize utf8 decimals - use ASCII decimals only
2020-04-08 18:23:45 +02:00
Marcin Smoczyński
268385b093 [EGD-2591] utils: add protobuf library support
Add protobuf-lite library (thread safety turned off).
2020-04-08 18:23:45 +02:00
Marcin Smoczyński
d41ceb4611 [EGD-3052] utils: add re2 library support
Add RE2 library with thread safety option turned off.
2020-04-08 18:23:45 +02:00
rkubiak01
bdb48fb7e5 added sbini library for simple C INI parser support
EGD-2922
2020-04-08 12:40:50 +02:00
Adam Dobrowolski
86353db8f5 EGD-3055 Make tests compile on linux 2020-04-08 12:23:53 +02:00
Adam Dobrowolski
2b07ca005f EGD-3055 use PRIu64 to log time 2020-04-08 12:23:53 +02:00
Adam Dobrowolski
4a61f400e7 EGD-3055 Fixed printf issues 2020-04-08 12:23:53 +02:00
Adam Dobrowolski
42ccb924cf EGD-3055 FreeRTOS asssert fixed, added force printf check on logging macros in log.h 2020-04-08 12:23:53 +02:00
Radoslaw Wicik
d31affe660 [EGD-3037] Add locale and tzdata to docker to resolve utils time UT error 2020-04-07 13:07:20 +02:00
Alek-Mudita
36be49c15b Egd 3046 unexpected reset (#274)
* [EGD-3046] fix HF handler
added boot reason printing and clearing

* [EGD-3046] added prining of  GPR_5 on checking boot reason

* [EGD-3046] added halt if debugging

* [EGD-3046] halt if debugging only in exit

* [EGD-3046] rename

* [EGD-3046] added DEBUG check

* [EGD-3046] fixed formatting

* [EGD-3046] fixed includes
2020-04-01 16:34:56 +02:00
rkubiak01
c83546c332 added crc32 as a submodule 2020-03-31 11:41:50 +02:00
Alek-Mudita
a449edc03d [EGD-3039] fix for time conversion UT (#269) 2020-03-26 12:58:53 +01:00
Alek-Mudita
1446a4bff8 Egd 2539 duration class (#258)
* [GED-2539] Timestamp : changed buffer to heap one

[EGD-2539] implemented 1st version of Duration class

[EGD-2539] added autoformating of the output

[EGD-2539] clean up

[EGD-2539] used duration in call and calllog
added Duration operators

[EGD-2539] add better duartions to calllog.db

[EGD-2539] format file

* [EGD-2539] fixes after rebase

* [EGD-2539] displayed format follows design guidline

* [EGD-2539] added UT for duration class and necessary FW fixes

* [EGD-2539] fixed tim_conversion UT

* [EGD-2539] PR fixes

* [EGD-2539] added move constructor to UTF8 class

* [EGD-2539] added checking for nullptr in fillContactData

* [EGD-2539] PR fixes
2020-03-25 17:14:00 +01:00
Przemyslaw Brudny
c0822b6658 [EDG-3019] Moved log.hpp and debug.hpp into main PurePhone repo 2020-03-24 15:55:32 +01:00
Adam Dobrowolski
7674b44385 EGD-3026 PR applied, fixed buid for release 2020-03-24 14:17:12 +01:00
Adam Dobrowolski
abe6813ce6 EGD-3026 Wall Werror and Wextra added to project 2020-03-24 14:17:12 +01:00
Przemyslaw Brudny
8f92715951 [EDG-3019] Segger utils moved to git submodule 2020-03-23 18:37:37 +01:00
Alek-Mudita
f94688f996 [EGD-2998] fixed UT for Utils. (#253)
* [EGD-2998] fixed UT for Utils.

* [EGD-2998] clean up

* [EGD-2998] missing cmake file
2020-03-23 16:21:17 +01:00
Radoslaw Wicik
8dea0d7675 [EGD-2981] Add UT target: check
Clean CMake tests targets
2020-03-20 16:46:11 +01:00
Przemyslaw Brudny
67db9e5885 [EDG-2995] FreeRTOSV10 Core tracing patch moved to separate directory, cleanups. 2020-03-20 14:28:57 +01:00
Przemyslaw Brudny
8f3cc846d2 [EGD-2978] SystemView build parameter added and log_redirect cleanups 2020-03-20 14:28:57 +01:00
Przemyslaw Brudny
98cd819ffb [EGD-2978] PR cleanup changes 2020-03-20 14:28:57 +01:00
Przemyslaw Brudny
e7cb0cb579 [EGD-2978] Formatter cleanups 2020-03-20 14:28:57 +01:00